]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Remove the NBD legacy format. It wasn't actually matching Debian's nbdroot implement...
authorWarren Togami <wtogami@redhat.com>
Wed, 1 Jul 2009 19:41:26 +0000 (15:41 -0400)
committerWarren Togami <wtogami@redhat.com>
Wed, 1 Jul 2009 19:41:26 +0000 (15:41 -0400)
Talked with Debian nbdroot author and he agreed we shouldn't support their obsolete syntax in dracut.
Their root=/dev/nbd[0-9] is no longer needed.  Also their syntax was very standardized requiring
a separate boot= parameter.

modules.d/95nbd/parse-nbdroot.sh
test/TEST-40-NBD/test.sh

index 6549b675eebef30fef1a65c12aa61e259f84000b..4e0302a15fa129ff52eff2f7d854822c9834aad5 100755 (executable)
@@ -4,10 +4,6 @@
 #      root=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
 #      [root=*] netroot=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
 #
-# Legacy formats:
-#      [net]root=[nbd] nbdroot=srv,port
-#      [net]root=[nbd] nbdroot=srv:port[:fstype[:rootflags[:nbdopts]]]
-#
 # nbdopts is a comma seperated list of options to give to nbd-client
 #
 # root= takes precedence over netroot= if root=nbd[...]
@@ -32,7 +28,6 @@ netroot_to_var() {
 # This script is sourced, so root should be set. But let's be paranoid
 [ -z "$root" ] && root=$(getarg root=)
 [ -z "$netroot" ] && netroot=$(getarg netroot=)
-[ -z "$nbdroot" ] && nbdroot=$(getarg nbdroot=)
 
 # Root takes precedence over netroot
 if [ "${root%%:*}" = "nbd" ] ; then
@@ -43,26 +38,6 @@ if [ "${root%%:*}" = "nbd" ] ; then
     netroot=$root
 fi
 
-# If it's not empty or nbd we don't continue
-[ -z "$netroot" ] || [ "${netroot%%:*}" = "nbd" ] || return
-
-if [ -n "$nbdroot" ] ; then
-    [ -z "$netroot" ]  && netroot=$root
-
-    # Debian legacy style contains no ':' Converting is easy
-    [ "$nbdroot" = "${nbdroot##*:}" ] && nbdroot=${nbdroot%,*}:${nbdroot#*,}
-
-    # @deprecated
-    warn "Argument nbdroot is deprecated and might be removed in a future release. See http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information."
-
-    # Accept nbdroot argument?
-    [ -z "$netroot" ] || [ "$netroot" = "nbd" ] || \
-       die "Argument nbdroot only accepted for empty root= or [net]root=nbd"
-
-    # Override netroot with nbdroot content?
-    [ -z "$netroot" ] || [ "$netroot" = "nbd" ] && netroot=nbd:$nbdroot
-fi
-
 # If it's not nbd we don't continue
 [ "${netroot%%:*}" = "nbd" ] || return
 
index 76657416e6acc9bf8043b973e6626ff223bc8d08..26a8dc403337f1e2cd5ab8b6021ac4f2fbee59ab 100755 (executable)
@@ -120,22 +120,6 @@ test_run() {
        "root=nbd:192.168.50.1:2000:ext2:errors=panic:bs=2048" \
        ext2 errors=panic || return 1
 
-     # Check legacy parsing
-
-     client_test "NBD root=nbd nbdroot=srv:port" 52:54:00:12:34:00 \
-       "root=nbd nbdroot=192.168.50.1:2000" || return 1
-
-     # This test must fail: root=dhcp ignores nbdroot
-     client_test "NBD root=dhcp nbdroot=srv:port" 52:54:00:12:34:00 \
-       "root=dhcp nbdroot=192.168.50.1:2000" && return 1
-
-     client_test "NBD root=nbd nbdroot=srv,port" 52:54:00:12:34:00 \
-        "root=nbd nbdroot=192.168.50.1,2000" || return 1
-
-     # This test must fail: root=dhcp ignores nbdroot
-     client_test "NBD root=dhcp nbdroot=srv,port" 52:54:00:12:34:00 \
-       "root=dhcp nbdroot=192.168.50.1,2000" && return 1
-
     # DHCP root-path parsing
 
     client_test "NBD root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \