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

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