From a7473ef379b03c79f40965fb4e332690bd346604 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 27 Jul 2012 12:40:55 +0200 Subject: [PATCH] cifs/parse-cifsroot.sh: fixed more root/netroot parsing --- modules.d/95cifs/parse-cifsroot.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/modules.d/95cifs/parse-cifsroot.sh b/modules.d/95cifs/parse-cifsroot.sh index de7637f..f376b16 100755 --- a/modules.d/95cifs/parse-cifsroot.sh +++ b/modules.d/95cifs/parse-cifsroot.sh @@ -21,22 +21,22 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh [ -z "$root" ] && root=$(getarg root=) [ -z "$netroot" ] && netroot=$(getarg netroot=) -# 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 - warn "Ignoring netroot argument for CIFS" - netroot=$root +# Root takes precedence over netroot +if [ "${root%%:*}" = "cifs" ] ; then + + # Don't continue if root is ok + [ -n "$rootok" ] && return + + if [ -n "$netroot" ] ; then + warn "root takes precedence over netroot. Ignoring netroot" + fi -else - netroot=$root; + netroot=$root + unset root fi -# Continue if cifs -case "${netroot%%:*}" in - cifs);; - *) return;; -esac +# If it's not cifs we don't continue +[ "${netroot%%:*}" = "cifs" ] || return # Check required arguments cifs_to_var $netroot