]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
remove bashism in various boot scripts
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Sun, 6 Jan 2019 04:48:02 +0000 (11:48 +0700)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 7 Jan 2019 11:01:55 +0000 (12:01 +0100)
When using dash as initramfs shell, the boot process is broken.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
modules.d/90crypt/crypt-lib.sh
modules.d/90crypt/parse-keydev.sh
modules.d/91crypt-gpg/crypt-gpg-lib.sh
modules.d/95dcssblk/parse-dcssblk.sh
modules.d/98syslog/rsyslogd-start.sh

index bbf485e0c94a0a7d316a4c157d66e40709b31a59..688ea2514b2d721d737927d1054fac4109d98266 100755 (executable)
@@ -191,7 +191,7 @@ readkey() {
     local device="$3"
 
     # No mounting needed if the keyfile resides inside the initrd
-    if [ "/" == "$keydev" ]; then
+    if [ "/" = "$keydev" ]; then
         local mntp=/
     else
         # This creates a unique single mountpoint for *, or several for explicitly
index a45b2fb587910de99b84ac0605115ecdbe909f8d..04813414c991bfc368c334a3356f17cff03f9aab 100755 (executable)
@@ -18,7 +18,7 @@ if getargbool 1 rd.luks -n rd_NO_LUKS && \
         fi
 
         # A keydev of '/' is treated as the initrd itself
-        if [ "/" == "$keydev" ]; then
+        if [ "/" = "$keydev" ]; then
             [ -z "$luksdev" ] && luksdev='*'
             echo "$luksdev:$keydev:$keypath" >> /tmp/luks.keys
             continue
index b85ed2b87b22395ac0ec51b73ce9b2f7a49afb1b..c051b4302a23df2792890b0caa056fe0265632ce 100755 (executable)
@@ -53,7 +53,7 @@ gpg_decrypt() {
         --tries 3 --tty-echo-off
 
     # Clean up the smartcard gpg-agent
-    if [ "${useSmartcard}" == "1" ]; then
+    if [ "${useSmartcard}" = "1" ]; then
         GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null killagent /bye
     fi
 
index 8f17440873136926db6975a0ab37b8ad3bae262d..27ac1d8d416417afd0a52108acfc1912a1969c19 100644 (file)
@@ -2,7 +2,7 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 dcssblk_arg=$(getarg rd.dcssblk=)
-if [ $? == 0 ];then
+if [ $? = 0 ];then
        info "Loading dcssblk segments=$dcssblk_arg"
        modprobe dcssblk segments=$dcssblk_arg
 fi
index c64f212155566c29b15a2b90556ac3f2e8ad497c..86ad50ea2fd05d11a94aa63265be430e211a827f 100755 (executable)
@@ -38,7 +38,7 @@ rsyslog_config() {
 [ -f /tmp/syslog.conf ] && read conf < /tmp/syslog.conf
 [ -z "$conf" ] && conf="/etc/rsyslog.conf" && echo "$conf" > /tmp/syslog.conf
 
-if [ $type == "rsyslogd" ]; then
+if [ $type = "rsyslogd" ]; then
     template=/etc/templates/rsyslog.conf
     if [ -n "$server" ]; then
         rsyslog_config "$server" "$template" "$filters" > $conf