Fix legacy root=/dev/nfs nfsroot=IP:path case
TODO: root=/dev/nfs DHCP cases are still broken.master
parent
6da2ee08a6
commit
9d4c1799fe
|
|
@ -72,15 +72,6 @@ netroot_to_var() {
|
||||||
[ -z "$netroot" ] && netroot=$(getarg netroot=)
|
[ -z "$netroot" ] && netroot=$(getarg netroot=)
|
||||||
[ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=)
|
[ -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
|
# netroot= cmdline argument must be ignored, but must be used if
|
||||||
# we're inside netroot to parse dhcp root-path
|
# we're inside netroot to parse dhcp root-path
|
||||||
if [ -n "$netroot" ] ; then
|
if [ -n "$netroot" ] ; then
|
||||||
|
|
@ -92,7 +83,17 @@ else
|
||||||
netroot=$root;
|
netroot=$root;
|
||||||
fi
|
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
|
case "$netroot" in
|
||||||
[0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
|
[0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
|
||||||
netroot=nfs:$netroot;;
|
netroot=nfs:$netroot;;
|
||||||
|
|
|
||||||
|
|
@ -104,10 +104,10 @@ test_nfsv3() {
|
||||||
client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \
|
client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \
|
||||||
"root=dhcp" 192.168.50.1 -wsize=4096 || return 1
|
"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 \
|
||||||
# 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
|
||||||
# "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 \
|
# 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
|
# "root=/dev/nfs" 192.168.50.1 -wsize=4096 || return 1
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue