-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile kernel.sh
81 lines (59 loc) · 1.27 KB
/
compile kernel.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# KERNEL: COMPILE AND INSTALL
# Search stable kernel in:
www.kernel.org
# Download
wget -c https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.0.8.tar.xz
# Show installed kernels:
uname -r
# The kernel are in /usr/src
ls /usr/src
# Show size. I need 100Mb in /boot and 5Gb en / to compile
du -hsc carpeta/
# Extract
tar xvf linux-5.0.8.tar.xz
# Move zipped folder
mkdir /var/kernel
mv linux-5.0.8 /var/kernel
# Show hardware info
lshw | less
dmidecode | less
lspci
lscpu
vmstat
# Delete previous configurations
make mrproper
# Open graphic tools to select the setting of my hardware
make menuconfig
# save config as .config file
# Compile the kernel
make
# Optional: Install modeles.
make modules_install
# Install:
make install
# Verify files created:
# initrd.img-*
# System-map-*
# vmlinuz-*
# config-*
# * version ej. 3.16.0
ls /boot/
# If initrd.img-* not exists, create it with:
mkinitramsfs -o /boot/ initrd.img-*
# Update grub menu:
update-grub
# Verify actual kernel version:
uname -r
# Reboot and select the new kernel
reboot
# Check errors
dmesg | grep -i error
dmesg | grep -i warning
# Verify kernels
ls /boot/
dpkg --get-selections | grep linux-image
# Uninstall previous kernel version
# ** arch
apt remove --purge linux-image-*-**
# Update grub
update-grub