KC8: How do I install a new kernel while still keeping my current one around so that I can use it if necessary?
These scripts automate updating and archiving kernels.
Do the following as root:
First check where your boot partition is mounted
Code: Select all
bash# grep boot /etc/fstab
Code: Select all
bash# nano /usr/sbin/kernel-save
Code: Select all
#!/bin/sh
# Substitute the ?? here with what came up in the grep /etc/fstab above
BOOT='/dev/hd??'
WHEN=`date +%y%m%d`
WHAT="$1"
mount $BOOT /boot
cp -v /boot/System.map "/boot/System.map-$WHEN-$WHAT"
cp -v /boot/bzImage "/boot/bzImage-$WHEN-$WHAT"
cp -v /boot/config "/boot/config-$WHEN-$WHAT"
Code: Select all
bash# nano /usr/sbin/kernel-install
Code: Select all
#!/bin/sh
# Substitute the ?? here with what came up in the grep /etc/fstab above
BOOT='/dev/hd??'
mount $BOOT /boot
cp -v /usr/src/linux/System.map /boot
cp -v /usr/src/linux/arch/i386/boot/bzImage /boot
cp -v /usr/src/linux/.config /boot/config
Code: Select all
bash# chmod 700 /usr/sbin/kernel-save
bash# chmod 700 /usr/sbin/kernel-install
Code: Select all
bash# kernel-save information-about-old-kernel
bash# kernel-install
Substitute the 'information-about-old-kernel' with a real bit of infomation...
kernel-save pre-alsa-09
kernel-save vanilla-2.4.19
kernel-save original-stable
The part about System.map may not be neccessary for everyone,
if you know you don't need it, then just comment it out.

