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 61b2062..7a231ae 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 65f3772..bdf5338 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 348016d..a169dbe 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 FNAME="../res/system-recovery/images/tizen-anim.png"
 SRCIMG="./tizen-anim?src.png"
index b6f8e0d..5c194cb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 FNAME="../res/system-recovery/images/menu-title.png"
 TEXT="Tizen system recovery"