Click to See Complete Forum and Search --> : Recompiling my kernel using GRUB


Jomboni
11-04-2001, 09:14 PM
So, I want to recompile my kernel to add joystick support and SCSI emulation. I followed the NHF files here and managed to get it compiled properly (I hope!) I copied the new System.map file over and copied bzImage over to /boot. Now what?? All the NHF files explain how to set up LILO, but not GRUB, and I'm not about to just jump in and make a change as big as replacing the kernel using guesswork!

fateswarm
11-04-2001, 11:18 PM
Oooh, come on! Use LILO..

Jomboni
11-04-2001, 11:44 PM
Can't... for some reason I can dual-boot my system with GRUB but not LILO, so GRUB it is...

bdg1983
11-05-2001, 06:19 AM
All you need to do is add another section for the new kernel.

#
# /boot/grub/menu.lst - generated by Lizard
#

timeout = 10
splashscreen = (hd0,4)/boot/message.col31

default = 0

title = Linux-2.4.13-Modular
root = (hd0,4)
kernel = /boot/vmlinuz-2.4.13-modular hdd=ide-scsi idebus=42 ide0=ata66 vga=normal quiet root=/dev/hda6
initrd = /boot/initrd-2.4.13.gz

title = Linux-2.4.12-Modular
root = (hd0,4)
kernel = /boot/vmlinuz-2.4.12-modular hdd=ide-scsi idebus=42 ide0=ata66 vga=normal quiet root=/dev/hda6
initrd = /boot/initrd-2.4.12.gz

title = Linux-2.4.2-Modular
root = (hd0,4)
kernel = /boot/vmlinuz-2.4.2-modular hdd=ide-scsi idebus=42 ide0=ata66 vga=274 quiet root=/dev/hda6
initrd = /boot/initrd-2.4.2.gz

title = Linux-2.4.2-Rescue
root = (hd0,4)
kernel = /boot/vmlinuz-2.4.2-rescue vga=274 quiet root=/dev/hda6
initrd = /boot/initrd-2.4.2-rescue.gz

Forgot to mention Grub's config file...

/boot/grub/menu.lst

and nothing needs to be done after any modifications.

[ 05 November 2001: Message edited by: Logon Name Gone ]

Jomboni
11-05-2001, 05:16 PM
Ok, here is what I did so far:

make xconfig
make dep
make clean
make bzImage

and then copied System.map and bzImage over to /boot. What should my new entry look like?

I'd guess something along these lines:
kernel=/boot/bzImage vga=274 quiet root=/dev/hda6 (replaced with my own settings of course)


but what goes on the initrd line?

bdg1983
11-05-2001, 06:19 PM
I always rename my new kernel to vmlinuz-<version>-whatever and also System.map to System.map-<version> in order to have multiple kernels and System.map's reside in the /boot directory.

If you are using ext2 or ReiserFS etc. and you have support built into the kernel instead of loading as a module, then you shouldn't need a initrd (initial ramdisk).

I use ReiserFS for ALL my Linux filesystems and since I select Reiser to be a module, I need to update my initrd whenever I recompile a new kernel and have that loaded during boot.

Jomboni
11-05-2001, 11:42 PM
Ok, my filesystems are ext3. Do I need an initrd?

bdg1983
11-06-2001, 06:25 AM
I knew I should have mentioned more than just ext2 and ReiserFS.

ext3 and any other filesystem would be included in what I said about not needing a initrd if support for the filesystem is included in the kernel instead of being a module.

Do you have a initrd (from the original kernel) in your /boot directory?

otheos
11-06-2001, 07:23 AM
What do these stand for?

hdd=ide-scsi idebus=42 ide0=ata66

Jomboni
11-06-2001, 07:43 AM
I have one called initrd-2.4.7-10.img, and my menu.lst file calls it.

bigrigdriver
11-06-2001, 01:10 PM
For some good reading, check out Caldera (www.calderasystems.com) Support/Knowledge Base articles. Search for "Zen and the Art of Using Grub". ;)

bdg1983
11-06-2001, 05:49 PM
Originally posted by otheos:
<STRONG>What do these stand for?

hdd=ide-scsi idebus=42 ide0=ata66</STRONG>

scsi emulation for hdd - system bus speed - ide speed (ata33, 66 or 100)

A Google search for idebus or ide0 will give you more info.

bdg1983
11-06-2001, 05:52 PM
Originally posted by bigrigdriver:
<STRONG>For some good reading, check out Caldera (www.calderasystems.com) Support/Knowledge Base articles. Search for "Zen and the Art of Using Grub". ;)</STRONG>

Very good reading for anyone using Grub. I've often referred to that.
http://support.caldera.com/caldera and search for Grub

bdg1983
11-06-2001, 05:58 PM
Originally posted by Jomboni:
<STRONG>I have one called initrd-2.4.7-10.img, and my menu.lst file calls it.</STRONG>

If you have compiled filesystem support IN the kernel, then you may not need a initrd for the new kernel.

Your distro should have a script that will create a new initrd for the new kernel. Have a look for mkinitrd and also a related man page.

My distro does not have mkinitrd, so I just make a copy of the previous version initrd, gunzip and mount the initrd filesystem and then copy, delete or modify whatever I need. I then umount, gzip and copy the new initrd back to /boot. Of course I wrote a script that does all the steps except for the modifications within the initrd. Makes it a little easier.