support normal nfs root definition syntax
authorHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 17:55:58 +0000 (19:55 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 17:55:58 +0000 (19:55 +0200)
modules.d/95NFS/nfs-mount-root.sh
test/make-server-root

index a0ffd39..a041207 100755 (executable)
@@ -1,21 +1,29 @@
 #!/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
+if [ "$root" = "dhcp" ]; then 
+    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/\//:/}"
+               fi
            fi
        fi
-    fi
-done
+    done
+fi
+
+if [ "${root#/dev/}" = "$root" -a "${root/:\///}" != "$root" ]; then
+    nfsroot="$root"
+fi
+
 
+if [ -n "$nfsroot" ]; then
+    #
+    # modprobe nfs 
+    #
+    # start rpc.statd ??
+    mount -t nfs "$nfsroot" -o nolock "$NEWROOT" && ROOTFS_MOUNTED=yes
+fi
index e4fdda7..22ab83a 100755 (executable)
@@ -30,7 +30,7 @@ EOF
 expand-hosts
 domain=test.net
 dhcp-range=192.168.1.100,192.168.1.150,168h
-dhcp-option=17,"nfs://192.168.1.1/mnt/root"
+dhcp-option=17,"192.168.1.1:/mnt/root"
 EOF
     )
     inst /etc/nsswitch.conf /etc/nsswitch.conf