]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
cifs/parse-cifsroot.sh: fixed more root/netroot parsing
authorHarald Hoyer <harald@redhat.com>
Fri, 27 Jul 2012 10:40:55 +0000 (12:40 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 27 Jul 2012 10:40:55 +0000 (12:40 +0200)
modules.d/95cifs/parse-cifsroot.sh

index de7637f8b3976e260acdea3c26b3b730a0fb2d9b..f376b166bc71ea98910fd65d2311a75f42aa50fe 100755 (executable)
@@ -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