From 47b6a6712f1d41da9955165056fc8fb87973af55 Mon Sep 17 00:00:00 2001 From: Sunmin Lee Date: Fri, 15 Sep 2017 12:07:02 +0900 Subject: [PATCH] Patch for GUI in RO update Set some env values for GUI and initiate it in RO update step. This patch enables GUI feature. Change-Id: I184a9faf8c9750fbbb16952a64c00dba587e3086 Signed-off-by: Sunmin Lee --- packaging/initrd-fota.spec | 2 +- scripts/fota-init.sh | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/packaging/initrd-fota.spec b/packaging/initrd-fota.spec index 2c4517b..e0feed3 100755 --- a/packaging/initrd-fota.spec +++ b/packaging/initrd-fota.spec @@ -1,6 +1,6 @@ Name: initrd-fota Summary: package for building ramdisk-recovery.img -Version: 0.1.3 +Version: 0.1.4 Release: 0 Group: System/Utilities License: Apache-2.0 diff --git a/scripts/fota-init.sh b/scripts/fota-init.sh index 1a02a72..4b65500 100755 --- a/scripts/fota-init.sh +++ b/scripts/fota-init.sh @@ -37,6 +37,9 @@ SORT="/usr/bin/sort" SED="/usr/bin/sed" WC="/usr/bin/wc" +FOTA_GUI="/usr/bin/fota_gui" +FOTA_GUI_ENABLE= + SYSTEM_DATA_MNT=opt USER_MNT=opt/usr @@ -197,7 +200,12 @@ do_fota_update() { return 1 fi - ${UA} ${DELTA_DIR} ${FOTA_TEMP_DIR} 0 + if [ "$FOTA_GUI_ENABLE" = "1" ]; then + ${UA} ${DELTA_DIR} ${FOTA_TEMP_DIR} 0 + else + ${UA} ${DELTA_DIR} ${FOTA_TEMP_DIR} 1 + fi + if [ $? -ne 0 ]; then echo "update agent fail!!!" >> ${INT_LOG_FILE} return 1 @@ -279,6 +287,17 @@ check_for_rw_power_fail() { } #------------------------------------------------ +# check_for_fota_gui +#------------------------------------------------ +check_for_fota_gui() { + if [ -r ${FOTA_GUI} ]; then + echo "GUI Enabled" >> ${INT_LOG_FILE} + FOTA_GUI_ENABLE=1 + fi +} + + +#------------------------------------------------ # Main Routine Start #------------------------------------------------ @@ -294,8 +313,19 @@ check_for_rw_power_fail "$MOUNT" -o remount,rw ${FAKE_ROOT} init_fota_dir +check_for_fota_gui +if [ "$FOTA_GUI_ENABLE" = "1" ]; then + export XDG_RUNTIME_DIR=/run + export TBM_DISPLAY_SERVER=1 + + /usr/bin/fota_gui & + /usr/bin/sleep 2 +fi do_fota_update fota_result=$? +if [ "$FOTA_GUI_ENABLE" = "1" ]; then + /usr/bin/fota_gui_test -1 +fi umount_partitions if [ "$fota_result" = "0" ]; then -- 2.7.4