]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Cleanup parse-nfsroot and NFS tests.
authorWarren Togami <wtogami@redhat.com>
Tue, 30 Jun 2009 21:48:56 +0000 (17:48 -0400)
committerWarren Togami <wtogami@redhat.com>
Tue, 30 Jun 2009 21:48:56 +0000 (17:48 -0400)
TODO: root=/dev/nfs is still broken.

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

index d68ebe1e57960a7dad67d57948fc94d3145c2aa6..b5b5cd6c4186228c3061b8cb09dadd602a8e5e6a 100755 (executable)
@@ -72,7 +72,16 @@ netroot_to_var() {
 [ -z "$netroot" ] && netroot=$(getarg netroot=)
 [ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=)
 
-# Netroot cmdline argument must be ignored, but must be used if
+# 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
     if [ "$netroot" = "$(getarg netroot=)" ] ; then
@@ -84,31 +93,12 @@ else
 fi 
 
 # Handle old style <server-ip>:/<path
-# FIXME: root= is not handled by this yet.
 case "$netroot" in
     [0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
        netroot=nfs:$netroot;;
 esac
 
-# Continue if nfs or blank prefix
-case "${netroot%%:*}" in
-    ''|nfs|nfs4|/dev/nfs);;
-    *) return;;
-esac
-
-if [ -n "$nfsroot" ] ; then
-    [ -z "$netroot" ]  && netroot=$root
-
-    # @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."
-
-    case "$netroot" in
-       /dev/nfs) netroot=${netroot:-nfs}:$nfsroot;;
-       *) die "Argument nfsroot only accepted for legacy root=/dev/nfs"
-    esac
-fi
-
-# Continue if nfs prefix
+# Continue if nfs
 case "${netroot%%:*}" in
     nfs|nfs4|/dev/nfs);;
     *) return;;
index 31621514d8969b891628d0e1c5b6d7d464469ed8..8d4019c8865041934a453131054af655a1b531d0 100755 (executable)
@@ -105,15 +105,15 @@ test_nfsv3() {
        "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 DHCP path only" 52:54:00:12:34:00 \
 #      "root=/dev/nfs" 192.168.50.1 -wsize=4096 || return 1
-
+#
 #    client_test "NFSv3 Legacy root=/dev/nfs DHCP IP:path" 52:54:00:12:34:01 \
 #      "root=/dev/nfs" 192.168.50.2 -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
-
     client_test "NFSv3 root=dhcp DHCP IP:path" 52:54:00:12:34:01 \
        "root=dhcp" 192.168.50.2 -wsize=4096 || return 1
 
@@ -129,8 +129,8 @@ test_nfsv3() {
     client_test "NFSv3 Legacy root=IP:path" 52:54:00:12:34:04 \
        "root=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
 
-    # This test must fail: root=dhcp must ignore other arguments
-    client_test "NFSv3 root=dhcp nfsroot=/nfs/client" 52:54:00:12:34:04 \
+    # This test must fail: nfsroot= requires root=/dev/nfs
+    client_test "NFSv3 Invalid root=dhcp nfsroot=/nfs/client" 52:54:00:12:34:04 \
        "root=dhcp nfsroot=/nfs/client" 192.168.50.1 -wsize=4096 && return 1
 
     client_test "NFSv3 root=dhcp DHCP path,options" \