]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
basic support for "nfs://" dhcp root_path
authorHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 17:31:08 +0000 (19:31 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 17:31:08 +0000 (19:31 +0200)
modules.d/95NFS/install [new file with mode: 0755]
modules.d/95NFS/nfs-mount-root.sh [new file with mode: 0755]

diff --git a/modules.d/95NFS/install b/modules.d/95NFS/install
new file mode 100755 (executable)
index 0000000..4ddabaa
--- /dev/null
@@ -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 (executable)
index 0000000..a0ffd39
--- /dev/null
@@ -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
+