]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Fix legacy root=/dev/nfs nfsroot=IP:path case
authorWarren Togami <wtogami@redhat.com>
Tue, 30 Jun 2009 22:22:44 +0000 (18:22 -0400)
committerWarren Togami <wtogami@redhat.com>
Tue, 30 Jun 2009 22:22:44 +0000 (18:22 -0400)
TODO: root=/dev/nfs DHCP cases are still broken.

modules.d/95nfs/parse-nfsroot.sh
test/TEST-20-NFS/test.sh

index b5b5cd6c4186228c3061b8cb09dadd602a8e5e6a..f05fb2affba82a2ff20bd034a8713a734d1b521a 100755 (executable)
@@ -72,15 +72,6 @@ netroot_to_var() {
 [ -z "$netroot" ] && netroot=$(getarg netroot=)
 [ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=)
 
-# nfsroot= is valid only if root=/dev/nfs
-if [ -n "$nfsroot" ] ; then
-    # @deprecated
-    warn "Argument nfsroot is deprecated and might be removed in a future release. See http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information."
-    if [ "$(getarg root=)" != "/dev/nfs"  ]; then
-       die "Argument nfsroot only accepted for legacy root=/dev/nfs"
-    fi
-fi
-
 # netroot= cmdline argument must be ignored, but must be used if
 # we're inside netroot to parse dhcp root-path
 if [ -n "$netroot" ] ; then
@@ -92,7 +83,17 @@ else
     netroot=$root;
 fi 
 
-# Handle old style <server-ip>:/<path
+# LEGACY convert nfsroot= is valid only if root=/dev/nfs
+if [ -n "$nfsroot" ] ; then
+    # @deprecated
+    warn "Argument nfsroot is deprecated and might be removed in a future release. See http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information."
+    if [ "$(getarg root=)" != "/dev/nfs"  ]; then
+       die "Argument nfsroot only accepted for legacy root=/dev/nfs"
+    fi
+    netroot=nfs:$nfsroot;
+fi
+
+# LEGACY convert root=<server-ip>:/<path
 case "$netroot" in
     [0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
        netroot=nfs:$netroot;;
index 8d4019c8865041934a453131054af655a1b531d0..a161acb5da6f7649f0df48e587b0f89739bb7724 100755 (executable)
@@ -104,10 +104,10 @@ test_nfsv3() {
     client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \
        "root=dhcp" 192.168.50.1 -wsize=4096 || return 1
 
-# XXX: Temporarily not supported during refactoring
-#    client_test "NFSv3 Legacy root=/dev/nfs nfsroot=IP:path" 52:54:00:12:34:01 \
-#      "root=/dev/nfs nfsroot=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
-#
+    client_test "NFSv3 Legacy root=/dev/nfs nfsroot=IP:path" 52:54:00:12:34:01 \
+       "root=/dev/nfs nfsroot=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
+
+# XXX Fix me
 #    client_test "NFSv3 Legacy root=/dev/nfs DHCP path only" 52:54:00:12:34:00 \
 #      "root=/dev/nfs" 192.168.50.1 -wsize=4096 || return 1
 #