]> git.friedersdorff.com Git - max/kernel_upgrades.git/blob - kernel_upgrade
Upgrade kernels on a slackware host
[max/kernel_upgrades.git] / kernel_upgrade
1 #!/bin/sh
2 VERSION=$1
3
4 download="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${VERSION}.tar.xz"
5
6 cd /usr/src
7 rm ./linux-${VERSION}.tar.xz
8 wget $download
9 tar xf ./linux-${VERSION}.tar.xz
10 rm ./linux
11 ln -s linux-${VERSION} ./linux             
12 cd /usr/src/linux
13
14 zcat /proc/config.gz > ./.config        
15 make olddefconfig                    
16 bash
17 make -j8 bzImage modules                
18 make modules_install                    
19
20 cp arch/x86/boot/bzImage /boot/vmlinuz-${VERSION}-maxf130                                   
21 cp .config /boot/config-${VERSION}-maxf130  
22 cp System.map /boot/System.map-${VERSION}-maxf130                                           
23
24 dkms autoinstall -k ${VERSION}-maxf130
25
26 mkinitrd -F /etc/mkinitrd.conf -k ${VERSION}-maxf130 -o /boot/initrd-${VERSION}-maxf130.gz      
27 vim /etc/lilo.conf                      
28 lilo                                    
29
30 echo "The following packages will need to be rebuilt:"
31 grep -l "lib/modules/$(uname -r)" /var/log/packages/*