diff options
Diffstat (limited to 'packages/slugos-init/files')
-rw-r--r-- | packages/slugos-init/files/boot/disk | 14 | ||||
-rw-r--r-- | packages/slugos-init/files/conffiles | 2 | ||||
-rw-r--r-- | packages/slugos-init/files/functions | 1 | ||||
-rw-r--r-- | packages/slugos-init/files/turnup | 23 |
4 files changed, 36 insertions, 4 deletions
diff --git a/packages/slugos-init/files/boot/disk b/packages/slugos-init/files/boot/disk index 63370ce340..34c002ba0b 100644 --- a/packages/slugos-init/files/boot/disk +++ b/packages/slugos-init/files/boot/disk @@ -24,9 +24,21 @@ then # waiting for disk if test "$sleep" -gt 0 then - echo "Waiting $sleep seconds for disk" + echo "boot: waiting $sleep seconds for disk" sleep "$sleep" fi + # Attempt to assemble the RAID if necessary + if (echo $device | grep -q "^/dev/md") + then + if test -n "$MDUUID" + then + echo "boot: assembling RAID array (UUID)" + mdadm -Acpartitions --auto=md --uuid="$MDUUID" $device + else + echo "boot: assembling RAID array (config file)" + mdadm -As --auto=md $device + fi + fi # # fire the boot echo "boot: rootfs: mount $* $device [$UUID]" diff --git a/packages/slugos-init/files/conffiles b/packages/slugos-init/files/conffiles index e1408a3227..668f7467a8 100644 --- a/packages/slugos-init/files/conffiles +++ b/packages/slugos-init/files/conffiles @@ -2,7 +2,7 @@ # Known SlugOS configuration files. These files are preserved on # a flash upgrade. Other configuration files, found from: # -# /usr/lib/ipkg/*.conffiles +# /usr/lib/opkg/*.conffiles # /etc/*.conf # # are preserved too with an operation of 'diff' if they have been diff --git a/packages/slugos-init/files/functions b/packages/slugos-init/files/functions index 5b6b40b091..253526995f 100644 --- a/packages/slugos-init/files/functions +++ b/packages/slugos-init/files/functions @@ -191,6 +191,7 @@ checkmount(){ minimaldevnodes(){ [ -c "$1/dev/console" ] || mknod -m 600 "$1/dev/console" c 5 1 || return 1 [ -c "$1/dev/null" ] || mknod -m 666 "$1/dev/null" c 1 3 || return 1 + [ -c "$1/dev/tty0" ] || mknod -m 644 "$1/dev/tty0" c 4 0 || return 1 return 0 } # diff --git a/packages/slugos-init/files/turnup b/packages/slugos-init/files/turnup index 2bbc9024ef..51b801dfea 100644 --- a/packages/slugos-init/files/turnup +++ b/packages/slugos-init/files/turnup @@ -274,7 +274,13 @@ setup_dev() { # /dev/null # syslog, and maybe other things, only work if fd 1 is valid, therefore # we must create these devices here... - makedevs --root="$1" --devtable="$2" + # (if makedevs is a symlink, it's the busybox version, different syntax) + if [ -h /sbin/makedevs ] + then + makedevs -d "$2" "$1" + else + makedevs --root="$1" --devtable="$2" + fi :>"$1"/dev/.noram return 0 } @@ -290,7 +296,13 @@ setup_bootdev() { } # NOTE: this fails silently with 0 return code(!) when a directory # does not exist yet things are created within it. - makedevs -r "$1" -D "$2" + # (if makedevs is a symlink, it's the busybox version, different syntax) + if [ -h /sbin/makedevs ] + then + makedevs -d "$2" "$1" + else + makedevs -r "$1" -D "$2" + fi } # @@ -432,6 +444,7 @@ boot_rootfs() { sleep="$3" device="$4" uuid= + mduuid= # test this first as the test does not depend on the correctness # of the other arguments @@ -452,6 +465,11 @@ boot_rootfs() { return 1 } uuid="$3" + if (echo "$device" | grep -q '^/dev/md') + then + # FIXME: should use awk to do the below extraction + mduuid=`mdadm --detail --brief "$device" | sed 's/^.*UUID=//'` + fi shift 3;; nfs) shift 2;; flash) ;; @@ -493,6 +511,7 @@ boot_rootfs() { echo 'leds beep' test "$sleep" -gt 0 && echo -n "sleep='$sleep' " test -n "$uuid" && echo -n "UUID='$uuid' " + test -n "$mduuid" && echo -n "MDUUID='$mduuid' " echo -n "exec '/boot/$type' '$device'" for opt in "$@" do |