1755ca
From 9dfcc5f0660b0d7cc7ca251dff940c4f2d0ddf95 Mon Sep 17 00:00:00 2001
1755ca
From: Alexander Tsoy <alexander@tsoy.me>
1755ca
Date: Tue, 24 Feb 2015 22:28:24 +0300
1755ca
Subject: [PATCH] base/dracut-lib.sh: remove bashism
1755ca
1755ca
Cherry-picked from: 13efce5d
1755ca
Resolves: #1306640
1755ca
---
1755ca
 modules.d/99base/dracut-lib.sh | 4 +++-
1755ca
 1 file changed, 3 insertions(+), 1 deletion(-)
1755ca
1755ca
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
1755ca
index 46cee5a9..7502ab66 100755
1755ca
--- a/modules.d/99base/dracut-lib.sh
1755ca
+++ b/modules.d/99base/dracut-lib.sh
1755ca
@@ -888,7 +888,9 @@ dev_unit_name()
1755ca
     dev="${dev##/}"
1755ca
     dev="$(str_replace "$dev" '\' '\x5c')"
1755ca
     dev="$(str_replace "$dev" '-' '\x2d')"
1755ca
-    dev=${dev/#\./\\x2e}
1755ca
+    if [ "${dev##.}" != "$dev" ]; then
1755ca
+        dev="\x2e${dev##.}"
1755ca
+    fi
1755ca
     dev="$(str_replace "$dev" '/' '-')"
1755ca
 
1755ca
     printf -- "%s" "$dev"