Hi,

I'd like to customize my own kernel for the FAI-installed nodes.
So basically I got the kernel sources, the necessary patches, and a
.config file of a previous version to get a head start.
Unfortunately I get stuck when rebooting. Here's the snippet from my
work log: (I will publish the full one as soon as I got through)

...
OK; so I now also want to use my own kernel, since i2c and lm-sensors
that come with Debian kernels are quite outdated. 
I didn't succeed to compile the 2.4.26 kernel with the patches, so I 
decided to use a pristine 2.4.27 instead and make my own kernel:
        cd /usr/src
        # get kernel
        wget -r -l1 -nd www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.27.tar.bz2
        # unpack kernel
        tar jxf linux-2.4.27.tar.bz2
        # rename to debian standard
        mv linux-2.4.27 kernel-source-2.4.27
        # get patches (for 2.4.26, doesn't matter)
        apt-get install kernel-patch-2.4-i2c kernel-patch-2.4-lm-sensors
        # unpack for patch
        gunzip kernel-patches/diffs/*/kernel-2.4.26-*.patch.gz  
        # get config file for subarchitecture (mine is k7-smp, Athlon MP)
        apt-get source kernel-image-2.4-k7-smp
        cp -p kernel-image-2.4.26-i386-*/config/k7-smp kernel-source-2.4.27
        # patch kernel
        cd kernel-source-2.4.27
        patch -p1 <../kernel-patches/diffs/i2c/kernel-2.4.26-*
        patch -p1 <../kernel-patches/diffs/lm-sensors/kernel-2.4.26-*
        # fill in new config file entries (answer "M" where possible, "Y" else)
        cp -p sm
        make oldconfig
        vi .config
                CONFIG_CRAMFS=n                 # cramfs isn't needed
                CONFIG_ROMFS_FS=y               # romfs support in kernel
                CONFIG_BLK_DEV_RAM_SIZE=10240   # 8192 is too small
        # set own identity
        vi /etc/kernel-pkg.conf
        # set different initrd fs
        vi /etc/mkinitrd/mkinitrd.conf
                MKIMAGE="genromfs -s %s -f %s"
        apt-get install genromfs        # really necessary here?
        make-kpkg \
                --revision 20040818 \
                --subarch k7-smp \
                --initrd --bzimage \
                binary modules
        cd ..
        mv kernel-*.deb $FAI_CONFIGDIR/files/packages
        cd $FAI_CONFIGDIR/files
        ./mkPkg                         # create packages/Packages.gz
        cd ../scripts/DEFAULT
        cat <<EOF >S00
                # prerequisites for S01 kernel install
                fcopy /etc/mkinitrd/mkinitrd.conf
                apt-get genromfs
                exit 0
        EOF
        chmod +x S00
        mkdir -p $FAI_CONFIGDIR/files/etc/mkinitrd/mkinitrd.conf
        cp -p /etc/mkinitrd/mkinitrd.conf \
                $FAI_CONFIGDIR/files/etc/mkinitrd/mkinitrd.conf/DEFAULT
If you now restart your installation, you might even succeed when rebooting...
For me, it does not, I get 
        VFS: Mounted root (romfs filesystem) readonly.
        ...
        .../ide-core.o: insmod ide-detect failed
        .../ide-core.o: insmod ide-disk failed
        Journalled Block Device driver loaded
        pivot_root: No such file or directory
        /sbin/init: ... cannot open dev/console: No such file
        Kernel panic: Attempted to kill init!

Note that I had to switch to romfs instead of cramfs since I could not
find the "lost Debian cramfs initrd patch".

I did some modifications in mkinitrd.conf:
        MODULES=all -> 32MB initrd, too big.
        MODULES=dep -> find out exactly what's needed :-( not FAIable
        MODULES=most.
        ROOT=probe -> fails
        ROOT=/dev/hda1 -> fails too. 



(If I use the prebuilt kernel from Debian Sarge, everything is fine.)
(I will go on and save the initrd's to compare their contents...)


Any suggestions how to get the thing working is welcome. I'd love to
have a listing of loaded modules... should I simply go and
lsmod >/etc/mkinitrd/modules (OK with minor editing) so I could use
MODULES=dep?


Steffen

-- 
Steffen Grunewald * * * Merlin cluster admin (http://pandora.aei.mpg.de)
Albert-Einstein-Institut (MPI Gravitationsphysik, http://www.aei.mpg.de)
       Science Park Golm, Am M�hlenberg 1, 14476 Potsdam, Germany
e-mail: steffen.grunewald(*)aei.mpg.de * +49-331-567-{fon:7233,fax:7298}

Reply via email to