If there is no bootmode init file, init fails to execute the file
and pid 1 exit with error causes kernel panic. Handle non-existing
bootmode file by rebooting.
Change-Id: I7b233a7ae57a8be98693cf02b52315cf1bca3bde
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
do_reboot
fi
echo "BOOTMODE is ${BOOT_MODE}"
-exec "/sbin/${BOOT_MODE}-init"
+
+if [ -f /sbin/${BOOT_MODE}-init ]; then
+ exec "/sbin/${BOOT_MODE}-init"
+else
+ echo "no ${BOOT_MODE}-init!!"
+ echo "Do reboot!!"
+ do_reboot
+fi