From a86c07a0b44efcaa9fc59e82ace854eb168a68fd Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 18 May 2009 19:31:08 +0200 Subject: [PATCH] basic support for "nfs://" dhcp root_path --- modules.d/95NFS/install | 3 +++ modules.d/95NFS/nfs-mount-root.sh | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 modules.d/95NFS/install create mode 100755 modules.d/95NFS/nfs-mount-root.sh 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 + -- 2.47.3