Author: ward Date: 2007-11-09 21:46:02 +0100 (Fri, 09 Nov 2007) New Revision: 55
Modified: buildrom-devel/skeleton/bin/boot.functions Log:
Make lab.conf parsing a bit smarter so that 2 modules can be passed to kexec. This allows Xen booting, for instance with an lab.conf file like this:
CMDLINE="com1=115200,8n1 cdb=com1" INITRD="" KERNEL="/xen-3.1.0.gz" MODULE1="/vmlinuz-2.6.18-xen root=/dev/md1 ro console=tty0 console=ttyS0,115200" MODULE2="/initrd.img-2.6.18-xen" VT="1"
Of course a simple lab.conf file with kernel and initrd still works:
CMDLINE="root=/dev/md1 ro console=tty0 console=ttyS0,115200" KERNEL="/vmlinuz-2.6.22-14-generic" INITRD="/initrd.img-2.6.22-14-generic" VT="1"
Signed-off-by: Ward Vandewege ward@gnu.org Acked-by: Jordan Crouse jordan.crouse@amd.com
Modified: buildrom-devel/skeleton/bin/boot.functions =================================================================== --- buildrom-devel/skeleton/bin/boot.functions 2007-11-06 19:58:52 UTC (rev 54) +++ buildrom-devel/skeleton/bin/boot.functions 2007-11-09 20:46:02 UTC (rev 55) @@ -26,13 +26,25 @@ . $DIR/lab.conf fi
- if [ "$INITRD" = "" ]; then - $DIR/kexec -l $DIR/$KERNEL --command-line="$CMDLINE" - else - $DIR/kexec -l $DIR/$KERNEL --initrd=$DIR/$INITRD --command-line="$CMDLINE" - fi + if [ "$INITRD" = "" ] && [ "$MODULE1" = "" ]; then + $DIR/kexec -l $DIR/$KERNEL --command-line="$CMDLINE" + elif [ "$INITRD" != "" ] && [ "$MODULE1" = "" ]; then + $DIR/kexec -l $DIR/$KERNEL --initrd=$DIR/$INITRD --command-line="$CMDLINE" + elif [ "$INITRD" = "" ] && [ "$MODULE1" != "" ]; then + if [ "$MODULE2" != "" ]; then + $DIR/kexec -l $DIR/$KERNEL --module="$DIR/$MODULE1" --module="$DIR/$MODULE2" --command-line="$CMDLINE" + else + $DIR/kexec -l $DIR/$KERNEL --module="$DIR/$MODULE1" --command-line="$CMDLINE" + fi + elif [ "$INITRD" != "" ] && [ "$MODULE1" != "" ]; then + if [ "$MODULE2" != "" ]; then + $DIR/kexec -l $DIR/$KERNEL --initrd=$DIR/$INITRD --module="$DIR/$MODULE1" --module="$DIR/$MODULE2" --command-line="$CMDLINE" + else + $DIR/kexec -l $DIR/$KERNEL --initrd=$DIR/$INITRD --module="$DIR/$MODULE1" --command-line="$CMDLINE" + fi + fi
$DIR/kexec -e
- message "ERROR: can't run kexec $DIR/$KERNEL $CMDLINE $INITRD" + message "ERROR: can't run kexec $DIR/$KERNEL $CMDLINE $INITRD $MODULE1 $MODULE2" }