# 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]"
# /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
}
}
# 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
}
#
sleep="$3"
device="$4"
uuid=
+ mduuid=
# test this first as the test does not depend on the correctness
# of the other arguments
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) ;;
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