Commit
b8e88cebfe ("Install system-recovery binary for both gui
& non-gui platforms") enabled installing system-recovery binary
for headless profile (in addition to headed). In result one
recovery-init script was installed, which included build-time
generated check if GUI is enabled or not.
This commit changes gui/non-gui checking to happen at run time
- based on what is actually available on initrd-recovery image.
GUI variant is preferred, and it will be selected by default -
however, if it's not available non-gui will be tried instead.
Change-Id: I4d07a9e0979c2cff980fa21f909aaba9aa828d2f
#!/bin/bash
-[ "@RECOVERY_GUI@" = "GUI" ] && suffix=".gui" || suffix=".non_gui"
-SYSTEM_RECOVERY="@SYSTEM_RECOVERY_LIBEXEC_DIR@/system-recovery${suffix}"
+SYSTEM_RECOVERY_GUI="@SYSTEM_RECOVERY_LIBEXEC_DIR@/system-recovery.gui"
+SYSTEM_RECOVERY_NON_GUI="@SYSTEM_RECOVERY_LIBEXEC_DIR@/system-recovery.non_gui"
FAKE_ROOT=/system
GREP="/usr/bin/grep"
# For debugging - It should be deleted on Release
/sbin/agetty -l /bin/bash -n --keep-baud 115200,38400,9600 ttyS1 linux &
-"${SYSTEM_RECOVERY}"
+[ -x "${SYSTEM_RECOVERY_GUI}" ] && "${SYSTEM_RECOVERY_GUI}" || "${SYSTEM_RECOVERY_NON_GUI}"
umount_partitions
do_reboot