Author: ward
Date: 2007-09-12 21:19:38 +0200 (Wed, 12 Sep 2007)
New Revision: 29
Modified:
buildrom-devel/skeleton/bin/boot.functions
buildrom-devel/skeleton/device.txt
buildrom-devel/skeleton/linuxrc
Log:
Change the skeleton files to give us a simple busybox + kexec boot (statically
built kexec on disk).
Signed-off-by: Ward Vandewege <ward(a)gnu.org>
Acked-by: Ronald G. Minnich <rminnich(a)gmail.com>
Modified: buildrom-devel/skeleton/bin/boot.functions
===================================================================
--- buildrom-devel/skeleton/bin/boot.functions 2007-09-12 19:17:14 UTC (rev 28)
+++ buildrom-devel/skeleton/bin/boot.functions 2007-09-12 19:19:38 UTC (rev 29)
@@ -4,17 +4,11 @@
# Note - these are being kept for compatablity purposes
# The best solution is to use olpc-boot.sh
-CMDLINE="root=/dev/sda1 console=ttyS0,115200 console=tty0 rootdelay=10 rw"
-KERNEL="/bzImage"
-INITRD=""
+CMDLINE="root=/dev/sda1 ro console=tty0 console=ttyS0,115200"
+KERNEL="/boot/vmlinuz"
+INITRD="/boot/initrd.img"
VT="1"
-# Any of the above can be over-ridden by /boot.conf
-
-if [ -f /boot.conf ]; then
- . /boot.conf
-fi
-
message() {
echo $1 > /dev/tty$VT
echo $1
@@ -26,25 +20,14 @@
# Switch to the mounted directory to make life easier for the script
cd $DIR
- if [ -x ./boot/olpc-boot.sh ]; then
- . ./boot/olpc-boot.sh
- message "Unable to execute the olpc-boot.sh script"
- return
- fi
+ # Any of the above can be over-ridden by /boot.conf
- if [ -x ./olpc-boot.sh ]; then
- . ./olpc-boot.sh
- message "Unable to execute the olpc-boot.sh script"
- return
+ if [ -f $DIR/etc/boot.conf ]; then
+ . $DIR/etc/boot.conf
fi
- # For backwards compatablity - try to find the kernel
+ $DIR/sbin/kexec -l $DIR/$KERNEL --command-line="$CMDLINE"
+ $DIR/sbin/kexec -e
- if [ ! -f $DIR$KERNEL ]; then
- message "ERROR: $DIR$KERNEL doesn't exist."
- return
- fi
-
- /sbin/kbl-kexec $DIR$KERNEL "$CMDLINE" $INITRD
- message "ERROR: can't run kbl-kexec $DIR$KERNEL $CMDLINE $INITRD"
+ message "ERROR: can't run kexec $DIR$KERNEL $CMDLINE $INITRD"
}
Modified: buildrom-devel/skeleton/device.txt
===================================================================
--- buildrom-devel/skeleton/device.txt 2007-09-12 19:17:14 UTC (rev 28)
+++ buildrom-devel/skeleton/device.txt 2007-09-12 19:19:38 UTC (rev 29)
@@ -6,5 +6,12 @@
console c 640 0 0 5 1
sda b 660 0 0 8 0
sda1 b 660 0 0 8 1
+sda2 b 660 0 0 8 2
+sda3 b 660 0 0 8 3
+sda4 b 660 0 0 8 4
+sda5 b 660 0 0 8 5
+sda6 b 660 0 0 8 6
+sda7 b 660 0 0 8 7
+sda8 b 660 0 0 8 8
mem c 640 0 0 1 1
fb0 c 640 0 0 29 0
Modified: buildrom-devel/skeleton/linuxrc
===================================================================
--- buildrom-devel/skeleton/linuxrc 2007-09-12 19:17:14 UTC (rev 28)
+++ buildrom-devel/skeleton/linuxrc 2007-09-12 19:19:38 UTC (rev 29)
@@ -1,62 +1,28 @@
#!/bin/sh
-# We need boot functions for message()
+/sbin/makedevs /dev < device.txt > /output.makedevs.txt 2>&1
+
. /bin/boot.functions
boot_default() {
- sh /bin/boot-nand
- sh /bin/boot-usb
+ sh /bin/boot-hdd
}
-# Make the null device by hand, since we use it in the makedevs step.
-
-mknod /dev/null c 1 3
-
mkdir /proc
mount -t proc proc /proc
# For debug purposes
mount -t usbfs usbfs /proc/bus/usb
-# Makedevs returns seemingly nasty error messages, even though the
-# files are still created (we're missing something in the minimal kernel
-# that causes chown to return ENOSYS).
-# End result - we ignore the error messages
-
-/sbin/makedevs /dev < device.txt > /dev/null 2>&1
-
# Show the version
-cat /buildrom-version
cat /buildrom-version > /dev/tty$VT
-# FIXME - bad!
-
-message "Starting bootmenu."
+message "Trying to boot from hdd."
cd /bin
-./bootmenu
+./boot-hdd
RET=$?
cd /
-# Bootmenu now returns 0 if the timeout happened (meaning,
-# we want to boot the default - which in this case is nand
-# then USB key. $RET > 0 means to select the menu item
-
-# NOTE: Should 3 be boot_default, or boot-usb only?
-
-if [ $RET -eq 0 ]; then
- message "NOTICE: Booting default"
- boot_default
-elif [ $RET -eq 1 ]; then
- message "ERROR: Wired mode isn't supported right now."
-elif [ $RET -eq 2 ]; then
- message "ERROR: Wireless mode isn't supported right now."
-elif [ $RET -eq 3 ]; then
- sh /bin/boot-usb
-elif [ $RET -eq -1 ]; then
- message "ERROR: The bootmenu was not successful."
-fi
-
message "NOTICE: Starting the shell..."
-
openvt $VT /bin/ash
exec /bin/ash