Fix bashisms in scripts 86/155486/2
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 12 Oct 2017 15:00:31 +0000 (17:00 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 13 Oct 2017 08:35:46 +0000 (10:35 +0200)
This commit fixes bashisms in the script itself to ensure these
can be correctly executed under any POSIX compliant Bourne Shell
(eg. dash(1))

Change-Id: I3efb4b91483a3948a9a3270c9783461bb5d53f92

src/initrd-recovery/init
src/system-recovery/recovery-init.in
src/system-recovery/res-util/make-anim.sh
src/system-recovery/res-util/make-menu-title.sh

index 61b2062f5bbdb748f9d0d55013a29283ad4b0c1e..7a231ae6fb25f8ad41ee111f867641f1904222ed 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 FAKE_ROOT=/system
 FAKE_ROOT_RO=/system-ro
@@ -58,7 +58,7 @@ cd /
 
 BOOT_MODE=$("$CAT" /proc/cmdline | "$TR" ' ' \\n | "$GREP" bootmode | "$CUT" -d= -f2)
 
-if [ "z$BOOT_MODE" == "z" ]; then
+if [ "z$BOOT_MODE" = "z" ]; then
     echo "BOOT_MODE was NOT defined!!"
     echo "Do reboot!!"
     do_reboot
index 65f3772b122e3150d4cc2db80c28240122ae0d9d..bdf53387f0667d7a38f06e45c1c970e163082591 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 SYSTEM_RECOVERY_GUI="@SYSTEM_RECOVERY_LIBEXEC_DIR@/system-recovery.gui"
 SYSTEM_RECOVERY_NON_GUI="@SYSTEM_RECOVERY_LIBEXEC_DIR@/system-recovery.non_gui"
@@ -71,7 +71,7 @@ echo "Starting system recovery."
 mount_partitions
 
 # For debugging - It should be deleted on Release
-/sbin/agetty -l /bin/bash -n --keep-baud 115200,38400,9600 ttyS1 linux &
+/sbin/agetty -l /bin/sh -n --keep-baud 115200,38400,9600 ttyS1 linux &
 
 [ -x "${SYSTEM_RECOVERY_GUI}" ] && "${SYSTEM_RECOVERY_GUI}" || "${SYSTEM_RECOVERY_NON_GUI}"
 
index 348016dcf2e2db29699bdf837beafa4bafd18697..a169dbe311185996d4621087b3a7913c6cb5aa7b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 FNAME="../res/system-recovery/images/tizen-anim.png"
 SRCIMG="./tizen-anim?src.png"
index b6f8e0d847f0837bdb4133ffa093557ab14bf524..5c194cb134918a68d245d615c71f848bfd8062b3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 FNAME="../res/system-recovery/images/menu-title.png"
 TEXT="Tizen system recovery"