summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/altboot/altboot.bb2
-rw-r--r--packages/altboot/files/altboot-menu/Advanced/40-bootNFS5
-rw-r--r--packages/altboot/files/altboot-menu/Advanced/80-copyrootfs6
-rw-r--r--packages/altboot/files/altboot.func18
-rw-r--r--packages/altboot/files/init.altboot32
5 files changed, 48 insertions, 15 deletions
diff --git a/packages/altboot/altboot.bb b/packages/altboot/altboot.bb
index de5d780579..5fe8d2278b 100644
--- a/packages/altboot/altboot.bb
+++ b/packages/altboot/altboot.bb
@@ -6,7 +6,7 @@ MAINTAINER = "Matthias 'CoreDump' Hentges <oe@hentges.net>"
LICENSE = "GPL"
-PR = "r9"
+PR = "r10"
SRC_URI = "file://altboot-menu \
diff --git a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS
index 33e869bbe1..88e546a059 100644
--- a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS
+++ b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS
@@ -42,6 +42,11 @@ run_module() {
nfs_mounts="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'`"
nfs_mountpoints="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $2}'`"
+ if test -z "$nfs_hosts"
+ then
+ echo -e "${C_RED}No configured NFS drives found in /etc/fstab$C_RESET"
+ exit 1
+ fi
# WLAN with DHCP needs some time to get a lease, set up the routing, etc.
echo -n "Waiting for WLAN"
diff --git a/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs
index 1949f20b48..13f98a0d41 100644
--- a/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs
+++ b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs
@@ -1,6 +1,8 @@
# !/bin/sh
M_TITLE="Copy rootfs to SD/CF"
+# Unfinished script.
+exit 0
die() {
echo "ERROR: $1" >/dev/tty0
@@ -50,7 +52,7 @@ ask_target() {
ask_format() {
if test "$ROOTFS_TARGET_FS" != ext2
then
- echo -e "\nYou are not using the ext2 filesystem on your target.\nYou now have two choices:"
+ echo -e "\nYou are not using the ext2 filesystem on your target ($ROOTFS_TARGET_FS)$.\nYou now have two choices:"
echo -e "\t[1] Reformat to ext2"
echo -e "\t[2] Use an image-file ontop of the existing filesystem"
@@ -113,7 +115,7 @@ ask_confirm() {
direct_install() {
- format_target
+ #format_target
echo -n "Creating temporary directory..."
mkdir -p /media/temp && echo ok || die "mkdir -p /media/temp failed!"
diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func
index 0598c8ce93..7afb3727f9 100644
--- a/packages/altboot/files/altboot.func
+++ b/packages/altboot/files/altboot.func
@@ -185,18 +185,26 @@ set_password() {
then
echo -e "\nAltboot is a boot-manager which allows to boot from SD,\nCF and NFS"
echo -e "\nFor security reasons altboot requires a password\nto boot into init=/bin/sh."
- echo -e "${C_RED}This is *not* your root password!\nIt is used by altboot alone!${C_RESET}"
- echo -e "${C_BLUE}\nNote:\tThe password will be echoed to the screen\n\tand it will be asked twice for confirmation.${C_RESET}"
- echo -e "\nPlease enter a new master password:\n"
+ echo -e "${C_RED}This is *not* your root password!\nIt is used by altboot alone!${C_RESET}\n"
+ #echo -e "${C_BLUE}\nNote:\tThe password will be echoed to the screen\n\tand it will be asked twice for confirmation.${C_RESET}"
+ #echo -e "\nPlease enter a new master password:\n"
while true
do
- echo -en "New password: "
+ echo -en "\nNew password: "
+
+ stty -echo
read junk1 < /dev/tty0
+ stty echo
+
if ! test -z "$junk1"
then
- echo -n "Repeat: "
+ echo -en "\nRepeat: "
+
+ stty -echo
read junk2 < /dev/tty0
+ stty echo
+ echo ""
if test "$junk1" = "$junk2"
then
diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot
index 2b7df14c86..830be08603 100644
--- a/packages/altboot/files/init.altboot
+++ b/packages/altboot/files/init.altboot
@@ -5,6 +5,7 @@
# New menu entries can be created be putting files into /etc/altboot-menu.
#
+
test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
CURRENT_ENV="`set`"
@@ -146,6 +147,7 @@ run_timer() {
mount -t proc proc /proc >/dev/null 2>&1
key_ints="`cat /proc/interrupts | grep keyboard | awk '{print $2}'`"
+ stty -echo
echo -en "\n\nPlease press any key to launch altboot." > /dev/tty1
test -z "$TIMEOUT" && TIMEOUT="3"
@@ -157,6 +159,7 @@ run_timer() {
if test "`cat /proc/interrupts | grep keyboard | awk '{print $2}'`" != "$key_ints"
then
launch_altboot=yes
+ stty echo
break
fi
echo -n "." >/dev/tty1
@@ -206,16 +209,28 @@ launch_selection() {
wait_for_input() {
while true
do
- echo -n "Please choose one of the above [$last_selection]: " </dev/tty0 > /dev/tty0 2>&1
- read junk < /dev/tty0 2>&1
-
+
+
+ # 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". And there's no goddamn way
- # to prevent it. So the next read would pick up the "any" key the user pressed
+ # 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.
- junk="`echo "$junk" | sed -n "s/.*\([0-9]\)/\1/p"`"
+
+
+ # This filters an "<ENTER>" from the user as "any key"
+ ( while :; do read x< /dev/tty0 2>&1; done; ) > /dev/null 2>&1 &
+ sleep 1; kill $!
+
+
+
+ echo -n "Please choose one of the above [$last_selection]: " </dev/tty0 > /dev/tty0 2>&1
+ read junk< /dev/tty0 2>&1
+ # This filters other chars the user may have used
+ junk="`echo "$junk" | sed -n "s/.*\([0-9]\)/\1/p"`"
if test "$junk" -lt "$cnt" -o "$junk" -eq "$cnt"
then
@@ -243,6 +258,9 @@ wait_for_input() {
# * * * * * * This is the main function * * * * * *
+# if /sbin/init is launched with a parameter, it is very likely that the user is trying to switch runlevels
+# manually by running "/sbin/init $RUN_LEVEL". If it is empty (or just contains "tty1") we assume that the kernel
+# launched init during bootup
if test -n "$*" -a "$*" != "tty1"
then
echo "altboot: Using real init [$REAL_INIT] [$*] *" >/dev/tty1
@@ -251,7 +269,7 @@ then
else
# Execute scripts in /etc/altboot.rc before doing anything else.
- # Required for special situations, like booting spitz
+ # Required in special situations, like booting spitz
RC_FILES=`ls /etc/altboot.rc | grep \.sh$`
for file in $RC_FILES