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