Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
KC8: Backup Kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Frequently Asked Questions
View previous topic :: View next topic  
Author Message
phypor
n00b
n00b


Joined: 25 Jun 2002
Posts: 68
Location: Texas

PostPosted: Fri Dec 06, 2002 7:05 pm    Post subject: KC8: Backup Kernel Reply with quote

Navigation: [prev KC7: How do I know when to compile something into the kernel, and when should I compile it as a module?] [next KC9: Multiple Kernels] [Kernel Compilation] [Table of Contents]


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:

bash# grep boot /etc/fstab

take note of the /dev/hd?? where /boot is mounted for the following scripts

Code:

bash# nano /usr/sbin/kernel-save

and paste in the following:
Code:

#!/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:

bash# nano /usr/sbin/kernel-install

and paste in the following:
Code:

#!/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

Finally, change the privs so those can be executed as root:
Code:

bash# chmod 700 /usr/sbin/kernel-save
bash# chmod 700 /usr/sbin/kernel-install

After kernel compile, to save a copy of your old kernel and install the new one do
Code:

bash# kernel-save information-about-old-kernel
bash# kernel-install


If you get a message about boot already being mounted, it doesn't affect anything.

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.
_________________
ALWAYS stay away from tanks enguled in fire.
- 2000 Emergency Response Guidebook, pg307
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Dec 06, 2002 8:27 pm    Post subject: Reply with quote

Feedback to [FAQF] KC: Kernel Compilation.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Frequently Asked Questions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum