Blame SOURCES/0533-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch

18971c
From 58a5434f75567ecfe4a37252cedee25eb66da7d4 Mon Sep 17 00:00:00 2001
18971c
From: Alexander Tsoy <alexander@tsoy.me>
18971c
Date: Tue, 5 Jan 2016 22:11:57 +0300
18971c
Subject: [PATCH] base/dracut-lib.sh:dev_unit_name() guard against $dev
18971c
 beginning with "-"
18971c
18971c
crypt/parse-crypt.sh generate initqueue job which always call
18971c
dev_unit_name() with an argument beginning with "-". This results
18971c
in the following error:
18971c
18971c
dracut-initqueue[307]: + systemd-escape -p -cfb4aa43-2f02-4c6b-a313-60ea99288087
18971c
dracut-initqueue[307]: systemd-escape: invalid option -- 'c'
18971c
18971c
Cherry-picked from: c41df7e1
18971c
Resolves: #1306640
18971c
---
18971c
 modules.d/99base/dracut-lib.sh | 2 +-
18971c
 1 file changed, 1 insertion(+), 1 deletion(-)
18971c
18971c
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
18971c
index 7502ab66..0a587ae6 100755
18971c
--- a/modules.d/99base/dracut-lib.sh
18971c
+++ b/modules.d/99base/dracut-lib.sh
18971c
@@ -875,7 +875,7 @@ dev_unit_name()
18971c
     local dev="$1"
18971c
 
18971c
     if command -v systemd-escape >/dev/null; then
18971c
-        systemd-escape -p  "$dev"
18971c
+        systemd-escape -p -- "$dev"
18971c
         return
18971c
     fi
18971c