summaryrefslogtreecommitdiff
path: root/packages/altboot/files/init.altboot
diff options
context:
space:
mode:
Diffstat (limited to 'packages/altboot/files/init.altboot')
-rw-r--r--packages/altboot/files/init.altboot27
1 files changed, 20 insertions, 7 deletions
diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot
index 850912f20c..22f3e86e83 100644
--- a/packages/altboot/files/init.altboot
+++ b/packages/altboot/files/init.altboot
@@ -8,7 +8,7 @@
test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
CURRENT_ENV="`set`"
-VERSION="0.0.4"
+VERSION="DEVELOPER SNAPSHOT"
# Set some defaults in case altboot.cfg is missing
REAL_INIT="/sbin/init.sysvinit"
@@ -183,6 +183,13 @@ run_timer() {
echo -n "." >/dev/tty1
let cnt=$cnt+1
done
+
+ if test "$launch_altboot" != "yes"
+ then
+ AUTOBOOT=yes
+ else
+ rm -f /etc/.altboot*.last
+ fi
else
launch_altboot=yes
fi
@@ -236,9 +243,13 @@ wait_for_input() {
# above to launch the altboot menu.
- # 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 $!
+ # Bash throws an ugly error on kill
+ if ! (readlink /bin/sh | grep -q bash)
+ then
+ # 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 $! >/dev/null 2>&1
+ fi
@@ -272,10 +283,12 @@ wait_for_input() {
}
# * * * * * * This is the main function * * * * * *
-
-if test "`runlevel`" != "unknown" -a "$1" != "-force"
+# Note: this is positivly ugly. If someone knows a better way to detect wheter
+# we are already booted into a runlevel _without_ reading /var and / or using `runlevel`
+# PLEASE let me know.
+if test -f /proc/cmdline -a "`ps ax|wc -l|tr -d " "`" -gt 30 -a "$1" != "-force"
then
- echo "altboot: Using real init [$REAL_INIT] [$*] *" >/dev/tty1
+ echo "altboot: Using real init [$REAL_INIT] [$*] [`ps ax|wc -l|tr -d " "`] *" >/dev/tty1
exec $REAL_INIT $*
# exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
exit 0