Patch for GUI in RO update 79/150279/4 accepted/tizen/4.0/unified/20171011.150236 submit/tizen_4.0/20171010.092649 submit/tizen_4.0/20171010.115426 tizen_4.0.IoT.p1_release
authorSunmin Lee <sunm.lee@samsung.com>
Fri, 15 Sep 2017 03:07:02 +0000 (12:07 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Fri, 29 Sep 2017 02:41:59 +0000 (11:41 +0900)
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 <sunm.lee@samsung.com>
packaging/initrd-fota.spec
scripts/fota-init.sh

index 2c4517b..e0feed3 100755 (executable)
@@ -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
index 1a02a72..4b65500 100755 (executable)
@@ -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