mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-28 10:55:18 +03:00
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.
This commit is contained in:
parent
22a27a5023
commit
f910f00627
@ -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
|
||||
|
||||
|
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user