Blame SOURCES/0530-dracut-lib.sh-dev_unit_name-use-systemd-escape-if-av.patch

1755ca
From e8ffd4b3d4d50b65704f865829e76cac7ff060cc Mon Sep 17 00:00:00 2001
1755ca
From: Harald Hoyer <harald@redhat.com>
1755ca
Date: Thu, 21 Aug 2014 16:45:12 +0200
1755ca
Subject: [PATCH] dracut-lib.sh:dev_unit_name(): use systemd-escape, if
1755ca
 available
1755ca
1755ca
Cherry-picked from: 85752f0f
1755ca
Resolves: #1306640
1755ca
---
1755ca
 modules.d/99base/dracut-lib.sh | 5 +++++
1755ca
 1 file changed, 5 insertions(+)
1755ca
1755ca
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
1755ca
index 78e01a78..e04a9b3d 100755
1755ca
--- a/modules.d/99base/dracut-lib.sh
1755ca
+++ b/modules.d/99base/dracut-lib.sh
1755ca
@@ -870,6 +870,11 @@ wait_for_mount()
1755ca
 
1755ca
 dev_unit_name()
1755ca
 {
1755ca
+    if command -v systemd-escape >/dev/null; then
1755ca
+        systemd-escape -p  "$1"
1755ca
+        return
1755ca
+    fi
1755ca
+
1755ca
     _name="${1%%/}"
1755ca
     _name="${_name##/}"
1755ca
     _name="$(str_replace "$_name" '-' '\x2d')"