[PLUG] getting FC4 to boot custom kernel

Larry Brigman larry.brigman at gmail.com
Tue Feb 21 23:52:56 UTC 2006


I have done this before but I cannot seem to find the resources that
explain it to me now.

The problem:
I have built a kernel from kernel.org (with various patches) to try to
help me solve one
of my problems with process scheduling.  It gets built but fails with a kernel
panic.  I have fixed the initrd image to include the various things
that the FC4 kernels
have in the initrd file. The grub lines look exactly like any of the
other FC4 kernel lines.

The question:
1) How to get the kernel build to place the correct files for loading
modules into
the initrd? (LVM and ata_piix modules).
2) How to tell grub the proper configuration to boot my kernel?

init file from inside my initrd image
------------------------------------
#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounted /proc filesystem
echo Mounting sysfs
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mknod /dev/console c 5 1
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mkdir /dev/pts
mkdir /dev/shm
echo Starting udev
/sbin/udevstart
echo -n "/sbin/hotplug" > /proc/sys/kernel/hotplug
echo "Loading scsi_mod.ko module"
insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
echo "Loading libata.ko module"
insmod /lib/libata.ko
echo "Loading ata_piix.ko module"
insmod /lib/ata_piix.ko
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading dm-mirror.ko module"
insmod /lib/dm-mirror.ko
echo "Loading dm-zero.ko module"
insmod /lib/dm-zero.ko
echo "Loading dm-snapshot.ko module"
insmod /lib/dm-snapshot.ko
/sbin/udevstart
echo Making device-mapper control node
mkdmnod
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure VolGroup00
echo Creating root device
mkrootdev /dev/root
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root /sysroot
echo Switching to new root
switchroot --movedev /sysroot
----------------------------------------

grub's menu.lst file
-------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=2
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.15.4)
	root (hd0,0)
	kernel /vmlinuz-2.6.15.4 ro root=/dev/VolGroup00/LogVol00
	initrd /initrd-2.6.15.4.img
title Fedora Core (2.6.15-1.1831_FC4)
	root (hd0,0)
	kernel /vmlinuz-2.6.15-1.1831_FC4 ro root=/dev/VolGroup00/LogVol00
	initrd /initrd-2.6.15-1.1831_FC4.img
title Fedora Core (2.6.15-1.1831_FC4smp)
	root (hd0,0)
	kernel /vmlinuz-2.6.15-1.1831_FC4smp ro root=/dev/VolGroup00/LogVol00
	initrd /initrd-2.6.15-1.1831_FC4smp.img



More information about the PLUG mailing list