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 "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/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS deleted file mode 100644 index 4f5c195be2..0000000000 --- a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS +++ /dev/null @@ -1,110 +0,0 @@ -#! /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/altboot-menu/Advanced/55-bin-sh b/packages/altboot/files/altboot-menu/Advanced/55-bin-sh deleted file mode 100644 index e4fe99ebae..0000000000 --- a/packages/altboot/files/altboot-menu/Advanced/55-bin-sh +++ /dev/null @@ -1,27 +0,0 @@ -# !/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 >/dev/$OUT_TTY - - # Mount /proc, etc - init_rootfs - - echo -e "\nBoot system with 'exec /sbin/init 5'\n" - while true - do - exec $SH_SHELL /dev/$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/altboot-menu/Advanced/60-orig-init b/packages/altboot/files/altboot-menu/Advanced/60-orig-init deleted file mode 100644 index ad9f2c78e1..0000000000 --- a/packages/altboot/files/altboot-menu/Advanced/60-orig-init +++ /dev/null @@ -1,20 +0,0 @@ -# !/bin/sh -M_TITLE="Boot original INIT" - -exit 0 - -run_module() { - - test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" - - echo "altboot: Using real init [$REAL_INIT] [$INIT_RUNLEVEL] *" >/dev/tty1 - 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/Advanced/70-install-tgz b/packages/altboot/files/altboot-menu/Advanced/70-install-tgz deleted file mode 100644 index b6e5d94d5d..0000000000 --- a/packages/altboot/files/altboot-menu/Advanced/70-install-tgz +++ /dev/null @@ -1,266 +0,0 @@ -#!/bin/sh -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!" - - # Mount /proc, etc - init_rootfs - - # Mount - mount_sd ingore_errors - mount_cf - mount_home - - for source in /home /media/card /media/cf - do - #echo "source: [$source]" - rootfs_files="`ls -1 $source | grep "rootfs.tar.gz"`" - - #echo "rootfs_file: [$rootfs_files]" - if test "`echo "$rootfs_files" | wc -l | tr -d " "`" -gt 1 - then - echo "Multiple rootfs files not supported, yet" - else - if test -n "$rootfs_files" - then - rootfs_source="$source/$rootfs_files" - echo "Using [$rootfs_source]" - break - fi - fi - done - - test -z "$rootfs_source" && die "No rootfs.tar.gz found" - - echo -e "\nPlease choose the target of this installation:\n" - - echo -e "\t [1] SD / MMC" - echo -e "\t [2] Compact Flash" - - echo "" - while true - do - echo -n "Your target: " - read junk - - case "$junk" in - 1) if (mount | grep -q "/media/card ") - then - rootfs_target="/media/card"; break - else - echo -e "\nInstallation target [/media/card] not mounted\n" - fi ;; - 2) if (mount | grep -q "/media/cf ") - then - rootfs_target="/media/cf"; break - else - echo -e "\nInstallation target [/media/cf] not mounted\n" - fi ;; - esac - done - - echo -e "\nPlease choose the type of this installation:\n" - - echo -e "\t [1] Imagefile (loopfile)" - echo -e "\t [2] Direct Install" - - echo "" - while true - do - echo -n "Install type: " - read junk - - case "$junk" in - 1) if test -x /sbin/mkfs.ext2 - then - rootfs_type="image" - break - else - echo -e "\nNOTE: mkfs.ext2 (from e2fsprogs-mke2fs) not found, loop-images not supported\n" - fi ;; - 2) rootfs_type="direct" ; break ;; - esac - done - - case "$rootfs_type" in - image) install_rootfs_image "$rootfs_target";; - direct) install_rootfs_direct "$rootfs_target";; - esac -} - -clear_directories(){ - test "$1" = "/" -o "$1" = "/ " && die "clear_directories(): You don't want to do that." - - ! test -d "$1" && die "clear_directories(): [$1] not found." - - for d in bin dev media proc sys usr boot etc lib mnt sbin tmp var - do - if test -d "$1/$d" - then - echo "Removing [$1/$d]..." - rm -rf "$1/$d" - fi - done - -} - - -install_rootfs_direct(){ - - mount | grep -q "$1 " || die "Installation target [$1] not mounted" - - echo -e "Do you want to remove existing directories from [$1]\n before installing the new rootfs?" - echo "" - - while true - do - echo -n "Remove old directories? [Y|n] " - read junk /dev/tty0 2>&1 - - case "$junk" in - Y|y|"") clear_directories "$1"; break ;; - esac - done - - echo "Please press to begin the installation" - read junk /dev/tty0 2>&1 - - test -d "$1" || die "Directory [$1] not found" - - echo -n "Installing rootfs, please wait..." - tar -xzf "$rootfs_source" -C "$1" >/dev/null 2>&1 && echo ok || die "tar -xzf \"$rootfs_source\" -C \"$1\" failed!" - - echo -n "Syncing drives..." - sync - echo "done" - -# umount "$1" - - echo "Press to bring up the altboot menu" - read junk /dev/tty0 2>&1 - exec /sbin/init.altboot -force - -} - -install_rootfs_image(){ - - mount | grep -q "$1 " || die "Installation target [$1] not mounted" - - echo "" - echo "Please enter a name for the image file." - echo "Do not use the character" - echo "" - - - while true - do - echo -n "Image name: " - read junk - - if test -n "$junk" - then - if test -e "$1/boot-images/${junk}-rootfs.bin" - then - echo -e "\nFile [$1/boot-images/${junk}-rootfs.bin] already exists." - - while true - do - echo -n "Overwrite? [y|N] " - read junk2 - - case "$junk2" in - Y|y) break;; - n|N|"") install_rootfs_image "$1" - exit 0;; - esac - done - rootfs_image_name="${junk}-rootfs.bin" - break - else - echo -n "Use [$junk] as name? [Y|n] " - read junk2 - - case "$junk2" in - "Y"|"y"|"") rootfs_image_name="${junk}-rootfs.bin" - break ;; - *) echo "err ]$junk]";; - esac - fi - fi - done - - echo "" - echo "Please enter the image size in MegaBytes" - echo "Must be at least 30Mb" - echo "" - - while true - do - echo -n "Image size: " - read junk - - junk="`echo "$junk" | sed "s/[a-zA-Z]//g"`" - - if test -n "$junk" - then - if test "$junk" -gt 29 - then - echo -n "Is [${junk}Mb] correct? [Y|n] " - read junk2 - - case "$junk2" in - Y|y|"") rootfs_image_size="$junk" - break ;; - esac - - else - echo "Image size of [${junk}Mb] is too small!" - fi - fi - done - - test -z "$rootfs_image_name" -o -z "$rootfs_image_size" && die "DEBUG: Empty VAR in install_rootfs_image()" - - echo "" - echo "Creating [$rootfs_image_name] (${rootfs_image_size}Mb) on [$1]" - echo "Please wait..." - mkdir -p "$1/boot-images" - - dd if=/dev/zero of="$1/boot-images/$rootfs_image_name" bs=1024k count=$rootfs_image_size >/dev/null - - echo -n "Creating an ext2 filesystem on $rootfs_image_name..." - losetup /dev/loop0 "$1/boot-images/$rootfs_image_name" || die "losetup /dev/loop0 \"$1/boot-images/$rootfs_image_name\" failed!" - mkfs.ext2 -m0 /dev/loop0 >/dev/null 2>&1 && echo done || die "mkfs.ext2 -m0 /dev/loop0 failed!" - - echo -n "Mounting loopfile..." - mkdir -p /media/image - mount /dev/loop0 /media/image && echo ok || die "mount /dev/loop0 /media/image failed!" - - echo -n "Installing rootfs, please wait..." - tar -xzf "$rootfs_source" -C "/media/image" >/dev/null 2>&1 && echo ok || die "tar -xzf \"$rootfs_source\" -C \"$1\" failed!" - - echo -n "Syncing drives..." - sync - echo "done" - - umount "/media/image" && losetup -d /dev/loop0 - - echo "Press to bring up the altboot menu" - read junk /dev/tty0 2>&1 - exec /sbin/init.altboot -force - -} - - - -#run_module - -case "$1" in -title) echo "$M_TITLE";; -flags) echo "$M_FLAGS";; -run) run_module "$2";; -esac diff --git a/packages/altboot/files/altboot-menu/Advanced/70-setKernel b/packages/altboot/files/altboot-menu/Advanced/70-setKernel deleted file mode 100644 index 50f61d034f..0000000000 --- a/packages/altboot/files/altboot-menu/Advanced/70-setKernel +++ /dev/null @@ -1,68 +0,0 @@ -# !/bin/sh -M_TITLE="Choose kernel for next boot" - -# Deprecated due to altbootctl -exit 0 - -# Only kernel 2.6 offers kexec support -uname -r | grep -q "^2.6" || exit 0 - -run_module() { - - test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" - - test -z "$KEXEC_KERNEL_DIR" && KEXEC_KERNEL_DIR="/boot" - test -x "$KEXEC_BIN" || mdie "kexec-tools not found [$KEXEC_BIN]" - - # Mount /proc, etc - # init_rootfs - - if test `ls -1 $KEXEC_KERNEL_DIR | grep -v "kexec.cfg" | wc -l | tr -d " "` -gt 1 - then - echo -e "\nSelect the kernel for use of the next boot:\n" - - cnt=1 ; reset_pref "kexec_klist" - for k in `ls -1 $KEXEC_KERNEL_DIR/zImage* | grep -v "kexec.cfg" ` - do - echo -e "\t[$cnt] $k" - set_pref "kexec_klist" "$cnt" "$k" - - let cnt=$cnt+1 - done - - echo "" - - while true - do - echo -n "Select a kernel: " - read junk - - #echo_pref kexec_klist - - get_pref "kexec_klist" "$junk" KEXEC_SELECTED_KERNEL && break - - done - else - KEXEC_SELECTED_KERNEL="`ls -1 $KEXEC_KERNEL_DIR/zImage* | grep -v "kexec.cfg" `" - fi - - echo -e "\nUsing [$KEXEC_SELECTED_KERNEL]" - - if ! test -e "$KEXEC_SELECTED_KERNEL.kexec.cfg" - then - echo -e "\nWARNING: This kernel has not been configured." - echo -e "It will only boot correctly if CMDLINE is compiled in.\n" - fi - - export USE_KEXEC_ON_NEXT_BOOT=yes - export KEXEC_SELECTED_KERNEL - show_menu -} - - - -case "$1" in -title) echo "$M_TITLE";; -run) run_module;; -esac - diff --git a/packages/altboot/files/altboot-menu/Advanced/80-configure-kexec b/packages/altboot/files/altboot-menu/Advanced/80-configure-kexec deleted file mode 100644 index 1b8fc6e547..0000000000 --- a/packages/altboot/files/altboot-menu/Advanced/80-configure-kexec +++ /dev/null @@ -1,248 +0,0 @@ -# !/bin/sh -M_TITLE="Configure kexec CMDLINE" - -# Deprecated due to altbootctl -exit 0 - - -# Only kernel 2.6 offers kexec support -uname -r | grep -q "^2.6" || exit 0 - -run_module() { - - test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" - - test -z "$KEXEC_KERNEL_DIR" && KEXEC_KERNEL_DIR="/boot" - test -x "$KEXEC_BIN" || mdie "kexec-tools not found [$KEXEC_BIN]" - - # Mount /proc, etc - init_rootfs - - if test `ls -1 $KEXEC_KERNEL_DIR | grep -v "kexec.cfg" | wc -l | tr -d " "` -gt 1 - then - echo -e "\nPlease select the kernel you want to configure:\n" - - cnt=1 ; reset_pref "kexec_klist" - for k in `ls -1 $KEXEC_KERNEL_DIR/zImage* | grep -v "kexec.cfg" ` - do - echo -e "\t[$cnt] $k" - set_pref "kexec_klist" "$cnt" "$k" - - let cnt=$cnt+1 - done - - echo "" - - while true - do - echo -n "Select a kernel: " - read junk - - get_pref "kexec_klist" "$junk" KEXEC_KERNEL && break - - done - else - KEXEC_KERNEL="`ls -1 $KEXEC_KERNEL_DIR/zImage* | grep -v "kexec.cfg" `" - fi - - echo -e "\nUsing [$KEXEC_KERNEL]" - - configure_rootdev - configure_roottype - configure_verbose - configure_custom - - CMDLINE="console=ttyS0,115200n8 console=tty1 dyntick=enable fbcon=rotate:1 noinitrd root=$KERNEL_ROOTDEV rootfstype=$KERNEL_ROOTFSTYPE $KERNEL_VERBOSE $KERNEL_CUSTOM" - - echo -en "\nWriting CMDLINE to $KEXEC_KERNEL.kexec.cfg..." - echo "$CMDLINE" > $KEXEC_KERNEL.kexec.cfg && echo ok || mdie FAILED - - show_menu -} - -configure_rootdev() { - - echo -e "\nPlease choose a root device (root=*):\n" - - cnt=1 ; reset_pref "kexec_rootdev" - for root in /dev/mtdblock2 /dev/hda1 "Manual Entry" - do - echo -e "\t[$cnt] $root" - set_pref kexec_rootdev "$cnt" "$root" - let cnt=cnt+1 - done - - echo "" - - while true - do - echo -n "Select a root device: " - read junk - - get_pref kexec_rootdev "$junk" KERNEL_ROOTDEV && break - done - - if test "$KERNEL_ROOTDEV" = "Manual Entry" - then - echo "" - - KERNEL_ROOTDEV="" - - while test -z "$KERNEL_ROOTDEV" - do - while true - do - echo -n "Enter the root device: " - read junk - test -n "$junk" && break - done - - echo -en "\nIs [$junk] correct? [Y|n] " - read junk2 - while true - do - if test "$junk2" = y -o "$junk2" = Y -o -z "$junk2" - then - KERNEL_ROOTDEV="$junk" - break - fi - - break - done - done - fi - - echo "Using [$KERNEL_ROOTDEV] as root device" -} - -configure_roottype() { - - echo -e "\nPlease choose a rootfs type (rootfs=*):\n" - - cnt=1 ; reset_pref "kexec_rootfstype" - for root in jffs2 ext2 ext3 "Manual Entry" - do - echo -e "\t[$cnt] $root" - set_pref kexec_rootfstype "$cnt" "$root" - let cnt=cnt+1 - done - - echo "" - - while true - do - echo -n "Select a rootfs type: " - read junk - - get_pref kexec_rootfstype "$junk" KERNEL_ROOTFSTYPE && break - done - - if test "$KERNEL_ROOTFSTYPE" = "Manual Entry" - then - echo "" - - KERNEL_ROOTFSTYPE="" - - while test -z "$KERNEL_ROOTFSTYPE" - do - while true - do - echo -n "Enter the rootfs type: " - read junk - test -n "$junk" && break - done - - echo -en "\nIs [$junk] correct? [Y|n] " - read junk2 - while true - do - if test "$junk2" = y -o "$junk2" = Y -o -z "$junk2" - then - KERNEL_ROOTFSTYPE="$junk" - break - fi - - break - done - done - fi - - echo "Using [$KERNEL_ROOTFSTYPE] as rootfs type" -} - -configure_verbose() { - echo -e "\nDo you want to see kernel messages? ([quiet | debug]):\n" - - echo -e "\t[1] Yes" - echo -e "\t[2] No" - - echo "" - - while true - do - echo -n "Select one of the above: " - read junk - - test "$junk" = 1 -o "$junk" = 2 && break - done - - test "$junk" = 1 && KERNEL_VERBOSE="debug" || KERNEL_VERBOSE="quiet" - -} - -configure_custom() { - echo -e "\nDo you want to set custom kernel options?\n" - - echo -e "\t[1] Yes" - echo -e "\t[2] No" - - echo "" - - while true - do - echo -n "Select one of the above: " - read junk - - test "$junk" = 1 -o "$junk" = 2 && break - done - - if test "$junk" = 1 - then - - echo "" - - KERNEL_CUSTOM="" - - while test -z "$KERNEL_CUSTOM" - do - while true - do - echo -n "Enter kernel options: " - read junk - test -n "$junk" && break - done - - echo -en "\nIs [$junk] correct? [Y|n] " - read junk2 - while true - do - if test "$junk2" = y -o "$junk2" = Y -o -z "$junk2" - then - KERNEL_CUSTOM="$junk" - break - fi - - break - done - done - fi - - echo "Using [$KERNEL_CUSTOM] as custom kernel options" - -} - -case "$1" in -title) echo "$M_TITLE";; -run) run_modu