How to create an emergency boot-floppy with just a safe kernel
Since time and again the question occurs what to do if you failed in compiling a new kernel or blew your boot-loader, here's a short and easy way to have at least a working kernel on a boot-floppy:

configure a kernel. be sure, it works! do not include probably unsafe or experimantal parts, if you do not really need them! Do not use modules! - at least not for needed parts!

make clean dep bzImage

if your kernel is > 1.4MB go back to step 1 and remove some features (are you sure you need firewire for booting?)

cp /usr/src/linux/arch/i386/boot/bzImage /tmp/rescuekernel

rdev /tmp/rescuekernel /dev/hdxx where xx is your root-device, eg. a5

dd if=/tmp/rescuekernel of=/dev/fd0

you might want to repeat this with every kernel you find to run stable and fullfilling your requiered (not desired!) needs. you also might find it usefull to write-protect the floppy afterwards - kids and wifes like overwriting them

ad 1.: configuring a kernel is something every gentoo-user should be able to. just obey one basic rule: do not remove anything from a default vanilla-config if you are not absolutly sure you don't need it. missing initial consoles or keyboards are often heard problems afterwards. to get the original .config do a make mrproper
ad 2. make clean just to be sure - this is why we make a boot floppy
ad 5: I'm not sure rdev is in the default installation. if it is not, someone might please add the package name here!

PS: this of course does not help if you blew your root-device, it's just an emergency kernel!

hth

* ElCondor pasa *

PS: thanks to lx for the hint with make mkproper_________________Here I am the victim of my own choices and I'm just starting!

Last edited by ElCondor on Fri May 31, 2002 12:16 pm; edited 1 time in total

use make mrproper too clean out the kernel source tree (this also deletes .config) before doing make menuconfig ......

What does this disk do? boots the kernel and then continues the normal on disk (/dev/hda5) boot process.

Although this may be needed on some systems (non-bootable cdrom / unsupported filesystems), don't we already have a boot disk???. The gentoo cdrom is bootable and I can chroot into my custom-made gentoo distro using it. This way you can also from other crashes (wrong inittab) etc. Everybody should have a to get back into your system with a standard console.

Everybody should learn the following hard lesson:
NEVER EVER OVERWRITE YOUR KERNEL WITH AN UNTESTED ONE, WITHOUT SECURING THE ONE THAT WORKS. A kernel is a terrible thing to waste and before trying a new one you should always backup your old one and make a link into your boot manager (this way you can revert to your old system)._________________"Remember there's a big difference between kneeling down and bending over.", Frank Zappa

YES, you can always boot from cdrom,
BUT once you have a kernel supporting special hardware you have installed or eg needing special features only supported by a newer kernel (maybe 2.5) you might be glad having a boot-disk ready with it

Additionaly you can add own needed kernel-modules to your kernel which are not included on the gentoo-cd, but being loaded when booting from the boot-floppy.

I hope no one ever needs it, but due to my experiences I found it rather useful

* ElCondor pasa *_________________Here I am the victim of my own choices and I'm just starting!