Blame 0113-systemd-dracut-cmdline.sh-unset-UNSET-root.patch

Harald Hoyer 4f714a
From e168eeef67a6680730e86ee389a383d9c1607c25 Mon Sep 17 00:00:00 2001
Harald Hoyer 4f714a
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 4f714a
Date: Fri, 12 Aug 2016 11:24:47 +0200
Harald Hoyer 4f714a
Subject: [PATCH] systemd/dracut-cmdline.sh: unset "UNSET" $root
Harald Hoyer 4f714a
Harald Hoyer 4f714a
https://bugzilla.redhat.com/show_bug.cgi?id=1365667
Harald Hoyer 4f714a
caused by commit 9aa224cc
Harald Hoyer 4f714a
Harald Hoyer 4f714a
(cherry picked from commit fc77aca7ddbd33328066a943a4de09de34d25c4c)
Harald Hoyer 4f714a
---
Harald Hoyer 4f714a
 modules.d/98dracut-systemd/dracut-cmdline.sh | 6 +++---
Harald Hoyer 4f714a
 1 file changed, 3 insertions(+), 3 deletions(-)
Harald Hoyer 4f714a
Harald Hoyer 4f714a
diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh
Harald Hoyer 4f714a
index ccf24fb..6c6ee02 100755
Harald Hoyer 4f714a
--- a/modules.d/98dracut-systemd/dracut-cmdline.sh
Harald Hoyer 4f714a
+++ b/modules.d/98dracut-systemd/dracut-cmdline.sh
Harald Hoyer 4f714a
@@ -25,7 +25,7 @@ source_conf /etc/conf.d
Harald Hoyer 4f714a
 # between the case where it was set to the empty string and the case where it
Harald Hoyer 4f714a
 # wasn't specified at all.
Harald Hoyer 4f714a
 if ! root="$(getarg root=)"; then
Harald Hoyer 4f714a
-    root='UNSET'
Harald Hoyer 4f714a
+    root_unset='UNSET'
Harald Hoyer 4f714a
 fi
Harald Hoyer 4f714a
 
Harald Hoyer 4f714a
 rflags="$(getarg rootflags=)"
Harald Hoyer 4f714a
@@ -49,7 +49,7 @@ source_hook cmdline
Harald Hoyer 4f714a
 
Harald Hoyer 4f714a
 [ -f /lib/dracut/parse-resume.sh ] && . /lib/dracut/parse-resume.sh
Harald Hoyer 4f714a
 
Harald Hoyer 4f714a
-case "$root" in
Harald Hoyer 4f714a
+case "${root}${root_unset}" in
Harald Hoyer 4f714a
     block:LABEL=*|LABEL=*)
Harald Hoyer 4f714a
         root="${root#block:}"
Harald Hoyer 4f714a
         root="$(echo $root | sed 's,/,\\x2f,g')"
Harald Hoyer 4f714a
@@ -75,7 +75,7 @@ case "$root" in
Harald Hoyer 4f714a
         rootok=1 ;;
Harald Hoyer 4f714a
 esac
Harald Hoyer 4f714a
 
Harald Hoyer 4f714a
-[ -z "$root" ] && die "Empty root= argument"
Harald Hoyer 4f714a
+[ -z "${root}${root_unset}" ] && die "Empty root= argument"
Harald Hoyer 4f714a
 [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
Harald Hoyer 4f714a
 
Harald Hoyer 4f714a
 export root rflags fstype netroot NEWROOT