From: Harald Hoyer Date: Mon, 18 May 2009 17:31:08 +0000 (+0200) Subject: basic support for "nfs://" dhcp root_path X-Git-Tag: 0.1~249 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a86c07a0b44efcaa9fc59e82ace854eb168a68fd;p=thirdparty%2Fdracut.git basic support for "nfs://" dhcp root_path --- diff --git a/modules.d/95NFS/install b/modules.d/95NFS/install new file mode 100755 index 000000000..4ddabaa6b --- /dev/null +++ b/modules.d/95NFS/install @@ -0,0 +1,3 @@ +#!/bin/sh +inst mount.nfs +inst_hook mount 96 "$moddir/nfs-mount-root.sh" diff --git a/modules.d/95NFS/nfs-mount-root.sh b/modules.d/95NFS/nfs-mount-root.sh new file mode 100755 index 000000000..a0ffd3945 --- /dev/null +++ b/modules.d/95NFS/nfs-mount-root.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -x + +for dev in /net.*.dhcpopts; do + if [ -f "$dev" ]; then + . "$dev" + [ -n "$new_root_path" ] && nfsroot="$new_root_path" + if [ ! -s /.resume -a "$nfsroot" ]; then + if [ "${nfsroot#nfs://}" != "$nfsroot" ]; then + nfsroot="${nfsroot#nfs://}" + nfsroot="${nfsroot/\//:/}" + # + #modprobe nfs + # + # start rpc.statd ?? + mount -t nfs "$nfsroot" -o nolock "$NEWROOT" && ROOTFS_MOUNTED=yes + fi + fi + fi +done +