File 0601-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch of Package dracut.12460

From 33348c63393d6fca3b6070dfdf108bff7b59d53b Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Tue, 5 Jan 2016 22:11:57 +0300
Subject: [PATCH] base/dracut-lib.sh:dev_unit_name() guard against $dev
 beginning with "-"

crypt/parse-crypt.sh generate initqueue job which always call
dev_unit_name() with an argument beginning with "-". This results
in the following error:

dracut-initqueue[307]: + systemd-escape -p -cfb4aa43-2f02-4c6b-a313-60ea99288087
dracut-initqueue[307]: systemd-escape: invalid option -- 'c'
---
 modules.d/99base/dracut-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 89235b04..45ef31b6 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -874,7 +874,7 @@ dev_unit_name()
     local dev="$1"
 
     if command -v systemd-escape >/dev/null; then
-        systemd-escape -p  "$dev"
+        systemd-escape -p -- "$dev"
         return
     fi
 
-- 
2.16.4

openSUSE Build Service is sponsored by