diff options
author | Matthias Hentges <oe@hentges.net> | 2006-01-23 18:21:48 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-01-23 18:21:48 +0000 |
commit | 782dc3c20561aea0fb13529d543fb814fda208f7 (patch) | |
tree | 3cd4fdb7b3cf6ec9f649c3bb8390db44b6bfe7b9 /packages/altboot | |
parent | 6b447a6a8392db239d0f57457d5b59b0ec30aec0 (diff) |
altboot:
- Fixed a bug where the /media/ROM mountpoint wasn't moved into the new rootfs
- Added support for booting off USB storage devices
Diffstat (limited to 'packages/altboot')
-rw-r--r-- | packages/altboot/altboot.bb | 2 | ||||
-rw-r--r-- | packages/altboot/files/akita/altboot.cfg | 9 | ||||
-rw-r--r-- | packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick | 53 | ||||
-rw-r--r-- | packages/altboot/files/altboot-menu/Advanced/40-bootNFS | 4 | ||||
-rw-r--r-- | packages/altboot/files/altboot.func | 7 | ||||
-rw-r--r-- | packages/altboot/files/init.altboot | 2 | ||||
-rw-r--r-- | packages/altboot/files/spitz/altboot.cfg | 8 |
7 files changed, 79 insertions, 6 deletions
diff --git a/packages/altboot/altboot.bb b/packages/altboot/altboot.bb index 529814af1d..3d1ca8216a 100644 --- a/packages/altboot/altboot.bb +++ b/packages/altboot/altboot.bb @@ -6,7 +6,7 @@ MAINTAINER = "Matthias 'CoreDump' Hentges <oe@hentges.net>" LICENSE = "GPL" -PR = "r11" +PR = "r12" SRC_URI = "file://altboot-menu \ diff --git a/packages/altboot/files/akita/altboot.cfg b/packages/altboot/files/akita/altboot.cfg index 8361b28f2a..9175cb1b06 100644 --- a/packages/altboot/files/akita/altboot.cfg +++ b/packages/altboot/files/akita/altboot.cfg @@ -2,14 +2,21 @@ # Allow booting images from SD or CF instead of booting # the ROM. ENABLE_ALTBOOT="yes" -TIMEOUT="3" +TIMEOUT="4" REAL_INIT="/sbin/init.sysvinit" SH_SHELL="/bin/sh" + IMAGE_PATH="boot-images" IMAGE_TYPE="ext2" FSCK_IMAGES="yes" + SD_DEVICE="/dev/mmcda1" SD_KERNEL_MODULE="/lib/modules/2.4.20/kernel/drivers/block/sharp_mmcsd_m.o" + +USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage" +USB_STORAGE_PARTITION="/dev/sda1" +USB_STORAGE_WAIT="4" + INIT_RUNLEVEL="5" NO_GUI_RL="2" MASTER_PASSWORD="" diff --git a/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick b/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick new file mode 100644 index 0000000000..5a1d049976 --- /dev/null +++ b/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick @@ -0,0 +1,53 @@ +# !/bin/sh +# +# Copyright Matthias Hentges (c) 2005 +# +# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL) + + +M_TITLE="Boot USB Storage" + +die() { + echo "ERROR: $1" >/dev/tty0 + exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1 +} + +# This function is activated by init.altboot by calling this script with the "run" option +run_module() { + + test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" + + echo -n "Mounting rootfs rw..." >/dev/tty0 + mount -o remount,rw / >/dev/tty0 2>&1 && echo ok >/dev/tty0|| die "mount -o remount,rw / failed" + + echo -n "Generating device files..." >/dev/tty0 + /etc/init.d/devices start && echo ok >/dev/tty0|| die "FAILED" + + echo "Starting USB..." + + for module in $USB_STORAGE_MODULES + do + echo -en "\t - $module: " + modprobe "$module" >/dev/null 2>&1 && echo ok || die "Failed to modprobe [$module]" + done + + echo -n "Mounting $USB_STORAGE_PARTITION..." >/dev/tty0 + + mkdir -p /media/usb-storage >/dev/null 2>&1 + + sleep "$USB_STORAGE_WAIT" + + /bin/mount -t auto -o defaults,noatime $USB_STORAGE_PARTITION /media/usb-storage >/dev/null 2>&1 && echo ok >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed" + + echo "" + + # Check for a real fs and loop-images. + check_target "/media/usb-storage" >/dev/tty0 +} + + +case "$1" in +title) echo "$M_TITLE";; +run) run_module "$2";; +esac + diff --git a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS index b5b93a5929..e83a2867c5 100644 --- a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS +++ b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS @@ -36,7 +36,7 @@ run_module() { # After the PCMCIA service is started, an inserted WLAN card should automatically # activate itself. - /etc/init.d/pcmcia start || die "/etc/init.d/pcmcia/start failed!" + /etc/init.d/pcmcia start >/dev/null 2>&1 || die "/etc/init.d/pcmcia/start failed!" nfs_host="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'|sed -n "s/\(.*\)\:\(.*\)/\1/p" `" nfs_mounts="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'`" @@ -67,7 +67,7 @@ run_module() { then echo "Restarting udhcpc" killall udhcpc - udhcpc -i wlan0 -H `cat /etc/hostname` + udhcpc -i wlan0 -H `cat /etc/hostname` >/dev/null 2>&1 else die "Failed to activate WLAN!" break diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func index 91984a89ee..1c21a5f2f8 100644 --- a/packages/altboot/files/altboot.func +++ b/packages/altboot/files/altboot.func @@ -162,8 +162,13 @@ pivot_image() { then echo "Success" + # This is important since we are still cd'ed into the old root cd / - + + ! test -d "$1" && mkdir -p "$1" + + # Move mountpoints from the old rootfs into the new one. + # The *real* mount is kinda touchy feely about that /bin/busybox mount -o move /media/ROM$1 $1 /bin/busybox mount -o move /media/ROM/dev /dev /bin/busybox mount -o move /media/ROM/proc /proc >/dev/null 2>&1 diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot index 81656fc9b2..5bc833d2b1 100644 --- a/packages/altboot/files/init.altboot +++ b/packages/altboot/files/init.altboot @@ -256,7 +256,7 @@ wait_for_input() { # * * * * * * This is the main function * * * * * * -if test "`runlevel`" != "unknown" +if test "`runlevel`" != "unknown" -a "$1" != "-force" then echo "altboot: Using real init [$REAL_INIT] [$*] *" >/dev/tty1 exec $REAL_INIT $* diff --git a/packages/altboot/files/spitz/altboot.cfg b/packages/altboot/files/spitz/altboot.cfg index be90c62eb4..7a161b7a9c 100644 --- a/packages/altboot/files/spitz/altboot.cfg +++ b/packages/altboot/files/spitz/altboot.cfg @@ -6,11 +6,18 @@ ENABLE_ALTBOOT="yes" TIMEOUT="3" REAL_INIT="/sbin/init.sysvinit" SH_SHELL="/bin/sh" + IMAGE_PATH="boot-images" IMAGE_TYPE="ext3" FSCK_IMAGES="yes" + SD_DEVICE="/dev/mmcda1" SD_KERNEL_MODULE="/media/hdd/lib/modules/2.4.20/kernel/drivers/block/sharp_mmcsd_m.o" + +USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage" +USB_STORAGE_PARTITION="/dev/sda1" +USB_STORAGE_WAIT="4" + INIT_RUNLEVEL="5" NO_GUI_RL="2" MASTER_PASSWORD="" @@ -18,6 +25,7 @@ ASK_PW_ON_BOOT="no" SD_MOUNTPOINT="/media/card" CF_MOUNTPOINT="/media/cf" + HDD3_DEVICE="/dev/hda3" HDD3_MOUNTPOINT="/media/hdd3" HDD3_TYPE="vfat" |