Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Frequently Asked Questions
  • Search

KC8: Backup Kernel

Some of the most commonly heard questions in the Gentoo Community, along with answers.
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
phypor
n00b
n00b
User avatar
Posts: 68
Joined: Tue Jun 25, 2002 3:47 pm
Location: Texas

KC8: Backup Kernel

  • Quote

Post by phypor » Fri Dec 06, 2002 7:05 pm

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: Select all

bash# grep boot /etc/fstab
take note of the /dev/hd?? where /boot is mounted for the following scripts

Code: Select all

bash# nano /usr/sbin/kernel-save
and paste in the following:

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
and paste in the following:

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
Finally, change the privs so those can be executed as root:

Code: Select all

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: Select all

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
Top
rac
Bodhisattva
Bodhisattva
User avatar
Posts: 6553
Joined: Thu May 30, 2002 6:19 am
Location: Japanifornia
Contact:
Contact rac
Website

  • Quote

Post by rac » Fri Dec 06, 2002 8:27 pm

Feedback to [FAQF] KC: Kernel Compilation.
For every higher wall, there is a taller ladder
Top
Post Reply

2 posts • Page 1 of 1

Return to “Frequently Asked Questions”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic