From: Warren Togami Date: Wed, 1 Jul 2009 19:41:26 +0000 (-0400) Subject: Remove the NBD legacy format. It wasn't actually matching Debian's nbdroot implement... X-Git-Tag: 0.3~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f910f0062787c7b66c61b6e46df51ad848b2132e;p=thirdparty%2Fdracut.git Remove the NBD legacy format. It wasn't actually matching Debian's nbdroot implementation. 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. --- diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh index 6549b675e..4e0302a15 100755 --- a/modules.d/95nbd/parse-nbdroot.sh +++ b/modules.d/95nbd/parse-nbdroot.sh @@ -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 diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 76657416e..26a8dc403 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -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 \