aboutsummaryrefslogtreecommitdiffstats
path: root/packages/openslug-init/openslug-init-0.10/boot/disk
diff options
context:
space:
mode:
Diffstat (limited to 'packages/openslug-init/openslug-init-0.10/boot/disk')
-rw-r--r--packages/openslug-init/openslug-init-0.10/boot/disk49
1 files changed, 49 insertions, 0 deletions
diff --git a/packages/openslug-init/openslug-init-0.10/boot/disk b/packages/openslug-init/openslug-init-0.10/boot/disk
index e69de29bb2..ede33a3ee6 100644
--- a/packages/openslug-init/openslug-init-0.10/boot/disk
+++ b/packages/openslug-init/openslug-init-0.10/boot/disk
@@ -0,0 +1,49 @@
+#!/bin/sh
+# boot from the hard disk partition "$1" (which
+# must be given) using options from the rest of
+# the command line.
+#
+/sbin/leds -A '!gr'
+#
+# 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
+#
+if test -n "$1"
+then
+ device="$1"
+ shift
+ echo "boot: rootfs: mount $* $device"
+ #
+ # wait if required
+ test "$sleep" -gt 0 && sleep "$sleep"
+ #
+ # Mount read-write because before exec'ing init
+ # this script creates the '.recovery' link to
+ # detect failed boot. No file type is given to
+ if mount "$@" "$device" /mnt
+ then
+ # checkmount checks for sh, init and no
+ # .recovery plus either mnt or initrd
+ if checkmount /mnt && :>/mnt/.recovery
+ then
+ # sync to ensure .recovery is written
+ sync
+ # 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
+exec /boot/flash