Build a fai-kernel

Mike Horansky moho at stanford.edu
Sun Feb 20 12:47:41 CET 2005


Pedro Ferreira <pedro.m.ferreira at gmail.com> [on 2005-02-16 11:54] wrote:


> Im using fai to install a poweredge 2850 but on the startup fai can
> not partition the hard drives.  megaraid module is not working need
> help.

I had problems installing on 1850's with and without PERC raid, using
FAI 2.5.4 (woody systems) and kernel 2.4.28. 


The problem was not with the kernel, or at least not directly kernel
related. We can now install debian on PowerEdge 1850's with and
without raid.

I found a bug report for the standard Debian installer in "netinst"
(network install) mode [1] that had symptoms matching what I
encountered with the PowerEdge 1850 w/perc raid:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279936

A coworker noticed that a workaround was in the report. 

FAI is set up to have every system use an initial ramdisk that is
generated at the time of installation. It so happens that while all
necessary modules are put into the initrd, the "loadmodules" file that
is read when the initrd is used only mentioned "megaraid" without
mentioning "megaraid2".

Adapting the bug report's workaround for FAI, I now have this 
script for the DELL1850 class:

===
#! /bin/sh
echo "megaraid2" >> $target/etc/mkinitrd/modules
KERNELVERS=`ls $target/boot/initrd.img* | sed 's/\(.*\)initrd.img-\(.*\)/\2/g' | tail -1`
chroot $target mount -tproc none /proc
chroot $target mkinitrd -o /boot/initrd.img-$KERNELVERS $KERNELVERS
chroot $target umount /proc
===

$target is /tmp/target, where the client filesystem is mounted.

The /etc/mkinitrd/modules file has up until now been empty except for
comments. Packages are normally installed before scripts are run, and
the initrd was generated when the initrd-tools was installed, so my
script had do those chroot commands to re-make the initrd. It was
either that or fashion a "hook" script that ran before package
installation, which I didn't want to bother with.


I then used the same approach for the 1850's without raid. In their
case, the "loadmodules" file mentioned the "mptscsih" module, but not
the needed "mptbase" module. The script for DELL1850NORAID has

===
#! /bin/sh
echo "mptbase" >> $target/etc/mkinitrd/modules
echo "mptscsih" >> $target/etc/mkinitrd/modules
KERNELVERS=`ls $target/boot/initrd.img* | sed 's/\(.*\)initrd.img-\(.*\)/\2/g' | tail -1`
chroot $target mount -tproc none /proc
chroot $target mkinitrd -o /boot/initrd.img-$KERNELVERS $KERNELVERS
chroot $target umount /proc
===


My .config for the current fai-kernel is at

http://www.stanford.edu/~moho/config-2.4.28fai1

and the .config for our current default installed kernel is at

http://www.stanford.edu/~moho/config-2.4.28-secfix2-686-smp



[1] http://www.debian.org/CD/netinst/


--
-Mike Horansky, ITSS/Unix Systems and Applications
 moho at stanford.EDU

OPINIONS EXPRESSED BY ME ARE NOT NECESSARILY SHARED BY MY EMPLOYERS.



More information about the linux-fai mailing list