Browse Source

init: implemented support for rootdelay=n (in seconds)

0.2-maint
Alejandro Mery 15 years ago
parent
commit
21a695cdd7
3 changed files with 24 additions and 7 deletions
  1. +3
    -1
      initramfs/etc_rc.d_rc.sysinit.sh
  2. +20
    -5
      initramfs/etc_rc.d_rc.trymount.sh
  3. +1
    -1
      initramfs/init.sh

+ 3
- 1
initramfs/etc_rc.d_rc.sysinit.sh

@ -32,12 +32,13 @@ status
# Parse command line
init=
root=
rootdelay=
root_mode=
for x in $(cat /proc/cmdline | tr -d ";\"'"); do
case "$x" in
ro|rw) root_mode=$x ;;
root=*|init=*)
root=*|init=*|rootdelay=*)
eval "$x" ;;
esac
done
@ -60,6 +61,7 @@ esac
cat > /etc/conf/idunn <<EOT
rootfs="/rootfs"
root="$root"
rootdelay="${rootdelay:-0}"
root_method="$root_method"
root_mode="${root_mode:-ro}"
init="${init:-/sbin/init}"

+ 20
- 5
initramfs/etc_rc.d_rc.trymount.sh

@ -15,11 +15,20 @@
. /etc/conf/idunn
if [ "x$1" = "x-v" ]; then
verbose=yes
else
verbose=
fi
verbose=
delayed=
while [ $# -gt 0 ]; do
case "$1" in
-v) verbose=yes ;;
delayed)
delayed=yes ;;
*)
echo "trymount: $1: option not understood." 1>&2
;;
esac
shift
done
if grep -q "^[^ ]* $rootfs " /proc/mounts; then
# alredy mounted
@ -31,6 +40,12 @@ elif [ -n "$root" ]; then
root_tag=
root_options="$root_mode"
if [ "$delayed" = yes -a "$rootdelay" != "0" ]; then
title "Waiting ${rootdelay}s before trying to mount $rootfs."
check sleep "$rootdelay"
status
fi
case "$root_method" in
nfs)
root_type="$root_method"

+ 1
- 1
initramfs/init.sh

@ -43,7 +43,7 @@ unset x
# start the world
(
/etc/rc.d/rc.sysinit
/etc/rc.d/rc.trymount
/etc/rc.d/rc.trymount delayed
) 2>&1 | tee -a $LOG
# attach a console

Loading…
Cancel
Save