From 408879acf7c44dd1501a799116b24fe3266e3650 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Wed, 14 Mar 2007 01:40:35 +0000 Subject: altboot: Add support for fic-gta01 aka Neo1973. Booting off SD works, NFS / usbnet is untested --- packages/altboot/files/altboot.func | 64 +++++++-- packages/altboot/files/fic-gta01/.mtn2git_empty | 0 packages/altboot/files/fic-gta01/altboot-2.6.cfg | 41 ++++++ .../files/fic-gta01/altboot-menu/.mtn2git_empty | 0 .../files/fic-gta01/altboot-menu/00-Default | 14 ++ .../altboot/files/fic-gta01/altboot-menu/15-bootSD | 32 +++++ .../fic-gta01/altboot-menu/Advanced/.mtn2git_empty | 0 .../altboot-menu/Advanced/30-bootUSB-Stick | 47 ++++++ .../fic-gta01/altboot-menu/Advanced/40-bootNFS | 110 ++++++++++++++ packages/altboot/files/init.altboot | 158 +++++++++++++++------ 10 files changed, 415 insertions(+), 51 deletions(-) create mode 100644 packages/altboot/files/fic-gta01/.mtn2git_empty create mode 100644 packages/altboot/files/fic-gta01/altboot-2.6.cfg create mode 100644 packages/altboot/files/fic-gta01/altboot-menu/.mtn2git_empty create mode 100644 packages/altboot/files/fic-gta01/altboot-menu/00-Default create mode 100644 packages/altboot/files/fic-gta01/altboot-menu/15-bootSD create mode 100644 packages/altboot/files/fic-gta01/altboot-menu/Advanced/.mtn2git_empty create mode 100644 packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick create mode 100644 packages/altboot/files/fic-gta01/altboot-menu/Advanced/40-bootNFS (limited to 'packages/altboot/files') diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func index 75808090ba..e990a06862 100644 --- a/packages/altboot/files/altboot.func +++ b/packages/altboot/files/altboot.func @@ -165,6 +165,11 @@ pivot_image() { mkdir -p /media/image || die "mkdir -p /media/image failed" + LOOP_MODULE="$(find /lib/modules/`uname -r`/ -name "loop.ko")" + test -n "$LOOP_MODULE" && ( insmod "$LOOP_MODULE" ; sleep 3 ) + + ! test -e /dev/loop0 && mknod /dev/loop0 b 7 0 + losetup /dev/loop0 $1/$IMAGE_PATH/$IMAGE_NAME || die "losetup /dev/loop0 $1/$IMAGE_PATH/$IMAGE_NAME failed!" check_fs /dev/loop0 $IMAGE_TYPE @@ -451,6 +456,9 @@ check_fs() { fi ;; esac + +# debug_echo "check_fs() FSCK / FSTYPE: [$FSCK] / [$FSTYPE]" + if [ "$FSCK" = "" ]; then echo "Could not find fsck for $FSTYPE!" else @@ -476,9 +484,9 @@ init_rootfs(){ } mount_sd(){ - if mount | grep -q "/media/card" + if mount | grep -q "$SD_MOUNTPOINT" then - echo "Note: /media/card is already mounted" + echo "Note: $SD_MOUNTPOINT is already mounted" else # We can't trust that the SD device file is there when running kernel 2.6 w/ udev # and starting udev at this point may not be the best idea... @@ -494,20 +502,54 @@ mount_sd(){ # Kernel 2.6 has the SD driver compiled into the kernel if test -n "$SD_KERNEL_MODULE" then - echo -n "Loading SD kernel module..." - /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed" + echo "Loading SD kernel module..." + if ( echo "$SD_KERNEL_MODULE" | grep -q "^/" ) + then + echo -e "\t- Using full path for SD module" + SD_PATTERN="`basename "$SD_KERNEL_MODULE" | sed "s/\.ko//;s/\.o//"`" + + if ( lsmod | grep -q "^$SD_PATTERN" ) + then + echo -e "\t- Already loaded..." + else + echo -e "\t- Loading..." + /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed" + fi + + else + echo -e "\t- Searching [$SD_KERNEL_MODULE]" + SD_KERNEL_MODULE="$(find /lib/modules/`uname -r`/ -name "$SD_KERNEL_MODULE")" + echo -e "\t- Assuming module is [$SD_KERNEL_MODULE]" + + SD_PATTERN="`basename "$SD_KERNEL_MODULE" | sed "s/\.ko//;s/\.o//"`" + + if ( lsmod | grep -q "^$SD_PATTERN" ) + then + echo -e "\t- Already loaded..." + else + echo -e "\t- Loading..." + /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed" + fi + fi fi - check_fs "$SD_DEVICE" - - echo -n "Mounting $SD_MOUNTPOINT..." >"$OUT_TTY" + sleep 3 - if test "$1" = ingore_errors + check_fs "$SD_DEVICE" + + if ! mount | grep -q "$SD_MOUNTPOINT" then - /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok >"$OUT_TTY" || echo "Could not mount SD card" + echo -n "Mounting $SD_MOUNTPOINT..." >"$OUT_TTY" + + if test "$1" = ingore_errors + then + /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 || echo "Could not mount SD card" + else + /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 || die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed" + fi else - /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok >"$OUT_TTY"|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed" - fi + echo "NOTE: Some sort of auto-mounting is going on..." + fi fi echo "" diff --git a/packages/altboot/files/fic-gta01/.mtn2git_empty b/packages/altboot/files/fic-gta01/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/altboot/files/fic-gta01/altboot-2.6.cfg b/packages/altboot/files/fic-gta01/altboot-2.6.cfg new file mode 100644 index 0000000000..2ad9406083 --- /dev/null +++ b/packages/altboot/files/fic-gta01/altboot-2.6.cfg @@ -0,0 +1,41 @@ +# +# Altboot machine configuration for: Akita / Kernel 2.6 +# + +# Handled by /sbin/init.altboot +# Allow booting images from SD or CF instead of booting +# the ROM. +ENABLE_ALTBOOT="yes" +TIMEOUT="4" +REAL_INIT="/sbin/init.sysvinit" +SH_SHELL="/bin/sh" + +ENABLE_SOUND="yes" + +IMAGE_PATH="boot-images" +IMAGE_TYPE="ext2" +FSCK_IMAGES="yes" +ENABLE_IMAGECONF="no" + +SD_DEVICE="/dev/mmcblk0p1" +SD_KERNEL_MODULE="s3cmci.ko" + +USB_HOST_AVAILABLE="yes" +USB_STORAGE_MODULES="ohci_hcd usb_storage sd_mod" +USB_STORAGE_PARTITION="/dev/sda1" +USB_STORAGE_WAIT="4" + +USB_NETWORKING_AVAILABLE="yes" +USB_NW_MODULES="usbcore pxa27x_udc ohci-hcd g_ether" +USB_NW_DEVICE="usb0" + +KEXEC_KERNEL_DIR="/boot" +KEXEC_BIN="/usr/sbin/kexec" + +INIT_RUNLEVEL="5" +NO_GUI_RL="2" +MASTER_PASSWORD="" +ASK_PW_ON_BOOT="no" + +SD_MOUNTPOINT="/media/card" +CF_MOUNTPOINT="/media/cf" diff --git a/packages/altboot/files/fic-gta01/altboot-menu/.mtn2git_empty b/packages/altboot/files/fic-gta01/altboot-menu/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/altboot/files/fic-gta01/altboot-menu/00-Default b/packages/altboot/files/fic-gta01/altboot-menu/00-Default new file mode 100644 index 0000000000..9d29fdae2a --- /dev/null +++ b/packages/altboot/files/fic-gta01/altboot-menu/00-Default @@ -0,0 +1,14 @@ +# !/bin/sh +M_TITLE="Normal Boot" + + +run_module() { + exec $REAL_INIT "$INIT_RUNLEVEL" + exit 0 +} + +case "$1" in +title) echo "$M_TITLE";; +run) run_module;; +esac + diff --git a/packages/altboot/files/fic-gta01/altboot-menu/15-bootSD b/packages/altboot/files/fic-gta01/altboot-menu/15-bootSD new file mode 100644 index 0000000000..3cf49deea5 --- /dev/null +++ b/packages/altboot/files/fic-gta01/altboot-menu/15-bootSD @@ -0,0 +1,32 @@ +# !/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 SD card" + +test "$DISABLE_SD_BOOT" = yes && exit 0 + +# 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!" + + # Mount /proc, etc + init_rootfs + + mount_sd + + # Check for a real fs and loop-images. + check_target "$SD_MOUNTPOINT" >/dev/tty0 + +} + + +case "$1" in +title) echo "$M_TITLE";; +run) run_module "$2";; +esac + diff --git a/packages/altboot/files/fic-gta01/altboot-menu/Advanced/.mtn2git_empty b/packages/altboot/files/fic-gta01/altboot-menu/Advanced/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick b/packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick new file mode 100644 index 0000000000..b573e7a10c --- /dev/null +++ b/packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick @@ -0,0 +1,47 @@ +# !/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" + +test "$USB_HOST_AVAILABLE" = "yes" || exit 0 + +# 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!" + + # Mount /proc, etc + init_rootfs + + 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/fic-gta01/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/fic-gta01/altboot-menu/Advanced/40-bootNFS new file mode 100644 index 0000000000..4f5c195be2 --- /dev/null +++ b/packages/altboot/files/fic-gta01/altboot-menu/Advanced/40-bootNFS @@ -0,0 +1,110 @@ +#! /bin/sh +# +# Copyright Matthias Hentges (c) 2006 +# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) +# +# Filename: 40-bootNFS +# Date: 14-Apr-06 + + +M_TITLE="Boot from NFS" + +test "$DISABLE_NFS_BOOT" = yes && exit 0 + +# 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!" + + # Mount /proc, etc + init_rootfs + + 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}'`" + nfs_mountpoints="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $2}'`" + + start_networking "$nfs_host" + + if test -z "$nfs_host" + then + mdie "${C_RED}No configured NFS drives found in /etc/fstab$C_RESET" + + fi + + + if test "` echo "$nfs_mountpoints" |wc -l | tr -d " "`" -gt 1 + then + echo -e "Please select your NFS root:\n" + + cnt=1 + for nfs_mount in $nfs_mountpoints + do + echo -e "\t[$cnt] $nfs_mount" + let cnt=$cnt+1 + done + + echo "" + + while test -z "$selection" + do + stty echo + echo -n "Boot NFS root: " + + if test "$AUTOBOOT" != "yes" + then + read junk < /dev/tty1 + else + if test -e /etc/.altboot-bootNFS-source.last + then + junk="`cat /etc/.altboot-bootNFS-source.last`" + test -z "$junk" && read junk < /dev/tty1 || echo "$junk (autoboot)" + else + read junk < /dev/tty1 + fi + fi + + + cnt=1 + for nfs_mount in $nfs_mounts + do + if test "$junk" = "$cnt" + then + selection="$nfs_mount" + echo "$junk" > /etc/.altboot-bootNFS-source.last + fi + let cnt=$cnt+1 + done + + done + else + test -z "$nfs_mounts" && die "No NFS mounts configured in /etc/fstab!" + selection="$nfs_mounts" + fi + + mkdir -p /media/nfsroot || mdie "mkdir -p /media/nfsroot failed!" + + echo -n "Mounting NFS root..." + + if ( mount | grep -q "/media/nfsroot" ) + then + echo "/media/nfsroot already used, tying to umount..." + umount /media/image + losetup -d /dev/loop0 + umount /media/nfsroot || die "umount failed!" + fi + + mount -t nfs "$selection" /media/nfsroot && echo ok || mdie "mount -t nfs "$selection" /media/nfsroot failed!" + + # Use configured resolv.conf in the pivoted rootfs + #echo -n "Copying resolv.conf..." + #cp /etc/resolv.conf /media/nfsroot/etc && echo ok || echo "FAILED" + + check_target "/media/nfsroot" bootNFS + +} + +case "$1" in +title) echo "$M_TITLE";; +run) run_module "$2";; +esac + diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot index 033fb2124f..5eb6122a2a 100644 --- a/packages/altboot/files/init.altboot +++ b/packages/altboot/files/init.altboot @@ -208,7 +208,7 @@ get_kbd_ints(){ if test -z "$KBD_INT" then # find out how the keyboard is called - for kbd in Spitzkbd corgikbd locomokbd tosakbd + for kbd in Spitzkbd corgikbd locomokbd tosakbd "Neo1973 AUX button" do if ( cat /proc/interrupts | grep -q "$kbd" ) then @@ -242,7 +242,11 @@ run_timer() { #debug_echo "run_timer() old:`echo $key_ints | md5sum`" stty -echo <"$OUT_TTY" >"$OUT_TTY" 2>&1 - echo -en "\n\nPlease press any key to launch altboot." > "$OUT_TTY" + + case "$KBD_INT" in + Neo1973*) echo -en "\n\nPlease press [AUX] to launch altboot." > "$OUT_TTY" ;; + *) echo -en "\n\nPlease press any key to launch altboot." > "$OUT_TTY" ;; + esac test -z "$TIMEOUT" && TIMEOUT="3" @@ -337,41 +341,60 @@ launch_selection() { wait_for_input() { - while true - do + + # Neo has only two buttons: AUX and PWR. + # Only AUX is easily readable from userspace, so are touchscreen taps + if test "$KBD_INT" = "Neo1973 AUX button" + then + ints_old="`cat /proc/interrupts | grep "$KBD_INT" | awk '{print $2}'`" + ts_ints_old="`cat /proc/interrupts |grep action| tail -1 | awk '{print $2}'`" + echo "Please press [AUX] to set a menu number" <"$OUT_TTY" > "$OUT_TTY" 2>&1 + echo -e "Press the touchscreen to start\n" - # Do _not_ change the next few lines! - # - # This is required to work around an annoying busybox bug. - # Every key you press while this script runs will be - # picked up by the next "read $junk". - # So the next read would pick up the "any" key the user pressed - # above to launch the altboot menu. - - - # Bash throws an ugly error on kill - if ! (readlink /bin/sh | grep -q bash) - then - # This filters an "" from the user as "any key" - ( while :; do read x< "$OUT_TTY" 2>&1; done; ) > /dev/null 2>&1 & - sleep 1; kill $! >/dev/null 2>&1 - fi - - echo -n "Please choose one of the above [$last_selection]: " <"$OUT_TTY" > "$OUT_TTY" 2>&1 - stty echo <"$OUT_TTY" >"$OUT_TTY" 2>&1 - read junk< "$OUT_TTY" 2>&1 + x="$last_selection" ; hold_events=0 - # This filters other chars the user may have used + echo -n "Your Choice: [$x / $cnt]" - junk="`echo "$junk" | sed "s/[a-zA-Z]//g"`" - - if test "$junk" -lt "$cnt" -o "$junk" -eq "$cnt" - then - if test ! -z "$junk" + while true + do + + ts_ints_now="`cat /proc/interrupts |grep action| tail -1 | awk '{print $2}'`" + + if test "$ts_ints_now" = "$ts_ints_old" then - parse_module_flags "$junk" - + ints_now="`cat /proc/interrupts | grep "$KBD_INT" | awk '{print $2}'`" + + if test "$ints_now" -gt "$ints_old" + then + # Only react on every second interupt as both PRESS and RELEASE generate + # one. + if test -n "$tmp" + then + #debug_echo "wait_for_input(): PRESS/RELEASE EVENT [$ints_now <-> $ints_old]" + + MAX_ENTRIES="$cnt" + + test "$x" = "$cnt" && x=1 || let x=$x+1 + + #\r : go to beginning of the current line + #\033[K : completely clear the current line + echo -en "\r\033[KYour Choice: [$x / $cnt]" + + + tmp="" + else + tmp=blahh + fi + fi + + ints_old="$ints_now" + else +# debug_echo "wait_for_input(): TOUCHSCREEN EVENT [$ts_ints_now <-> $ts_ints_old]" + ts_ints_old="$ts_ints_now" + + parse_module_flags "$x" + if test "$REMEMBER_LAST_SELECTION" != no then # Don't remount rw if the drive is already mounted rw @@ -379,20 +402,75 @@ wait_for_input() { if test "`mount|sed -n "/\/dev\/root/s/.*(\(.*\))/\1/p"`" != "rw" then mount -o remount,rw / >/dev/null 2>&1 - echo "$junk" > /etc/altboot.conf + echo "$x" > /etc/altboot.conf mount -o remount,ro / >/dev/null 2>&1 else - echo "$junk" > /etc/altboot.conf + echo "$x" > /etc/altboot.conf fi fi - else - junk="$last_selection" - parse_module_flags "$junk" + + junk="$x" break + + fi + done + else + while true + do + + # Do _not_ change the next few lines! + # + # This is required to work around an annoying busybox bug. + # Every key you press while this script runs will be + # picked up by the next "read $junk". + # So the next read would pick up the "any" key the user pressed + # above to launch the altboot menu. + + + # Bash throws an ugly error on kill + if ! (readlink /bin/sh | grep -q bash) + then + # This filters an "" from the user as "any key" + ( while :; do read x< "$OUT_TTY" 2>&1; done; ) > /dev/null 2>&1 & + sleep 1; kill $! >/dev/null 2>&1 fi - break - fi - done + + echo -n "Please choose one of the above [$last_selection]: " <"$OUT_TTY" > "$OUT_TTY" 2>&1 + stty echo <"$OUT_TTY" >"$OUT_TTY" 2>&1 + read junk< "$OUT_TTY" 2>&1 + + # This filters other chars the user may have used + + junk="`echo "$junk" | sed "s/[a-zA-Z]//g"`" + + if test "$junk" -lt "$cnt" -o "$junk" -eq "$cnt" + then + if test ! -z "$junk" + then + parse_module_flags "$junk" + + if test "$REMEMBER_LAST_SELECTION" != no + then + # Don't remount rw if the drive is already mounted rw + # Only helpful for testing / debugging + if test "`mount|sed -n "/\/dev\/root/s/.*(\(.*\))/\1/p"`" != "rw" + then + mount -o remount,rw / >/dev/null 2>&1 + echo "$junk" > /etc/altboot.conf + mount -o remount,ro / >/dev/null 2>&1 + else + echo "$junk" > /etc/altboot.conf + fi + fi + else + junk="$last_selection" + parse_module_flags "$junk" + break + fi + break + fi + done + fi } # * * * * * * This is the main function * * * * * * -- cgit v1.2.3 From 4d8969947f20857631fb65fd8d739d2d92efac75 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Fri, 23 Mar 2007 18:23:55 +0000 Subject: altboot: - CVS -> SVN - Fix do_install() and do_configure to use instead of fixed path --- .../altboot-menu/Advanced/30-bootUSB-Stick | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick (limited to 'packages/altboot/files') diff --git a/packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick b/packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick deleted file mode 100644 index b573e7a10c..0000000000 --- a/packages/altboot/files/fic-gta01/altboot-menu/Advanced/30-bootUSB-Stick +++ /dev/null @@ -1,47 +0,0 @@ -# !/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" - -test "$USB_HOST_AVAILABLE" = "yes" || exit 0 - -# 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!" - - # Mount /proc, etc - init_rootfs - - 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 - -- cgit v1.2.3 From 4c83c9f064e16f78e6ab01e874a0dcea541856a1 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Sat, 24 Mar 2007 17:34:42 +0000 Subject: altboot: Replace rev= with proto=svn.... and update altboot_0.0.0.bb to latest svn --- packages/altboot/files/altboot-menu/10-noGui | 2 + .../files/altboot-menu/Advanced/70-install-tgz | 2 + packages/altboot/files/init.altboot | 73 +++++++++++++--------- 3 files changed, 47 insertions(+), 30 deletions(-) (limited to 'packages/altboot/files') diff --git a/packages/altboot/files/altboot-menu/10-noGui b/packages/altboot/files/altboot-menu/10-noGui index 57141d498d..cf3c10c381 100644 --- a/packages/altboot/files/altboot-menu/10-noGui +++ b/packages/altboot/files/altboot-menu/10-noGui @@ -1,6 +1,8 @@ # !/bin/sh M_TITLE="Don't launch GUI" +test "$DISABLE_NOGUI_BOOT" = yes && exit 0 + run_module() { clear ; exec $REAL_INIT "$NO_GUI_RL" diff --git a/packages/altboot/files/altboot-menu/Advanced/70-install-tgz b/packages/altboot/files/altboot-menu/Advanced/70-install-tgz index aca0d047c6..b6e5d94d5d 100644 --- a/packages/altboot/files/altboot-menu/Advanced/70-install-tgz +++ b/packages/altboot/files/altboot-menu/Advanced/70-install-tgz @@ -2,6 +2,8 @@ M_TITLE="Install RootFS from tar.gz" M_FLAGS="noRemember" +test "$DISABLE_INSTTGZ_BOOT" = yes && exit 0 + run_module(){ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot index 5eb6122a2a..30868024b8 100644 --- a/packages/altboot/files/init.altboot +++ b/packages/altboot/files/init.altboot @@ -20,12 +20,6 @@ test -z "$INIT_RUNLEVEL" && INIT_RUNLEVEL=5 # If this step fails the results are fatal. Seen on Collie / kernel 2.4 (where else...) OUT_TTY="`tty`" ; test -z "$OUT_TTY" && OUT_TTY="/dev/tty1" -if test -z "$OUT_TTY" -then - OUT_TTY="/dev/tty1" - echo "WARNING: Assgnment of OUT_TTY failed!" > "$OUT_TTY" -fi - if ( echo "$OUT_TTY" | grep -q "not" ) then OUT_TTY="/dev/tty1" @@ -47,7 +41,7 @@ then rm "${ALTBOOT_CFG_FILE}.next-reboot" fi -test "$ENABLE_DEBUGGING" = "yes" && ENABLE_DEBUG="yes" +ENABLE_DEBUG="$ENABLE_DEBUGGING" C_RED="\033[31m" C_YELLOW="\033[33m" @@ -81,10 +75,9 @@ debug_shell() { show_menu() { test -z "$1" && die "DEBUG: Parameter 1 is empty in show_menu" ! test -d "$1" && die "show_menu: [$1] not found or no directory." - + echo "" - echo -e "altboot v$VERSION\n" - + echo -e "altboot v$VERSION\n" m_entry="" @@ -93,6 +86,7 @@ show_menu() { cnt=0 ; reset_pref "menu_filelist" for file in `ls -1` do +# debug_echo "show_menu(): file = [$file]" if ! test -d "$1/$file" then # NOTE: It is important to use "." here so that the script inherits @@ -165,11 +159,7 @@ show_menu() { fi done - echo "" - -# export_pref "$menu_filelist" /tmp/menu_filelist.cache -# export_pref "$menu_fileflags" /tmp/menu_fileflags.cache - + echo "" } # This function is used to display the content of directories below @@ -178,11 +168,7 @@ show_sub_menu() { dirname="`basename "$1"`" d_entries="`dump_pref "menu_filelist" | grep "$dirname/"`" - - #dump_pref "menu_filelist" - #dump_pref "menu_fileflags" - #echo "[$d_entries]" - + echo -e "\naltboot v$VERSION: $dirname menu\n" for d_entry in $d_entries @@ -190,11 +176,7 @@ show_sub_menu() { d_entry_number="`echo "$d_entry"| sed -n "s/\(.*\)\#\#\(.*\)\#\#\#/\1/p"`" d_entry_file="`echo "$d_entry"| sed -n "s/\(.*\)\#\#\(.*\)\#\#\#/\2/p"`" d_entry_title="`$d_entry_file title`" - -# echo "number: [$d_entry_number]" -# echo "file: [$d_entry_file]" -# echo "title: [$d_entry_title]" - + echo -e "\t\t[$d_entry_number] $d_entry_title" done @@ -231,7 +213,7 @@ get_kbd_ints(){ # Shows the timer and sets $launch_altboot to yes if a keypress was detected run_timer() { - if test "$TIMEOUT" != 0 + if test "$TIMEOUT" != 0 -a "$TIMEOUT" != "[none]" then mount -t proc proc /proc >/dev/null 2>&1 @@ -278,6 +260,17 @@ run_timer() { else launch_altboot=yes fi + + if test "$TIMEOUT" = "[none]" + then + echo "" + echo -e "altboot v$VERSION ($MACHINE)\n" + + echo "NOTE: The menu is not available on this device" + echo "Use \"set-bootdev\" to change the boot device" + + launch_altboot=no + fi } # $1 = ID @@ -313,7 +306,7 @@ launch_selection() { file="`echo "$file_" | sed -n "s/\(.*\)\:\(.*\)/\1/p"`" test -z "$file" && file="$file_" - #echo "[$file_]: [$type] : [$flags] / [$file] ($junk)" +# debug_echo "[$file_]: [$type] : [$flags] / [$file] ($junk)" # The selected menu-item points to a directory if test "$type" = DIR @@ -494,10 +487,29 @@ fi # Note: this is positively ugly. If someone knows a better way to detect whether # we are already booted into a runlevel _without_ reading /var and / or using `runlevel` # PLEASE let me know. +# +# The NSLU2 is an exception as it uses the way-ugly busybox "ps" +# + +MACHINE="`cat /proc/cpuinfo | sed -n "/^Hardware/s/.*\:\ \(.*\)/\1/p"`" -if test -f /proc/cmdline -a "`ps ax|wc -l|tr -d " "`" -gt 30 -a "$1" != "-force" -a "$1" != "+force" +case "$MACHINE" in + *NSLU2) if test -f /proc/cmdline -a "`ps |wc -l|tr -d " "`" -gt 25 -a "$1" != "-force" -a "$1" != "+force" + then + user_called=1 + fi + ;; + + *) if test -f /proc/cmdline -a "`ps ax|wc -l|tr -d " "`" -gt 30 -a "$1" != "-force" -a "$1"!= "+force" >/dev/null 2>&1 + then + user_called=1 + fi + ;; +esac + +if test "$user_called" = "1" then - echo "altboot: Using real init [$REAL_INIT] [$*] [`ps ax|wc -l|tr -d " "`] *" >"$OUT_TTY" + echo "altboot: Using real init [$REAL_INIT] [$*] [`ps |wc -l|tr -d " "`] *" >"$OUT_TTY" exec $REAL_INIT $* # exec $SH_SHELL /dev/tty0 2>&1 exit 0 @@ -543,7 +555,8 @@ else echo "Booting last selection: [$last_selection]" >"$OUT_TTY" # Set up the wanna-be array of available menu entries and their numbers - show_menu /etc/altboot-menu >/dev/null + show_menu /etc/altboot-menu >/dev/null 2>&1 + junk="$last_selection" launch_selection /etc/altboot-menu >"$OUT_TTY" fi -- cgit v1.2.3 From e55d052b8fe7279f2fc23944fd5dd75e743d1a4b Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Tue, 27 Mar 2007 22:22:45 +0000 Subject: altboot: Update to latest version --- .../altboot/files/altboot-menu/Advanced/55-bin-sh | 4 +- packages/altboot/files/altboot.func | 2 +- packages/altboot/files/init.altboot | 13 +- packages/altboot/files/nslu2le/.mtn2git_empty | 0 packages/altboot/files/nslu2le/altboot-2.6.cfg | 55 +++++++ .../files/nslu2le/altboot-handlers/.mtn2git_empty | 0 .../files/nslu2le/altboot-handlers/05-USB-Storage | 90 +++++++++++ .../nslu2le/altboot-handlers/10-Onboard-Flash | 18 +++ .../files/nslu2le/altboot-menu/.mtn2git_empty | 0 .../altboot/files/nslu2le/altboot-menu/00-Default | 17 ++ .../files/nslu2le/altboot-menu/30-bootUSB-Stick | 174 +++++++++++++++++++++ .../altboot/files/nslu2le/altboot-menu/55-bin-sh | 27 ++++ .../files/nslu2le/altboot.rc/.mtn2git_empty | 0 packages/altboot/files/set-bootdev | 150 ++++++++++++++++++ 14 files changed, 546 insertions(+), 4 deletions(-) create mode 100644 packages/altboot/files/nslu2le/.mtn2git_empty create mode 100644 packages/altboot/files/nslu2le/altboot-2.6.cfg create mode 100644 packages/altboot/files/nslu2le/altboot-handlers/.mtn2git_empty create mode 100644 packages/altboot/files/nslu2le/altboot-handlers/05-USB-Storage create mode 100644 packages/altboot/files/nslu2le/altboot-handlers/10-Onboard-Flash create mode 100644 packages/altboot/files/nslu2le/altboot-menu/.mtn2git_empty create mode 100644 packages/altboot/files/nslu2le/altboot-menu/00-Default create mode 100644 packages/altboot/files/nslu2le/altboot-menu/30-bootUSB-Stick create mode 100644 packages/altboot/files/nslu2le/altboot-menu/55-bin-sh create mode 100644 packages/altboot/files/nslu2le/altboot.rc/.mtn2git_empty create mode 100755 packages/altboot/files/set-bootdev (limited to 'packages/altboot/files') diff --git a/packages/altboot/files/altboot-menu/Advanced/55-bin-sh b/packages/altboot/files/altboot-menu/Advanced/55-bin-sh index 6c9aef3f3e..e4fe99ebae 100644 --- a/packages/altboot/files/altboot-menu/Advanced/55-bin-sh +++ b/packages/altboot/files/altboot-menu/Advanced/55-bin-sh @@ -7,7 +7,7 @@ run_module() { test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" - test "$ASK_PW_ON_BOOT" != "yes" && verify_master_pw >/dev/tty0 + test "$ASK_PW_ON_BOOT" != "yes" && verify_master_pw >/dev/$OUT_TTY # Mount /proc, etc init_rootfs @@ -15,7 +15,7 @@ run_module() { echo -e "\nBoot system with 'exec /sbin/init 5'\n" while true do - exec $SH_SHELL /dev/tty0 2>&1 + exec $SH_SHELL /dev/$OUT_TTY 2>&1 echo "WARNING: Shell was killed!" done } diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func index e990a06862..ae38c5b437 100644 --- a/packages/altboot/files/altboot.func +++ b/packages/altboot/files/altboot.func @@ -392,7 +392,7 @@ verify_master_pw() { test -e /etc/altboot.pwd && . /etc/altboot.pwd - if ! test -z "$MASTER_PASSWORD" + if test -n "$MASTER_PASSWORD" -a "$MASTER_PASSWORD" != "[none]" then auth_timeout="3" diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot index 30868024b8..74200d1ec9 100644 --- a/packages/altboot/files/init.altboot +++ b/packages/altboot/files/init.altboot @@ -90,7 +90,7 @@ show_menu() { if ! test -d "$1/$file" then # NOTE: It is important to use "." here so that the script inherits - # the shell environment / all set variables! + # the shell environment / all set variables! M_TITLE="`. $1/$file title`" FLAGS="`$1/$file flags`" @@ -109,6 +109,8 @@ show_menu() { fi done +# debug_echo "FILES READ" + # Display directories below /etc/altboot-menu as menu-item # and add all scripts inside the directory to m_entry for dir in `ls -1` @@ -159,6 +161,8 @@ show_menu() { fi done +# debug_echo "DIRS READ" + echo "" } @@ -491,6 +495,7 @@ fi # The NSLU2 is an exception as it uses the way-ugly busybox "ps" # +mount | grep -q "^/proc" || mount -t proc proc /proc MACHINE="`cat /proc/cpuinfo | sed -n "/^Hardware/s/.*\:\ \(.*\)/\1/p"`" case "$MACHINE" in @@ -507,6 +512,12 @@ case "$MACHINE" in ;; esac +if test "`basename "$0"`" = "altboot" +then + show_menu /etc/altboot-menu + exit 0 +fi + if test "$user_called" = "1" then echo "altboot: Using real init [$REAL_INIT] [$*] [`ps |wc -l|tr -d " "`] *" >"$OUT_TTY" diff --git a/packages/altboot/files/nslu2le/.mtn2git_empty b/packages/altboot/files/nslu2le/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/altboot/files/nslu2le/altboot-2.6.cfg b/packages/altboot/files/nslu2le/altboot-2.6.cfg new file mode 100644 index 0000000000..626c543085 --- /dev/null +++ b/packages/altboot/files/nslu2le/altboot-2.6.cfg @@ -0,0 +1,55 @@ +# +# Altboot machine configuration for: NSLU2 / Kernel 2.6 +# + +# Handled by /sbin/init.altboot +# Allow booting images from SD or CF instead of booting +# the ROM. +ENABLE_ALTBOOT="yes" + +# If set to "0" the menu will always be shown, if set to +# "[none]" there will be no menu and no delay +TIMEOUT="[none]" + +REAL_INIT="/sbin/init.sysvinit" +SH_SHELL="/bin/sh" + +ENABLE_SOUND="no" + +IMAGE_PATH="boot-images" +IMAGE_TYPE="ext2" +FSCK_IMAGES="yes" + + +# Can't do that due to missing console +ENABLE_IMAGECONF="no" + +SD_DEVICE="" +SD_KERNEL_MODULE="" + + +USB_HOST_AVAILABLE="yes" +USB_STORAGE_MODULES="ohci_hcd usb_storage sd_mod" +USB_STORAGE_PARTITION="/dev/sda1" +USB_STORAGE_WAIT="4" + +USB_NETWORKING_AVAILABLE="no" +USB_NW_MODULES="usbcore pxa27x_udc ohci-hcd g_ether" +USB_NW_DEVICE="usb0" + +INIT_RUNLEVEL="3" +NO_GUI_RL="" + +# The if set to "", altboot will force you to set a master password on +# first-boot +MASTER_PASSWORD="[none]" +ASK_PW_ON_BOOT="no" + +SD_MOUNTPOINT="/media/card" +CF_MOUNTPOINT="/media/cf" + +DISABLE_SD_BOOT="yes" +DISABLE_CF_BOOT="yes" +DISABLE_NOGUI_BOOT="yes" +DISABLE_BINSH_BOOT="yes" +DISABLE_INSTTGZ_BOOT="yes" diff --git a/packages/altboot/files/nslu2le/altboot-handlers/.mtn2git_empty b/packages/altboot/files/nslu2le/altboot-handlers/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/altboot/files/nslu2le/altboot-handlers/05-USB-Storage b/packages/altboot/files/nslu2le/altboot-handlers/05-USB-Storage new file mode 100644 index 0000000000..50d35ed542 --- /dev/null +++ b/packages/altboot/files/nslu2le/altboot-handlers/05-USB-Storage @@ -0,0 +1,90 @@ +#!/bin/sh +# NOTE: Ported to altboot by CoreDump +# Based on the original turnup helper script. +# +# All parts by Matthias 'CoreDump' Hentges are hereby placed +# under the terms of the GPL +# +# boot from the hard disk partition "$1" (which +# must be given) using options from the rest of +# the command line. +# + +M_TITLE="Boot USB Storage" +test "$USB_HOST_AVAILABLE" = "yes" || exit 0 + +run_module() { + x=x +} + +case "$1" in +title) echo "$M_TITLE" ; exit 0 ;; +run) run_module "$2";; +esac + +nslu2_feeback heartbeat + +bootdev_data="$*" +bootdev_mode="`echo "$bootdev_data" | awk '{print $1}'`" +bootdev_name="`echo "$bootdev_data" | awk '{print $2}'`" +bootdev_uuid="`echo "$bootdev_data" | awk '{print $3}'`" + + +# Use the standard init path (see /etc/init.d/rcS) +export PATH=/sbin:/bin:/usr/sbin:/usr/bin +# +# Load the helper functions +. /etc/default/functions +. /etc/default/modulefunctions +# +leds boot system +# +if test -n "$1" +then + device="$bootdev_name" + UUID="$bootdev_uuid" + + shift + # proc is needed for UUID mount and module load + mount -t proc proc /proc + # load USB & SCSI storage modules (/proc required!) + echo "boot: loading modules required for disk boot" + loaddiskmods + # waiting for disk (FIXME) + sleep=6 + test "$sleep" -gt 0 && sleep "$sleep" + # + # fire the boot + echo "boot: rootfs: mount $* $device [$UUID]" + # + # Mount read-write because before exec'ing init + # If a UUID is given (in the environment) this + # is used in preference to the device, but if + # the UUID mount fails a standard device mount + # is attempted. + if test -n "$UUID" && + mount "$@" -U "$UUID" /mnt || + mount "$@" "$device" /mnt + then + # checkmount checks for sh, chroot, init + # and /mnt (i.e. /mnt/mnt in this case) + if checkmount /mnt + then + # pivot to /initrd if available, else /mnt + cd / + if test -d /mnt/initrd + then + swivel mnt initrd + else + swivel mnt mnt + fi + # swivel failed + fi + # Failure: unmount the partition + umount /mnt + fi +fi + +# fallback - use the flash boot +nslu2_feeback failure +exec /boot/flash diff --git a/packages/altboot/files/nslu2le/altboot-handlers/10-Onboard-Flash b/packages/altboot/files/nslu2le/altboot-handlers/10-Onboard-Flash new file mode 100644 index 0000000000..394279c2af --- /dev/null +++ b/packages/altboot/files/nslu2le/altboot-handlers/10-Onboard-Flash @@ -0,0 +1,18 @@ +#! /bin/sh +# +# Copyright Matthias Hentges (c) 2007 +# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) +# +# Filename: 10-Onboard-Flash +# Date: 20070218 (YMD) + +leds beep +. /etc/default/functions +leds boot system +test -x /sbin/init && exec /sbin/init +# fallback if /sbin/init has been deleted (bad!) +leds boot system panic +exec <>/dev/console >&0 2>&0 +test -x /sbin/sulogin && exec /sbin/sulogin +test -x /bin/sh && exec /bin/sh +exit 1 diff --git a/packages/altboot/files/nslu2le/altboot-menu/.mtn2git_empty b/packages/altboot/files/nslu2le/altboot-menu/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/altboot/files/nslu2le/altboot-menu/00-Default b/packages/altboot/files/nslu2le/altboot-menu/00-Default new file mode 100644 index 0000000000..cb06661d72 --- /dev/null +++ b/packages/altboot/files/nslu2le/altboot-menu/00-Default @@ -0,0 +1,17 @@ +# !/bin/sh +M_TITLE="Flash" + + +run_module() { + leds beep + leds boot system + exec $REAL_INIT "$INIT_RUNLEVEL" + exit 0 +} + +case "$1" in +title) echo "$M_TITLE";; +run) run_module;; +*) echo "Unknown parameter [$1]";; +esac + diff --git a/packages/altboot/files/nslu2le/altboot-menu/30-bootUSB-Stick b/packages/altboot/files/nslu2le/altboot-menu/30-bootUSB-Stick new file mode 100644 index 0000000000..c6c215ecc4 --- /dev/null +++ b/packages/altboot/files/nslu2le/altboot-menu/30-bootUSB-Stick @@ -0,0 +1,174 @@ +# !/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="USB Attached Storage" + +test "$USB_HOST_AVAILABLE" = "yes" || exit 0 + +# 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!" + + # Mount /proc, etc + init_rootfs + + echo -e "\nStarting 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 "" + scan_devices + usb_show_menu + +# 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 +} + +scan_devices() { + reset_pref "available_devices" + + cnt=1 + + for scsi_disk in `ls -1 /sys/block/ | grep ^sd` + do + scsi_disk_name="`echo "$scsi_disk" | awk '{printf("%s\n",toupper($0))}'`" + test -e /sys/block/$scsi_disk/device/vendor && HDD_VENDOR="`cat /sys/block/$scsi_disk/device/vendor | sed "s/\ $//"`" + test -z "$HDD_VENDOR" && HDD_VENDOR="Unknown Vendor" + + test -e /sys/block/$scsi_disk/device/model && HDD_MODEL="`cat /sys/block/$scsi_disk/device/model`" + test -z "$HDD_MODEL" && HDD_MODEL="Unknown Model" + + scsi_disk_partition_cnt="`ls -1 /sys/block/$scsi_disk | grep ^$scsi_disk | wc -l | tr -d " "`" + test "$scsi_disk_partition_cnt" -gt 1 && scsi_disk_partition_cnt="$scsi_disk_partition_cnt partitions" || scsi_disk_partition_cnt="$scsi_disk_partition_cnt partition" + + set_pref "available_devices" "$cnt" "$scsi_disk_name ( $HDD_VENDOR $HDD_MODEL with $scsi_disk_partition_cnt)" + set_pref "available_devices_short" "$cnt" "$scsi_disk" + set_pref "available_devices_type" "$cnt" "usb" + + let cnt=$cnt+1 + done + +} + +usb_show_menu() { + + cnt2=0 ; let cnt=$cnt-1 + while test "$cnt" != "$cnt2" + do + let cnt2=$cnt2+1 + get_pref "available_devices" "$cnt2" dev + + echo -e "\t[$cnt2] - $dev" + done + + while test -z "$selected_dev" + do + echo -en "\nYour choice: " + read junk + get_pref "available_devices" "$junk" selected_dev + get_pref "available_devices_type" "$junk" part_mode + +# debug_echo "show_menu(): selected: [$selected_dev]" + done + + if ( echo "$selected_dev" | grep -q "^Flash" ) + then + boot_from flash + else + get_pref "available_devices_short" "$junk" selected_dev +# debug_echo "show_menu(): selected_devices_short: [$selected_dev]" + + partitions="`ls -1 /sys/block/$selected_dev|grep ^$selected_dev`" + test -z "$partitions" && die "No partitions found on /dev/$selected_dev!" + + + echo -e "\nPlease select a partition on $selected_dev to boot from:\n" + + cnt=1 + for partition in $partitions + do + # We assume that partitions with a "size" < 10 are extended partitions + # and should not be listed. TYPE=swap is blacklisted as well. + part_size="`cat /sys/block/$selected_dev/$partition/size`" + part_type="`blkid -s TYPE -o value /dev/$partition`" + + if test "$part_size" -gt 10 -a "$part_type" != "swap" + then + let part_size="($part_size/2)/1000" + echo -e "\t[$cnt] $partition (~ ${part_size}Mb, $part_type)" + set_pref "available_partitions" "$cnt" "$partition" + + let cnt=$cnt+1 + fi + done + + while test -z "$selected_partition" + do + echo -en "\nYour choice: " + read junk + get_pref "available_partitions" "$junk" selected_partition + done + + part_uuid="`blkid -c /dev/null -s UUID -o value /dev/$selected_partition`" + + boot_from "$part_mode" "$selected_partition" "$part_uuid" + fi +} + +boot_from() { + debug_echo "boot_from() [$*]" + + part_mode="$1" + part_name="$2" + part_uuid="$3" + + case "$part_mode" in + usb) umount /tmp/mnt.set-bootdev >/dev/null 2>&1 + rm -rf /tmp/mnt.set-bootdev ; mkdir -p /tmp/mnt.set-bootdev + + if ! ( mount -U "$part_uuid" /tmp/mnt.set-bootdev ) + then + echo "** Note: UUID mount for $part_name failed" + mount /dev/$part_name /tmp/mnt.set-bootdev && echo "** Note: Normal mount for $part_name successful" + fi + + if ! test -e /tmp/mnt.set-bootdev/sbin/init.sysvinit + then + copy_rootfs /tmp/mnt.set-bootdev/ + else + umount /tmp/mnt.set-bootdev + echo -e "\nSetting /dev/$part_name as boot-partition" + echo "3 $part_name $part_uuid" > /etc/altboot.last + fi + ;; + esac +} + +copy_rootfs() { + debug_echo "copy_rootfs() [$*]" +} + +case "$1" in +title) echo "$M_TITLE";; +run) run_module "$2";; +esac + diff --git a/packages/altboot/files/nslu2le/altboot-menu/55-bin-sh b/packages/altboot/files/nslu2le/altboot-menu/55-bin-sh new file mode 100644 index 0000000000..1c3fccd9d9 --- /dev/null +++ b/packages/altboot/files/nslu2le/altboot-menu/55-bin-sh @@ -0,0 +1,27 @@ +# !/bin/sh +M_TITLE="init=/bin/sh" + +test "$DISABLE_BINSH_BOOT" = yes && exit 0 + +run_module() { + + test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" + + test "$ASK_PW_ON_BOOT" != "yes" && verify_master_pw >$OUT_TTY + + # Mount /proc, etc + init_rootfs + + echo -e "\nBoot system with 'exec /sbin/init 5'\n" + while true + do + exec $SH_SHELL <$OUT_TTY >$OUT_TTY 2>&1 + echo "WARNING: Shell was killed!" + done +} + +case "$1" in +title) echo "$M_TITLE";; +run) run_module;; +esac + diff --git a/packages/altboot/files/nslu2le/altboot.rc/.mtn2git_empty b/packages/altboot/files/nslu2le/altboot.rc/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/altboot/files/set-bootdev b/packages/altboot/files/set-bootdev new file mode 100755 index 0000000000..60d0283dc4 --- /dev/null +++ b/packages/altboot/files/set-bootdev @@ -0,0 +1,150 @@ +#!/bin/sh + +VERSION="0.0.1" +ENABLE_DEBUG="yes" + +die() { + echo -e "ERROR: $1" + exit 1 +} + +. /etc/altboot.func || die "/etc/altboot.func is missing!" +test -d /sys/block || die "Sysfs problem? (/sys/block not found)" + +debug_echo() { + test "$ENABLE_DEBUG" = "yes" && echo -e "${C_YELLOW}DEBUG:${C_RESET}${C_WHITE} $1 ${C_RESET}" +} + +scan_devices() { + reset_pref "available_devices" + + cnt=1 + set_pref "available_devices" "$cnt" "Flash" ; let cnt=$cnt+1 + + for scsi_disk in `ls -1 /sys/block/ | grep ^sd` + do + scsi_disk_name="`echo "$scsi_disk" | awk '{printf("%s\n",toupper($0))}'`" + test -e /sys/block/$scsi_disk/device/vendor && HDD_VENDOR="`cat /sys/block/$scsi_disk/device/vendor | sed "s/\ $//"`" + test -z "$HDD_VENDOR" && HDD_VENDOR="Unknown Vendor" + + test -e /sys/block/$scsi_disk/device/model && HDD_MODEL="`cat /sys/block/$scsi_disk/device/model`" + test -z "$HDD_MODEL" && HDD_MODEL="Unknown Model" + + scsi_disk_partition_cnt="`ls -1 /sys/block/$scsi_disk | grep ^$scsi_disk | wc -l | tr -d " "`" + test "$scsi_disk_partition_cnt" -gt 1 && scsi_disk_partition_cnt="$scsi_disk_partition_cnt partitions" || scsi_disk_partition_cnt="$scsi_disk_partition_cnt partition" + + set_pref "available_devices" "$cnt" "$scsi_disk_name ( $HDD_VENDOR $HDD_MODEL with $scsi_disk_partition_cnt)" + set_pref "available_devices_short" "$cnt" "$scsi_disk" + set_pref "available_devices_type" "$cnt" "usb" + + let cnt=$cnt+1 + done + +} + +show_menu() { + echo -e "\nset-bootdev v$VERSION\n" + + echo -e "Please select the device you wish to boot from:\n" + + cnt2=0 ; let cnt=$cnt-1 + while test "$cnt" != "$cnt2" + do + let cnt2=$cnt2+1 + get_pref "available_devices" "$cnt2" dev + + echo -e "\t[$cnt2] - $dev" + done + + while test -z "$selected_dev" + do + echo -en "\nYour choice: " + read junk + get_pref "available_devices" "$junk" selected_dev + get_pref "available_devices_type" "$junk" part_mode + +# debug_echo "show_menu(): selected: [$selected_dev]" + done + + if ( echo "$selected_dev" | grep -q "^Flash" ) + then + boot_from flash + else + get_pref "available_devices_short" "$junk" selected_dev +# debug_echo "show_menu(): selected_devices_short: [$selected_dev]" + + partitions="`ls -1 /sys/block/$selected_dev|grep ^$selected_dev`" + test -z "$partitions" && die "No partitions found on /dev/$selected_dev!" + + + echo -e "\nPlease select a partition on $selected_dev to boot from:\n" + + cnt=1 + for partition in $partitions + do + # We assume that partitions with a "size" < 10 are extended partitions + # and should not be listed. TYPE=swap is blacklisted as well. + part_size="`cat /sys/block/$selected_dev/$partition/size`" + part_type="`blkid -s TYPE -o value /dev/$partition`" + + if test "$part_size" -gt 10 -a "$part_type" != "swap" + then + let part_size="($part_size/2)/1000" + echo -e "\t[$cnt] $partition (~ ${part_size}Mb, $part_type)" + set_pref "available_partitions" "$cnt" "$partition" + + let cnt=$cnt+1 + fi + done + + while test -z "$selected_partition" + do + echo -en "\nYour choice: " + read junk + get_pref "available_partitions" "$junk" selected_partition + done + + part_uuid="`blkid -c /dev/null -s UUID -o value /dev/$selected_partition`" + + boot_from "$part_mode" "$selected_partition" "$part_uuid" + fi +} + +boot_from() { + debug_echo "boot_from() [$*]" + + part_mode="$1" + part_name="$2" + part_uuid="$3" + + case "$part_mode" in + usb) umount /tmp/mnt.set-bootdev >/dev/null 2>&1 + rm -rf /tmp/mnt.set-bootdev ; mkdir -p /tmp/mnt.set-bootdev + + if ! ( mount -U "$part_uuid" /tmp/mnt.set-bootdev ) + then + echo "** Note: UUID mount for $part_name failed" + mount /dev/$part_name /tmp/mnt.set-bootdev && echo "** Note: Normal mount for $part_name successful" + fi + + if ! test -e /tmp/mnt.set-bootdev/sbin/init.sysvinit + then + copy_rootfs /tmp/mnt.set-bootdev/ + else + umount /tmp/mnt.set-bootdev + echo -e "\nSetting /dev/$part_name as boot-partition" + echo "$part_mode $part_name $part_uuid" > /etc/set-bootdev.conf + fi + ;; + flash) echo "Setting the onboard flash as boot-partition" + echo "$part_mode $part_name $part_uuid" > /etc/set-bootdev.conf + ;; + esac +} + +copy_rootfs() { + debug_echo "copy_rootfs() [$*]" +} + +scan_devices +show_menu -- cgit v1.2.3 From 2992d24c5ad56361a793281566b1ff7c76aa2836 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Wed, 28 Mar 2007 22:13:05 +0000 Subject: altboot: - Drop files/* and altboot_0.0.0.bb - Add altboot_svn.bb - Add README.txt explaining what the different versions do --- packages/altboot/files/.mtn2git_empty | 0 packages/altboot/files/akita/.mtn2git_empty | 0 packages/altboot/files/akita/altboot-2.4.cfg | 31 - packages/altboot/files/akita/altboot-2.6.cfg | 41 - packages/altboot/files/altboot-menu/.mtn2git_empty | 0 packages/altboot/files/altboot-menu/00-Default | 14 - packages/altboot/files/altboot-menu/10-noGui | 16 - packages/altboot/files/altboot-menu/15-bootSD | 32 - packages/altboot/files/altboot-menu/20-bootCF | 32 - .../files/altboot-menu/99-ownScripts-example | 68 -- .../files/altboot-menu/Advanced/.mtn2git_empty | 0 .../files/altboot-menu/Advanced/30-bootUSB-Stick | 47 -- .../altboot/files/altboot-menu/Advanced/40-bootNFS | 110 --- .../altboot/files/altboot-menu/Advanced/55-bin-sh | 27 - .../files/altboot-menu/Advanced/60-orig-init | 20 - .../files/altboot-menu/Advanced/70-install-tgz | 266 ------- .../files/altboot-menu/Advanced/70-setKernel | 68 -- .../files/altboot-menu/Advanced/80-configure-kexec | 248 ------ .../files/altboot-menu/Advanced/80-copyrootfs | 323 -------- packages/altboot/files/altboot.func | 870 --------------------- packages/altboot/files/altboot.rc/.mtn2git_empty | 0 packages/altboot/files/altboot.rc/Readme.txt | 2 - .../altboot/files/altboot.rc/disable_printk.sh | 6 - packages/altboot/files/altboot.rc/loadkeymap.sh | 8 - packages/altboot/files/altboot.rc/playbeep.sh | 34 - packages/altboot/files/altbootctl | 311 -------- packages/altboot/files/altbootctl.conf | 98 --- packages/altboot/files/beep.raw | 1 - packages/altboot/files/c7x0/.mtn2git_empty | 0 packages/altboot/files/c7x0/altboot-2.4.cfg | 30 - packages/altboot/files/c7x0/altboot-2.6.cfg | 39 - packages/altboot/files/collie/.mtn2git_empty | 0 packages/altboot/files/collie/altboot-2.4.cfg | 26 - packages/altboot/files/fic-gta01/.mtn2git_empty | 0 packages/altboot/files/fic-gta01/altboot-2.6.cfg | 41 - .../files/fic-gta01/altboot-menu/.mtn2git_empty | 0 .../files/fic-gta01/altboot-menu/00-Default | 14 - .../altboot/files/fic-gta01/altboot-menu/15-bootSD | 32 - .../fic-gta01/altboot-menu/Advanced/.mtn2git_empty | 0 .../fic-gta01/altboot-menu/Advanced/40-bootNFS | 110 --- packages/altboot/files/init.altboot | 606 -------------- packages/altboot/files/nslu2le/.mtn2git_empty | 0 packages/altboot/files/nslu2le/altboot-2.6.cfg | 55 -- .../files/nslu2le/altboot-handlers/.mtn2git_empty | 0 .../files/nslu2le/altboot-handlers/05-USB-Storage | 90 --- .../nslu2le/altboot-handlers/10-Onboard-Flash | 18 - .../files/nslu2le/altboot-menu/.mtn2git_empty | 0 .../altboot/files/nslu2le/altboot-menu/00-Default | 17 - .../files/nslu2le/altboot-menu/30-bootUSB-Stick | 174 ----- .../altboot/files/nslu2le/altboot-menu/55-bin-sh | 27 - .../files/nslu2le/altboot.rc/.mtn2git_empty | 0 packages/altboot/files/poodle/.mtn2git_empty | 0 packages/altboot/files/poodle/altboot-2.4.cfg | 26 - packages/altboot/files/poodle/altboot-2.6.cfg | 45 -- packages/altboot/files/set-bootdev | 150 ---- packages/altboot/files/spitz/.mtn2git_empty | 0 packages/altboot/files/spitz/altboot-2.6.cfg | 41 - packages/altboot/files/tosa/.mtn2git_empty | 0 packages/altboot/files/tosa/altboot-2.4.cfg | 32 - packages/altboot/files/tosa/altboot-2.6.cfg | 41 - 60 files changed, 4287 deletions(-) delete mode 100644 packages/altboot/files/.mtn2git_empty delete mode 100644 packages/altboot/files/akita/.mtn2git_empty delete mode 100644 packages/altboot/files/akita/altboot-2.4.cfg delete mode 100644 packages/altboot/files/akita/altboot-2.6.cfg delete mode 100644 packages/altboot/files/altboot-menu/.mtn2git_empty delete mode 100644 packages/altboot/files/altboot-menu/00-Default delete mode 100644 packages/altboot/files/altboot-menu/10-noGui delete mode 100644 packages/altboot/files/altboot-menu/15-bootSD delete mode 100644 packages/altboot/files/altboot-menu/20-bootCF delete mode 100644 packages/altboot/files/altboot-menu/99-ownScripts-example delete mode 100644 packages/altboot/files/altboot-menu/Advanced/.mtn2git_empty delete mode 100644 packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick delete mode 100644 packages/altboot/files/altboot-menu/Advanced/40-bootNFS delete mode 100644 packages/altboot/files/altboot-menu/Advanced/55-bin-sh delete mode 100644 packages/altboot/files/altboot-menu/Advanced/60-orig-init delete mode 100644 packages/altboot/files/altboot-menu/Advanced/70-install-tgz delete mode 100644 packages/altboot/files/altboot-menu/Advanced/70-setKernel delete mode 100644 packages/altboot/files/altboot-menu/Advanced/80-configure-kexec delete mode 100644 packages/altboot/files/altboot-menu/Advanced/80-copyrootfs delete mode 100644 packages/altboot/files/altboot.func delete mode 100644 packages/altboot/files/altboot.rc/.mtn2git_empty delete mode 100644 packages/altboot/files/altboot.rc/Readme.txt delete mode 100644 packages/altboot/files/altboot.rc/disable_printk.sh delete mode 100644 packages/altboot/files/altboot.rc/loadkeymap.sh delete mode 100644 packages/altboot/files/altboot.rc/playbeep.sh delete mode 100755 packages/altboot/files/altbootctl delete mode 100644 packages/altboot/files/altbootctl.conf delete mode 100644 packages/altboot/files/beep.raw delete mode 100644 packages/altboot/files/c7x0/.mtn2git_empty delete mode 100644 packages/altboot/files/c7x0/altboot-2.4.cfg delete mode 100644 packages/altboot/files/c7x0/altboot-2.6.cfg delete mode 100644 packages/altboot/files/collie/.mtn2git_empty delete mode 100644 packages/altboot/files/collie/altboot-2.4.cfg delete mode 100644 packages/altboot/files/fic-gta01/.mtn2git_empty delete mode 100644 packages/altboot/files/fic-gta01/altboot-2.6.cfg delete mode 100644 packages/altboot/files/fic-gta01/altboot-menu/.mtn2git_empty delete mode 100644 packages/altboot/files/fic-gta01/altboot-menu/00-Default delete mode 100644 packages/altboot/files/fic-gta01/altboot-menu/15-bootSD delete mode 100644 packages/altboot/files/fic-gta01/altboot-menu/Advanced/.mtn2git_empty delete mode 100644 packages/altboot/files/fic-gta01/altboot-menu/Advanced/40-bootNFS delete mode 100644 packages/altboot/files/init.altboot delete mode 100644 packages/altboot/files/nslu2le/.mtn2git_empty delete mode 100644 packages/altboot/files/nslu2le/altboot-2.6.cfg delete mode 100644 packages/altboot/files/nslu2le/altboot-handlers/.mtn2git_empty delete mode 100644 packages/altboot/files/nslu2le/altboot-handlers/05-USB-Storage delete mode 100644 packages/altboot/files/nslu2le/altboot-handlers/10-Onboard-Flash delete mode 100644 packages/altboot/files/nslu2le/altboot-menu/.mtn2git_empty delete mode 100644 packages/altboot/files/nslu2le/altboot-menu/00-Default delete mode 100644 packages/altboot/files/nslu2le/altboot-menu/30-bootUSB-Stick delete mode 100644 packages/altboot/files/nslu2le/altboot-menu/55-bin-sh delete mode 100644 packages/altboot/files/nslu2le/altboot.rc/.mtn2git_empty delete mode 100644 packages/altboot/files/poodle/.mtn2git_empty delete mode 100644 packages/altboot/files/poodle/altboot-2.4.cfg delete mode 100644 packages/altboot/files/poodle/altboot-2.6.cfg delete mode 100755 packages/altboot/files/set-bootdev delete mode 100644 packages/altboot/files/spitz/.mtn2git_empty delete mode 100644 packages/altboot/files/spitz/altboot-2.6.cfg delete mode 100644 packages/altboot/files/tosa/.mtn2git_empty delete mode 100644 packages/altboot/files/tosa/altboot-2.4.cfg delete mode 100644 packages/altboot/files/tosa/altboot-2.6.cfg (limited to 'packages/altboot/files') diff --git a/packages/altboot/files/.mtn2git_empty b/packages/altboot/files/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/altboot/files/akita/.mtn2git_empty b/packages/altboot/files/akita/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/altboot/files/akita/altboot-2.4.cfg b/packages/altboot/files/akita/altboot-2.4.cfg deleted file mode 100644 index 4ea84ce32d..0000000000 --- a/packages/altboot/files/akita/altboot-2.4.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# -# Altboot machine configuration for: Akita / Kernel 2.4 -# - -# Handled by /sbin/init.altboot -# Allow booting images from SD or CF instead of booting -# the ROM. -ENABLE_ALTBOOT="yes" -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_HOST_AVAILABLE="yes" -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="" -ASK_PW_ON_BOOT="no" - -SD_MOUNTPOINT="/media/card" -CF_MOUNTPOINT="/media/cf" diff --git a/packages/altboot/files/akita/altboot-2.6.cfg b/packages/altboot/files/akita/altboot-2.6.cfg deleted file mode 100644 index 62e8ea2434..0000000000 --- a/packages/altboot/files/akita/altboot-2.6.cfg +++ /dev/null @@ -1,41 +0,0 @@ -# -# Altboot machine configuration for: Akita / Kernel 2.6 -# - -# Handled by /sbin/init.altboot -# Allow booting images from SD or CF instead of booting -# the ROM. -ENABLE_ALTBOOT="yes" -TIMEOUT="4" -REAL_INIT="/sbin/init.sysvinit" -SH_SHELL="/bin/sh" - -ENABLE_SOUND="yes" - -IMAGE_PATH="boot-images" -IMAGE_TYPE="ext2" -FSCK_IMAGES="yes" -ENABLE_IMAGECONF="yes" - -SD_DEVICE="/dev/mmcblk0p1" -SD_KERNEL_MODULE="" - -USB_HOST_AVAILABLE="yes" -USB_STORAGE_MODULES="ohci_hcd usb_storage sd_mod" -USB_STORAGE_PARTITION="/dev/sda1" -USB_STORAGE_WAIT="4" - -USB_NETWORKING_AVAILABLE="yes" -USB_NW_MODULES="usbcore pxa27x_udc ohci-hcd g_ether" -USB_NW_DEVICE="usb0" - -KEXEC_KERNEL_DIR="/boot" -KEXEC_BIN="/usr/sbin/kexec" - -INIT_RUNLEVEL="5" -NO_GUI_RL="2" -MASTER_PASSWORD="" -ASK_PW_ON_BOOT="no" - -SD_MOUNTPOINT="/media/card" -CF_MOUNTPOINT="/media/cf" diff --git a/packages/altboot/files/altboot-menu/.mtn2git_empty b/packages/altboot/files/altboot-menu/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/altboot/files/altboot-menu/00-Default b/packages/altboot/files/altboot-menu/00-Default deleted file mode 100644 index 9d29fdae2a..0000000000 --- a/packages/altboot/files/altboot-menu/00-Default +++ /dev/null @@ -1,14 +0,0 @@ -# !/bin/sh -M_TITLE="Normal Boot" - - -run_module() { - exec $REAL_INIT "$INIT_RUNLEVEL" - exit 0 -} - -case "$1" in -title) echo "$M_TITLE";; -run) run_module;; -esac - diff --git a/packages/altboot/files/altboot-menu/10-noGui b/packages/altboot/files/altboot-menu/10-noGui deleted file mode 100644 index cf3c10c381..0000000000 --- a/packages/altboot/files/altboot-menu/10-noGui +++ /dev/null @@ -1,16 +0,0 @@ -# !/bin/sh -M_TITLE="Don't launch GUI" - -test "$DISABLE_NOGUI_BOOT" = yes && exit 0 - - -run_module() { - clear ; exec $REAL_INIT "$NO_GUI_RL" - exit 0 -} - -case "$1" in -title) echo "$M_TITLE";; -run) run_module;; -esac - diff --git a/packages/altboot/files/altboot-menu/15-bootSD b/packages/altboot/files/altboot-menu/15-bootSD deleted file mode 100644 index 3cf49deea5..0000000000 --- a/packages/altboot/files/altboot-menu/15-bootSD +++ /dev/null @@ -1,32 +0,0 @@ -# !/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 SD card" - -test "$DISABLE_SD_BOOT" = yes && exit 0 - -# 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!" - - # Mount /proc, etc - init_rootfs - - mount_sd - - # Check for a real fs and loop-images. - check_target "$SD_MOUNTPOINT" >/dev/tty0 - -} - - -case "$1" in -title) echo "$M_TITLE";; -run) run_module "$2";; -esac - diff --git a/packages/altboot/files/altboot-menu/20-bootCF b/packages/altboot/files/altboot-menu/20-bootCF deleted file mode 100644 index 4add6e6631..0000000000 --- a/packages/altboot/files/altboot-menu/20-bootCF +++ /dev/null @@ -1,32 +0,0 @@ -# !/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 CF card" - -test "$DISABLE_CF_BOOT" = yes && exit 0 - -# 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!" - - # Mount /proc, etc - init_rootfs - - mount_cf - - # Check for a real fs and loop-images. - check_target "$CF_MOUNTPOINT" - -} - - -case "$1" in -title) echo "$M_TITLE";; -run) run_module "$2";; -esac - diff --git a/packages/altboot/files/altboot-menu/99-ownScripts-example b/packages/altboot/files/altboot-menu/99-ownScripts-example deleted file mode 100644 index 7566416b87..0000000000 --- a/packages/altboot/files/altboot-menu/99-ownScripts-example +++ /dev/null @@ -1,68 +0,0 @@ -# !/bin/sh -# -# Copyright Matthias Hentges (c) 2005 -# -# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL) - - -# This file will teach you how to implement your own scripts while using existing altboot -# code. - -# /sbin/init.altboot searches /etc/altboot-menu for scripts. It will only list scripts which -# return a title when run with the "title" parameter. -# Script which do not return a title will never be shown in the boot menu! -# -M_TITLE="altboot sample" - -# We can use that to deactivate certain scripts: -exit 0 - -# The "title" parameter is implemented at the end of this script so it will never be reached -# and the script will simply be ignored by altboot. - -# This function is activated by init.altboot by calling this script with the "run" option -run_module() { - - # altboot.func contains re-useable code. If you intend to use check_target (see below) - # you must keep this line. If not, delete it. - test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" - - - # The only thing you'll have to do is get your medium mounted. - # The following lines mount a SD card on 2.4-series kernels on a Zaurus - - ########################################## - - # Mount /proc, etc - init_rootfs - - echo -n "Loading SD kernel module..." - /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed" - - echo -n "Mounting $SD_MOUNTPOINT..." >/dev/tty0 - /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed" - - echo "" - - # Give the SD and CF mounting some time. This is a must for SD - sleep 2 - ########################################## - - # Once the medium (be it a CF or SD card, or even a NFS drive) is mounted somewhere, - # just call check_target with the mountpoint as parameter. - # check_target searches the medium for a real filesystem and loop-images and - # asks the user what to boot if there are several choices. - - # Check for a real fs and loop-images. - check_target "$SD_MOUNTPOINT" >/dev/tty0 - - # Done :) - -} - - -case "$1" in -title) echo "$M_TITLE";; -run) run_module "$2";; -esac - diff --git a/packages/altboot/files/altboot-menu/Advanced/.mtn2git_empty b/packages/altboot/files/altboot-menu/Advanced/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick b/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick deleted file mode 100644 index b573e7a10c..0000000000 --- a/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick +++ /dev/null @@ -1,47 +0,0 @@ -# !/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" - -test "$USB_HOST_AVAILABLE" = "yes" || exit 0 - -# This function is activated by init.altboot by calling this script with the "ru