Blame 0069-cifs-parse-cifsroot.sh-fixed-more-root-netroot-parsi.patch

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