Author: ward Date: 2007-09-25 00:12:17 +0200 (Tue, 25 Sep 2007) New Revision: 38
Modified: buildrom-devel/skeleton/bin/boot.functions Log:
This patch makes sure that specifying an initrd in the LAB config file is actually respected (that was a bug).
It also moves the LAB config file to /lab.conf on the first partition. The kexec binary is now also expected to live in /kexec on the first partition.
The reason for putting the LAB config file and kexec binary in / on partition 1 rather than /etc and /sbin respectively, is that often (at least in our setups) /boot is the first partition, and is a simple software raid-1 across however many disks there are in the system. The rest of the partitions can be software raid-5, LVM on sw raid, etc. We do things this way because GRUB does not understand software raid nor LVM.
Not needing MD or LVM drivers in the kernel that lives in rom makes it smaller, which is desirable. Putting a static kexec in / on the first partition means that it will not be managed by a package manager, which could overwrite it with a dynamic version one day, which would break the next boot...
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-09-14 16:28:23 UTC (rev 37) +++ buildrom-devel/skeleton/bin/boot.functions 2007-09-24 22:12:17 UTC (rev 38) @@ -5,8 +5,8 @@ # The best solution is to use olpc-boot.sh
CMDLINE="root=/dev/sda1 ro console=tty0 console=ttyS0,115200" -KERNEL="/boot/vmlinuz" -INITRD="/boot/initrd.img" +KERNEL="vmlinuz" +INITRD="initrd.img" VT="1"
message() { @@ -20,14 +20,19 @@ # Switch to the mounted directory to make life easier for the script cd $DIR
- # Any of the above can be over-ridden by /boot.conf + # Any of the above can be over-ridden by /lab.conf
- if [ -f $DIR/etc/boot.conf ]; then - . $DIR/etc/boot.conf + if [ -f $DIR/lab.conf ]; then + . $DIR/lab.conf fi
- $DIR/sbin/kexec -l $DIR/$KERNEL --command-line="$CMDLINE" - $DIR/sbin/kexec -e + if [ "$INITRD" = "" ]; then + $DIR/kexec -l $DIR/$KERNEL --command-line="$CMDLINE" + else + $DIR/kexec -l $DIR/$KERNEL --initrd=$DIR/$INITRD --command-line="$CMDLINE" + fi
- message "ERROR: can't run kexec $DIR$KERNEL $CMDLINE $INITRD" + $DIR/kexec -e + + message "ERROR: can't run kexec $DIR/$KERNEL $CMDLINE $INITRD" }