Harald Hoyer b3dfe7
From 11b3d60f5c20136530c3afe78d9a1a1160e021f2 Mon Sep 17 00:00:00 2001
Harald Hoyer b3dfe7
From: Harald Hoyer <harald@hoyer.xyz>
Harald Hoyer b3dfe7
Date: Mon, 6 Nov 2017 09:55:54 +0100
Harald Hoyer b3dfe7
Subject: [PATCH] Merge pull request #303 from FGrose/bootmsg
Harald Hoyer b3dfe7
Harald Hoyer b3dfe7
dmsquash-live-root: Replace incompatible shell syntax.
Harald Hoyer b3dfe7
---
Harald Hoyer b3dfe7
 modules.d/90dmsquash-live/dmsquash-live-root.sh | 29 +++++++++++--------------
Harald Hoyer b3dfe7
 1 file changed, 13 insertions(+), 16 deletions(-)
Harald Hoyer b3dfe7
Harald Hoyer b3dfe7
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
Harald Hoyer b3dfe7
index 723d7f01..1458329c 100755
Harald Hoyer b3dfe7
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
Harald Hoyer b3dfe7
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
Harald Hoyer b3dfe7
@@ -178,29 +178,26 @@ do_live_overlay() {
Harald Hoyer b3dfe7
             warn "Using temporary overlay."
Harald Hoyer b3dfe7
         elif [ -n "$devspec" -a -n "$pathspec" ]; then
Harald Hoyer b3dfe7
             [ -z "$m" ] &&
Harald Hoyer b3dfe7
-                m='  Unable to find a persistent overlay; using a temporary one.'
Harald Hoyer b3dfe7
-            m=($'\n' "$m" $'\n'
Harald Hoyer b3dfe7
-               '     All root filesystem changes will be lost on shutdown.'
Harald Hoyer b3dfe7
-               $'\n' '        Press any key to continue')
Harald Hoyer b3dfe7
-            echo -e "\n\n\n${m[*]}\n\n\n" > /dev/kmsg
Harald Hoyer b3dfe7
+                m='   Unable to find a persistent overlay; using a temporary one.'
Harald Hoyer b3dfe7
+            m="$m"$'\n      All root filesystem changes will be lost on shutdown.'
Harald Hoyer b3dfe7
+            m="$m"$'\n         Press [Enter] to continue.'
Harald Hoyer b3dfe7
+            echo -e "\n\n\n\n${m}\n\n\n" > /dev/kmsg
Harald Hoyer b3dfe7
             if [ -n "$DRACUT_SYSTEMD" ]; then
Harald Hoyer b3dfe7
-                if plymouth --ping ; then
Harald Hoyer b3dfe7
+                if type plymouth >/dev/null 2>&1 && plymouth --ping ; then
Harald Hoyer b3dfe7
                     if getargbool 0 rhgb || getargbool 0 splash ; then
Harald Hoyer b3dfe7
-                        m[0]='>>>'$'\n''>>>'$'\n''>>>'$'\n\n'
Harald Hoyer b3dfe7
-                        m[5]=$'\n''<<<'$'\n''<<<'$'\n''<<<'
Harald Hoyer b3dfe7
-                        plymouth display-message --text="${m[*]}"
Harald Hoyer b3dfe7
+                        m='>>>'$'\n''>>>'$'\n''>>>'$'\n\n\n'"$m"
Harald Hoyer b3dfe7
+                        m="${m%n.*}"$'n.\n\n\n''<<<'$'\n''<<<'$'\n''<<<'
Harald Hoyer b3dfe7
+                        plymouth display-message --text="${m}"
Harald Hoyer b3dfe7
                     else
Harald Hoyer b3dfe7
-                        plymouth ask-question --prompt="${m[*]}" --command=true
Harald Hoyer b3dfe7
+                        plymouth ask-question --prompt="${m}" --command=true
Harald Hoyer b3dfe7
                     fi
Harald Hoyer b3dfe7
                 else
Harald Hoyer b3dfe7
-                    m[0]='>>>'
Harald Hoyer b3dfe7
-                    m[5]='<<<'
Harald Hoyer b3dfe7
-                    unset -v m[2] m[4]
Harald Hoyer b3dfe7
-                    systemd-ask-password --timeout=0 "${m[*]}"
Harald Hoyer b3dfe7
+                    m=">>>${m//.[[:space:]]/.}  <<<"
Harald Hoyer b3dfe7
+                    systemd-ask-password --timeout=0 "${m}"
Harald Hoyer b3dfe7
                 fi
Harald Hoyer b3dfe7
             else
Harald Hoyer b3dfe7
-                plymouth --ping && plymouth --quit
Harald Hoyer b3dfe7
-                read -s -r -p $'\n\n'"${m[*]}:" -n 1 reply
Harald Hoyer b3dfe7
+                type plymouth >/dev/null 2>&1 && plymouth --ping && plymouth --quit
Harald Hoyer b3dfe7
+                read -s -r -p $'\n\n'"${m}" -n 1 reply
Harald Hoyer b3dfe7
             fi
Harald Hoyer b3dfe7
         fi
Harald Hoyer b3dfe7
         if [ -n "$overlayfs" ]; then
Harald Hoyer b3dfe7