diff options
author | maximilian attems <maks@debian.org> | 2006-08-25 17:04:33 +0200 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2006-08-25 17:04:33 +0200 |
commit | 45989c9f37db0ef23e984ea559f2da784a028366 (patch) | |
tree | 7412695c5971e3bf874ee972e06032edb038de39 /scripts/nfs | |
parent | fabe918dee7da26d177d67d4aa8fe3fd6e83e513 (diff) | |
download | initramfs-tools-45989c9f37db0ef23e984ea559f2da784a028366.tar.gz initramfs-tools-45989c9f37db0ef23e984ea559f2da784a028366.zip |
- fix bashism
- rename mdadm.conf in mdrun.conf
- retry nfsmount
- harden init
- fix lvm boot script prereqs
Diffstat (limited to 'scripts/nfs')
-rw-r--r-- | scripts/nfs | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/scripts/nfs b/scripts/nfs index 844db70..f42ed22 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -2,17 +2,9 @@ # FIXME This needs error checking -# Paramter: Where the root should be mounted -mountroot () +# parse nfs bootargs + launch ipconfig and nfsmount +do_nfsmount() { - [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" - run_scripts /scripts/nfs-top - [ "$quiet" != "y" ] && log_end_msg - - modprobe -q nfs - # For DHCP - modprobe -q af_packet - # support ip options see linux sources Documentation/nfsroot.txt case ${IPOPTS} in none|off) @@ -40,7 +32,7 @@ mountroot () ;; esac - # FIXME: who writes that? + # FIXME: source ipconfig output - might overwrite aboves . /tmp/net-${DEVICE}.conf # get nfs root from dhcp @@ -78,9 +70,38 @@ mountroot () fi nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} +} + +# NFS root mounting +mountroot() +{ + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" + run_scripts /scripts/nfs-top + [ "$quiet" != "y" ] && log_end_msg + + modprobe -q nfs + # For DHCP + modprobe -q af_packet + + # Default delay is around 180s + # FIXME: add usplash info + if [ -z "${ROOTDELAY}" ]; then + delay=180 + else + delay=${ROOTDELAY} + fi + + # loop until nfsmount succeds + # FIXME: another place of init bin hardcoding + while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}/sbin/init ]; do + [ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount" + do_nfsmount + # FIXME: ipconfig loops every min at least - better param?? + delay=$(( ${delay} - 1 )) + [ "$quiet" != "y" ] && log_end_msg + done [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom [ "$quiet" != "y" ] && log_end_msg - } |