]> git.friedersdorff.com Git - max/kernel_upgrades.git/commitdiff
Upgrade kernels on a slackware host
authorMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 1 Nov 2017 15:26:23 +0000 (15:26 +0000)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 1 Nov 2017 15:26:23 +0000 (15:26 +0000)
kernel_upgrade [new file with mode: 0755]

diff --git a/kernel_upgrade b/kernel_upgrade
new file mode 100755 (executable)
index 0000000..0b489dc
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+VERSION=$1
+
+download="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${VERSION}.tar.xz"
+
+cd /usr/src
+rm ./linux-${VERSION}.tar.xz
+wget $download
+tar xf ./linux-${VERSION}.tar.xz
+rm ./linux
+ln -s linux-${VERSION} ./linux             
+cd /usr/src/linux
+
+zcat /proc/config.gz > ./.config        
+make olddefconfig                    
+bash
+make -j8 bzImage modules                
+make modules_install                    
+
+cp arch/x86/boot/bzImage /boot/vmlinuz-${VERSION}-maxf130                                   
+cp .config /boot/config-${VERSION}-maxf130  
+cp System.map /boot/System.map-${VERSION}-maxf130                                           
+
+dkms autoinstall -k ${VERSION}-maxf130
+
+mkinitrd -F /etc/mkinitrd.conf -k ${VERSION}-maxf130 -o /boot/initrd-${VERSION}-maxf130.gz      
+vim /etc/lilo.conf                      
+lilo                                    
+
+echo "The following packages will need to be rebuilt:"
+grep -l "lib/modules/$(uname -r)" /var/log/packages/*