Patch for TW2 41/153241/4 accepted/tizen/4.0/unified/20171011.150240 submit/tizen_4.0/20171010.092649 submit/tizen_4.0/20171010.115426 tizen_4.0.IoT.p1_release tizen_4.0.m2_release
authorSunmin Lee <sunm.lee@samsung.com>
Mon, 25 Sep 2017 10:22:28 +0000 (19:22 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Tue, 10 Oct 2017 04:24:51 +0000 (13:24 +0900)
The latest codes for TW2 is alomost same with TW1.
Therefore apply differences of TW2 codes to TW1 and
make it common codes.

Change-Id: I6ed4a4f095c53294cce1bda41396be0ca75b7bf5
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
125 files changed:
CMakeLists.txt
fota_gui/CMakeLists.txt
fota_gui/fota_gr_direct_tw.c [moved from fota_gui/fota_gr_direct_tw1.c with 97% similarity]
fota_gui/fota_png.c
packaging/tota-ua.spec
res/wearable/images/tw_fota_downloading_0.png [moved from res/tw1/images/tw1_fota_downloading_0.png with 100% similarity]
res/wearable/images/tw_fota_downloading_1.png [moved from res/tw1/images/tw1_fota_downloading_1.png with 100% similarity]
res/wearable/images/tw_fota_downloading_2.png [moved from res/tw1/images/tw1_fota_downloading_2.png with 100% similarity]
res/wearable/images/tw_fota_downloading_3.png [moved from res/tw1/images/tw1_fota_downloading_3.png with 100% similarity]
res/wearable/images/tw_fota_downloading_4.png [moved from res/tw1/images/tw1_fota_downloading_4.png with 100% similarity]
res/wearable/images/tw_fota_downloading_5.png [moved from res/tw1/images/tw1_fota_downloading_5.png with 100% similarity]
res/wearable/images/tw_fota_downloading_6.png [moved from res/tw1/images/tw1_fota_downloading_6.png with 100% similarity]
res/wearable/images/tw_fota_downloading_7.png [moved from res/tw1/images/tw1_fota_downloading_7.png with 100% similarity]
res/wearable/images/tw_fota_downloading_8.png [moved from res/tw1/images/tw1_fota_downloading_8.png with 100% similarity]
res/wearable/images/tw_fota_downloading_9.png [moved from res/tw1/images/tw1_fota_downloading_9.png with 100% similarity]
res/wearable/images/tw_fota_downloading_percent.png [moved from res/tw1/images/tw1_fota_downloading_percent.png with 100% similarity]
res/wearable/images/tw_fota_progress_000.png [moved from res/tw1/images/tw1_fota_progress_bg.png with 100% similarity]
res/wearable/images/tw_fota_progress_001.png [moved from res/tw1/images/tw1_fota_progress_001.png with 100% similarity]
res/wearable/images/tw_fota_progress_002.png [moved from res/tw1/images/tw1_fota_progress_002.png with 100% similarity]
res/wearable/images/tw_fota_progress_003.png [moved from res/tw1/images/tw1_fota_progress_003.png with 100% similarity]
res/wearable/images/tw_fota_progress_004.png [moved from res/tw1/images/tw1_fota_progress_004.png with 100% similarity]
res/wearable/images/tw_fota_progress_005.png [moved from res/tw1/images/tw1_fota_progress_005.png with 100% similarity]
res/wearable/images/tw_fota_progress_006.png [moved from res/tw1/images/tw1_fota_progress_006.png with 100% similarity]
res/wearable/images/tw_fota_progress_007.png [moved from res/tw1/images/tw1_fota_progress_007.png with 100% similarity]
res/wearable/images/tw_fota_progress_008.png [moved from res/tw1/images/tw1_fota_progress_008.png with 100% similarity]
res/wearable/images/tw_fota_progress_009.png [moved from res/tw1/images/tw1_fota_progress_009.png with 100% similarity]
res/wearable/images/tw_fota_progress_010.png [moved from res/tw1/images/tw1_fota_progress_010.png with 100% similarity]
res/wearable/images/tw_fota_progress_011.png [moved from res/tw1/images/tw1_fota_progress_011.png with 100% similarity]
res/wearable/images/tw_fota_progress_012.png [moved from res/tw1/images/tw1_fota_progress_012.png with 100% similarity]
res/wearable/images/tw_fota_progress_013.png [moved from res/tw1/images/tw1_fota_progress_013.png with 100% similarity]
res/wearable/images/tw_fota_progress_014.png [moved from res/tw1/images/tw1_fota_progress_014.png with 100% similarity]
res/wearable/images/tw_fota_progress_015.png [moved from res/tw1/images/tw1_fota_progress_015.png with 100% similarity]
res/wearable/images/tw_fota_progress_016.png [moved from res/tw1/images/tw1_fota_progress_016.png with 100% similarity]
res/wearable/images/tw_fota_progress_017.png [moved from res/tw1/images/tw1_fota_progress_017.png with 100% similarity]
res/wearable/images/tw_fota_progress_018.png [moved from res/tw1/images/tw1_fota_progress_018.png with 100% similarity]
res/wearable/images/tw_fota_progress_019.png [moved from res/tw1/images/tw1_fota_progress_019.png with 100% similarity]
res/wearable/images/tw_fota_progress_020.png [moved from res/tw1/images/tw1_fota_progress_020.png with 100% similarity]
res/wearable/images/tw_fota_progress_021.png [moved from res/tw1/images/tw1_fota_progress_021.png with 100% similarity]
res/wearable/images/tw_fota_progress_022.png [moved from res/tw1/images/tw1_fota_progress_022.png with 100% similarity]
res/wearable/images/tw_fota_progress_023.png [moved from res/tw1/images/tw1_fota_progress_023.png with 100% similarity]
res/wearable/images/tw_fota_progress_024.png [moved from res/tw1/images/tw1_fota_progress_024.png with 100% similarity]
res/wearable/images/tw_fota_progress_025.png [moved from res/tw1/images/tw1_fota_progress_025.png with 100% similarity]
res/wearable/images/tw_fota_progress_026.png [moved from res/tw1/images/tw1_fota_progress_026.png with 100% similarity]
res/wearable/images/tw_fota_progress_027.png [moved from res/tw1/images/tw1_fota_progress_027.png with 100% similarity]
res/wearable/images/tw_fota_progress_028.png [moved from res/tw1/images/tw1_fota_progress_028.png with 100% similarity]
res/wearable/images/tw_fota_progress_029.png [moved from res/tw1/images/tw1_fota_progress_029.png with 100% similarity]
res/wearable/images/tw_fota_progress_030.png [moved from res/tw1/images/tw1_fota_progress_030.png with 100% similarity]
res/wearable/images/tw_fota_progress_031.png [moved from res/tw1/images/tw1_fota_progress_031.png with 100% similarity]
res/wearable/images/tw_fota_progress_032.png [moved from res/tw1/images/tw1_fota_progress_032.png with 100% similarity]
res/wearable/images/tw_fota_progress_033.png [moved from res/tw1/images/tw1_fota_progress_033.png with 100% similarity]
res/wearable/images/tw_fota_progress_034.png [moved from res/tw1/images/tw1_fota_progress_034.png with 100% similarity]
res/wearable/images/tw_fota_progress_035.png [moved from res/tw1/images/tw1_fota_progress_035.png with 100% similarity]
res/wearable/images/tw_fota_progress_036.png [moved from res/tw1/images/tw1_fota_progress_036.png with 100% similarity]
res/wearable/images/tw_fota_progress_037.png [moved from res/tw1/images/tw1_fota_progress_037.png with 100% similarity]
res/wearable/images/tw_fota_progress_038.png [moved from res/tw1/images/tw1_fota_progress_038.png with 100% similarity]
res/wearable/images/tw_fota_progress_039.png [moved from res/tw1/images/tw1_fota_progress_039.png with 100% similarity]
res/wearable/images/tw_fota_progress_040.png [moved from res/tw1/images/tw1_fota_progress_040.png with 100% similarity]
res/wearable/images/tw_fota_progress_041.png [moved from res/tw1/images/tw1_fota_progress_041.png with 100% similarity]
res/wearable/images/tw_fota_progress_042.png [moved from res/tw1/images/tw1_fota_progress_042.png with 100% similarity]
res/wearable/images/tw_fota_progress_043.png [moved from res/tw1/images/tw1_fota_progress_043.png with 100% similarity]
res/wearable/images/tw_fota_progress_044.png [moved from res/tw1/images/tw1_fota_progress_044.png with 100% similarity]
res/wearable/images/tw_fota_progress_045.png [moved from res/tw1/images/tw1_fota_progress_045.png with 100% similarity]
res/wearable/images/tw_fota_progress_046.png [moved from res/tw1/images/tw1_fota_progress_046.png with 100% similarity]
res/wearable/images/tw_fota_progress_047.png [moved from res/tw1/images/tw1_fota_progress_047.png with 100% similarity]
res/wearable/images/tw_fota_progress_048.png [moved from res/tw1/images/tw1_fota_progress_048.png with 100% similarity]
res/wearable/images/tw_fota_progress_049.png [moved from res/tw1/images/tw1_fota_progress_049.png with 100% similarity]
res/wearable/images/tw_fota_progress_050.png [moved from res/tw1/images/tw1_fota_progress_050.png with 100% similarity]
res/wearable/images/tw_fota_progress_051.png [moved from res/tw1/images/tw1_fota_progress_051.png with 100% similarity]
res/wearable/images/tw_fota_progress_052.png [moved from res/tw1/images/tw1_fota_progress_052.png with 100% similarity]
res/wearable/images/tw_fota_progress_053.png [moved from res/tw1/images/tw1_fota_progress_053.png with 100% similarity]
res/wearable/images/tw_fota_progress_054.png [moved from res/tw1/images/tw1_fota_progress_054.png with 100% similarity]
res/wearable/images/tw_fota_progress_055.png [moved from res/tw1/images/tw1_fota_progress_055.png with 100% similarity]
res/wearable/images/tw_fota_progress_056.png [moved from res/tw1/images/tw1_fota_progress_056.png with 100% similarity]
res/wearable/images/tw_fota_progress_057.png [moved from res/tw1/images/tw1_fota_progress_057.png with 100% similarity]
res/wearable/images/tw_fota_progress_058.png [moved from res/tw1/images/tw1_fota_progress_058.png with 100% similarity]
res/wearable/images/tw_fota_progress_059.png [moved from res/tw1/images/tw1_fota_progress_059.png with 100% similarity]
res/wearable/images/tw_fota_progress_060.png [moved from res/tw1/images/tw1_fota_progress_060.png with 100% similarity]
res/wearable/images/tw_fota_progress_061.png [moved from res/tw1/images/tw1_fota_progress_061.png with 100% similarity]
res/wearable/images/tw_fota_progress_062.png [moved from res/tw1/images/tw1_fota_progress_062.png with 100% similarity]
res/wearable/images/tw_fota_progress_063.png [moved from res/tw1/images/tw1_fota_progress_063.png with 100% similarity]
res/wearable/images/tw_fota_progress_064.png [moved from res/tw1/images/tw1_fota_progress_064.png with 100% similarity]
res/wearable/images/tw_fota_progress_065.png [moved from res/tw1/images/tw1_fota_progress_065.png with 100% similarity]
res/wearable/images/tw_fota_progress_066.png [moved from res/tw1/images/tw1_fota_progress_066.png with 100% similarity]
res/wearable/images/tw_fota_progress_067.png [moved from res/tw1/images/tw1_fota_progress_067.png with 100% similarity]
res/wearable/images/tw_fota_progress_068.png [moved from res/tw1/images/tw1_fota_progress_068.png with 100% similarity]
res/wearable/images/tw_fota_progress_069.png [moved from res/tw1/images/tw1_fota_progress_069.png with 100% similarity]
res/wearable/images/tw_fota_progress_070.png [moved from res/tw1/images/tw1_fota_progress_070.png with 100% similarity]
res/wearable/images/tw_fota_progress_071.png [moved from res/tw1/images/tw1_fota_progress_071.png with 100% similarity]
res/wearable/images/tw_fota_progress_072.png [moved from res/tw1/images/tw1_fota_progress_072.png with 100% similarity]
res/wearable/images/tw_fota_progress_073.png [moved from res/tw1/images/tw1_fota_progress_073.png with 100% similarity]
res/wearable/images/tw_fota_progress_074.png [moved from res/tw1/images/tw1_fota_progress_074.png with 100% similarity]
res/wearable/images/tw_fota_progress_075.png [moved from res/tw1/images/tw1_fota_progress_075.png with 100% similarity]
res/wearable/images/tw_fota_progress_076.png [moved from res/tw1/images/tw1_fota_progress_076.png with 100% similarity]
res/wearable/images/tw_fota_progress_077.png [moved from res/tw1/images/tw1_fota_progress_077.png with 100% similarity]
res/wearable/images/tw_fota_progress_078.png [moved from res/tw1/images/tw1_fota_progress_078.png with 100% similarity]
res/wearable/images/tw_fota_progress_079.png [moved from res/tw1/images/tw1_fota_progress_079.png with 100% similarity]
res/wearable/images/tw_fota_progress_080.png [moved from res/tw1/images/tw1_fota_progress_080.png with 100% similarity]
res/wearable/images/tw_fota_progress_081.png [moved from res/tw1/images/tw1_fota_progress_081.png with 100% similarity]
res/wearable/images/tw_fota_progress_082.png [moved from res/tw1/images/tw1_fota_progress_082.png with 100% similarity]
res/wearable/images/tw_fota_progress_083.png [moved from res/tw1/images/tw1_fota_progress_083.png with 100% similarity]
res/wearable/images/tw_fota_progress_084.png [moved from res/tw1/images/tw1_fota_progress_084.png with 100% similarity]
res/wearable/images/tw_fota_progress_085.png [moved from res/tw1/images/tw1_fota_progress_085.png with 100% similarity]
res/wearable/images/tw_fota_progress_086.png [moved from res/tw1/images/tw1_fota_progress_086.png with 100% similarity]
res/wearable/images/tw_fota_progress_087.png [moved from res/tw1/images/tw1_fota_progress_087.png with 100% similarity]
res/wearable/images/tw_fota_progress_088.png [moved from res/tw1/images/tw1_fota_progress_088.png with 100% similarity]
res/wearable/images/tw_fota_progress_089.png [moved from res/tw1/images/tw1_fota_progress_089.png with 100% similarity]
res/wearable/images/tw_fota_progress_090.png [moved from res/tw1/images/tw1_fota_progress_090.png with 100% similarity]
res/wearable/images/tw_fota_progress_091.png [moved from res/tw1/images/tw1_fota_progress_091.png with 100% similarity]
res/wearable/images/tw_fota_progress_092.png [moved from res/tw1/images/tw1_fota_progress_092.png with 100% similarity]
res/wearable/images/tw_fota_progress_093.png [moved from res/tw1/images/tw1_fota_progress_093.png with 100% similarity]
res/wearable/images/tw_fota_progress_094.png [moved from res/tw1/images/tw1_fota_progress_094.png with 100% similarity]
res/wearable/images/tw_fota_progress_095.png [moved from res/tw1/images/tw1_fota_progress_095.png with 100% similarity]
res/wearable/images/tw_fota_progress_096.png [moved from res/tw1/images/tw1_fota_progress_096.png with 100% similarity]
res/wearable/images/tw_fota_progress_097.png [moved from res/tw1/images/tw1_fota_progress_097.png with 100% similarity]
res/wearable/images/tw_fota_progress_098.png [moved from res/tw1/images/tw1_fota_progress_098.png with 100% similarity]
res/wearable/images/tw_fota_progress_099.png [moved from res/tw1/images/tw1_fota_progress_099.png with 100% similarity]
res/wearable/images/tw_fota_progress_100.png [moved from res/tw1/images/tw1_fota_progress_100.png with 100% similarity]
res/wearable/images/tw_fota_progress_bg.png [moved from res/tw1/images/tw1_fota_progress_000.png with 100% similarity]
res/wearable/images/tw_fota_progress_final.png [moved from res/tw1/images/tw1_fota_progress_final.png with 100% similarity]
res/wearable/images/tw_start_downloading.png [moved from res/tw1/images/tw1_start_downloading.png with 100% similarity]
scripts/tw1/41-tota-ua.list [deleted file]
scripts/wearable/41-tota-ua.list [new file with mode: 0755]
scripts/wearable/upgrade-trigger-wearable.sh [moved from scripts/tw1/upgrade-trigger-tw1.sh with 100% similarity]
src/wearable/ua.c [moved from src/tw1/ua.c with 93% similarity]
src/wearable/ua.h [moved from src/tw1/ua.h with 100% similarity]

index c86acca..d890a82 100755 (executable)
@@ -3,10 +3,10 @@ PROJECT(fota C)
 
 IF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_RPI3")
 SET(MODELDIR "rpi3")
-ELSEIF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_TW1")
+ELSEIF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_TW")
 ADD_DEFINITIONS("-DFEATURE_SUPPORT_CAPABILITY")
 ADD_DEFINITIONS("-DFEATURE_HOLD_LAST_FB")
-SET(MODELDIR "tw1")
+SET(MODELDIR "wearable")
 ELSE()
 SET(MODELDIR "rpi3")
 ENDIF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_RPI3")
index 8f4e838..119f867 100755 (executable)
@@ -37,9 +37,9 @@ FOREACH(flag ${gui_pkgs_CFLAGS})
 ENDFOREACH(flag)
 
 
-IF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_TW1")
-       SET(GUI_SRCS ${GUI_SRCS} fota_gr_direct_tw1.c)
-ENDIF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_TW1")
+IF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_TW")
+       SET(GUI_SRCS ${GUI_SRCS} fota_gr_direct_tw.c)
+ENDIF("${FOTA_PARTITION_TYPE}" STREQUAL "PART_TW")
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
similarity index 97%
rename from fota_gui/fota_gr_direct_tw1.c
rename to fota_gui/fota_gr_direct_tw.c
index b642719..b9f106d 100755 (executable)
 #endif
 #define IMG_BASE       RESDIR "/images/"
 
-#define MAIN_IMG_NAME          "tw1_start_downloading.png"
-#define MAIN_PG_IMG_NAME               "tw1_fota_progress_bg.png"
-#define PROGRESS_BAR_IMG_PREFIX        "tw1_fota_progress_"
-#define PROGRESS_NUM_PREFIX    "tw1_fota_downloading_"
-#define PERCENT_IMG_NAME               "tw1_fota_downloading_percent.png"
+#define MAIN_IMG_NAME          "tw_start_downloading.png"
+#define MAIN_PG_IMG_NAME               "tw_fota_progress_bg.png"
+#define PROGRESS_BAR_IMG_PREFIX        "tw_fota_progress_"
+#define PROGRESS_NUM_PREFIX    "tw_fota_downloading_"
+#define PERCENT_IMG_NAME               "tw_fota_downloading_percent.png"
 
 /*****************************************************************************
 ** global variables
index 7920ce5..63aa291 100755 (executable)
@@ -453,6 +453,3 @@ void release_png_res(void)
 
        png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
 }
-
-
-
index 166fb9a..8e4dd38 100755 (executable)
@@ -1,7 +1,7 @@
 Name:          tota-ua
 Summary:       fota update agent
 ExclusiveArch:         %{arm}
-Version:       0.1.9
+Version:       0.2.0
 Release:       0
 Group:         System
 License:       Apache-2.0
@@ -26,16 +26,16 @@ Fota update agent which update firmware using delta files
 %package target_rpi3
 Summary:       TOTA update agent for RPi3 target
 Provides:      %{name}-compat = %{version}-%{release}
-Conflicts:      %{name}-target_tw1
+Conflicts:      %{name}-target_wearable
 %description target_rpi3
 TOTA update agent binary targeting RPi3 target.
 
-%package target_tw1
-Summary:       TOTA update agent for TW1 target
+%package target_wearable
+Summary:       TOTA update agent for wearable targets
 Provides:      %{name}-compat = %{version}-%{release}
 Conflicts:      %{name}-target_rpi3
-%description target_tw1
-TOTA update agent binary targeting TW1 target.
+%description target_wearable
+TOTA update agent binary targeting wearable target.
 
 
 %prep
@@ -55,11 +55,11 @@ pushd build_rpi3
 make %{?jobs:-j%jobs}
 popd
 
-mkdir -p build_tw1
-pushd build_tw1
+mkdir -p build_tw
+pushd build_tw
 %cmake .. \
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-       -DFOTA_PARTITION_TYPE="PART_TW1"
+       -DFOTA_PARTITION_TYPE="PART_TW"
 
 make %{?jobs:-j%jobs}
 popd
@@ -72,16 +72,17 @@ pushd build_rpi3
 mv %{buildroot}%{_bindir}/delta.ua %{buildroot}%{_bindir}/delta.ua.rpi3
 popd
 
-pushd build_tw1
+pushd build_tw
 %make_install
-mv %{buildroot}%{_bindir}/delta.ua %{buildroot}%{_bindir}/delta.ua.tw1
-mv %{buildroot}%{_datadir}/fota/res/images %{buildroot}%{_datadir}/fota/res/images_tw1
+mv %{buildroot}%{_bindir}/delta.ua %{buildroot}%{_bindir}/delta.ua.wearable
+mv %{buildroot}%{_datadir}/fota/res/images %{buildroot}%{_datadir}/fota/res/images_wearable
 mkdir -p %{buildroot}%{_datadir}/initrd-recovery/initrd.list.d
-cp ../scripts/tw1/41-tota-ua.list %{buildroot}%{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list.tw1
+cp ../scripts/wearable/41-tota-ua.list \
+          %{buildroot}%{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list.wearable
 popd
 
 install -m 755 scripts/rpi3/upgrade-trigger-rpi3.sh %{buildroot}%{_bindir}
-install -m 755 scripts/tw1/upgrade-trigger-tw1.sh %{buildroot}%{_bindir}
+install -m 755 scripts/wearable/upgrade-trigger-wearable.sh %{buildroot}%{_bindir}
 %define fota_data_dir %{TZ_SYS_GLOBALUSER_DATA}/fota/save
 mkdir -p %{buildroot}%{fota_data_dir}
 
@@ -89,11 +90,11 @@ mkdir -p %{buildroot}%{fota_data_dir}
 mv %{_bindir}/delta.ua.rpi3 %{_bindir}/delta.ua
 mv %{_bindir}/upgrade-trigger-rpi3.sh %{_bindir}/upgrade-trigger.sh
 
-%post target_tw1
-mv %{_bindir}/delta.ua.tw1 %{_bindir}/delta.ua
-mv %{_bindir}/upgrade-trigger-tw1.sh %{_bindir}/upgrade-trigger.sh
-mv %{_datadir}/fota/res/images_tw1 %{_datadir}/fota/res/images
-mv %{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list.tw1 \
+%post target_wearable
+mv %{_bindir}/delta.ua.wearable %{_bindir}/delta.ua
+mv %{_bindir}/upgrade-trigger-wearable.sh %{_bindir}/upgrade-trigger.sh
+mv %{_datadir}/fota/res/images_wearable %{_datadir}/fota/res/images
+mv %{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list.wearable \
           %{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list
 
 %post
@@ -109,11 +110,11 @@ mv %{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list.tw1 \
 %{_bindir}/delta.ua.rpi3
 %{_bindir}/upgrade-trigger-rpi3.sh
 
-%files target_tw1
+%files target_wearable
 %defattr(-,root,root,-)
-%attr(700,-,-) %{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list.tw1
-%{_datadir}/fota/res/images_tw1
-%{_bindir}/delta.ua.tw1
+%attr(700,-,-) %{_datadir}/initrd-recovery/initrd.list.d/41-tota-ua.list.wearable
+%{_datadir}/fota/res/images_wearable
+%{_bindir}/delta.ua.wearable
 %{_bindir}/fota_gui
 %{_bindir}/fota_gui_test
-%{_bindir}/upgrade-trigger-tw1.sh
+%{_bindir}/upgrade-trigger-wearable.sh
diff --git a/scripts/tw1/41-tota-ua.list b/scripts/tw1/41-tota-ua.list
deleted file mode 100755 (executable)
index 2b0f041..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-# ---- Target contents ----------------------------------------------------- #
-VERBATIMS="
-/usr/share/fota/res/images/tw1_fota_downloading_0.png
-/usr/share/fota/res/images/tw1_fota_downloading_1.png
-/usr/share/fota/res/images/tw1_fota_downloading_2.png
-/usr/share/fota/res/images/tw1_fota_downloading_3.png
-/usr/share/fota/res/images/tw1_fota_downloading_4.png
-/usr/share/fota/res/images/tw1_fota_downloading_5.png
-/usr/share/fota/res/images/tw1_fota_downloading_6.png
-/usr/share/fota/res/images/tw1_fota_downloading_7.png
-/usr/share/fota/res/images/tw1_fota_downloading_8.png
-/usr/share/fota/res/images/tw1_fota_downloading_9.png
-/usr/share/fota/res/images/tw1_fota_downloading_percent.png
-/usr/share/fota/res/images/tw1_fota_progress_000.png
-/usr/share/fota/res/images/tw1_fota_progress_001.png
-/usr/share/fota/res/images/tw1_fota_progress_002.png
-/usr/share/fota/res/images/tw1_fota_progress_003.png
-/usr/share/fota/res/images/tw1_fota_progress_004.png
-/usr/share/fota/res/images/tw1_fota_progress_005.png
-/usr/share/fota/res/images/tw1_fota_progress_006.png
-/usr/share/fota/res/images/tw1_fota_progress_007.png
-/usr/share/fota/res/images/tw1_fota_progress_008.png
-/usr/share/fota/res/images/tw1_fota_progress_009.png
-/usr/share/fota/res/images/tw1_fota_progress_010.png
-/usr/share/fota/res/images/tw1_fota_progress_011.png
-/usr/share/fota/res/images/tw1_fota_progress_012.png
-/usr/share/fota/res/images/tw1_fota_progress_013.png
-/usr/share/fota/res/images/tw1_fota_progress_014.png
-/usr/share/fota/res/images/tw1_fota_progress_015.png
-/usr/share/fota/res/images/tw1_fota_progress_016.png
-/usr/share/fota/res/images/tw1_fota_progress_017.png
-/usr/share/fota/res/images/tw1_fota_progress_018.png
-/usr/share/fota/res/images/tw1_fota_progress_019.png
-/usr/share/fota/res/images/tw1_fota_progress_020.png
-/usr/share/fota/res/images/tw1_fota_progress_021.png
-/usr/share/fota/res/images/tw1_fota_progress_022.png
-/usr/share/fota/res/images/tw1_fota_progress_023.png
-/usr/share/fota/res/images/tw1_fota_progress_024.png
-/usr/share/fota/res/images/tw1_fota_progress_025.png
-/usr/share/fota/res/images/tw1_fota_progress_026.png
-/usr/share/fota/res/images/tw1_fota_progress_027.png
-/usr/share/fota/res/images/tw1_fota_progress_028.png
-/usr/share/fota/res/images/tw1_fota_progress_029.png
-/usr/share/fota/res/images/tw1_fota_progress_030.png
-/usr/share/fota/res/images/tw1_fota_progress_031.png
-/usr/share/fota/res/images/tw1_fota_progress_032.png
-/usr/share/fota/res/images/tw1_fota_progress_033.png
-/usr/share/fota/res/images/tw1_fota_progress_034.png
-/usr/share/fota/res/images/tw1_fota_progress_035.png
-/usr/share/fota/res/images/tw1_fota_progress_036.png
-/usr/share/fota/res/images/tw1_fota_progress_037.png
-/usr/share/fota/res/images/tw1_fota_progress_038.png
-/usr/share/fota/res/images/tw1_fota_progress_039.png
-/usr/share/fota/res/images/tw1_fota_progress_040.png
-/usr/share/fota/res/images/tw1_fota_progress_041.png
-/usr/share/fota/res/images/tw1_fota_progress_042.png
-/usr/share/fota/res/images/tw1_fota_progress_043.png
-/usr/share/fota/res/images/tw1_fota_progress_044.png
-/usr/share/fota/res/images/tw1_fota_progress_045.png
-/usr/share/fota/res/images/tw1_fota_progress_046.png
-/usr/share/fota/res/images/tw1_fota_progress_047.png
-/usr/share/fota/res/images/tw1_fota_progress_048.png
-/usr/share/fota/res/images/tw1_fota_progress_049.png
-/usr/share/fota/res/images/tw1_fota_progress_050.png
-/usr/share/fota/res/images/tw1_fota_progress_051.png
-/usr/share/fota/res/images/tw1_fota_progress_052.png
-/usr/share/fota/res/images/tw1_fota_progress_053.png
-/usr/share/fota/res/images/tw1_fota_progress_054.png
-/usr/share/fota/res/images/tw1_fota_progress_055.png
-/usr/share/fota/res/images/tw1_fota_progress_056.png
-/usr/share/fota/res/images/tw1_fota_progress_057.png
-/usr/share/fota/res/images/tw1_fota_progress_058.png
-/usr/share/fota/res/images/tw1_fota_progress_059.png
-/usr/share/fota/res/images/tw1_fota_progress_060.png
-/usr/share/fota/res/images/tw1_fota_progress_061.png
-/usr/share/fota/res/images/tw1_fota_progress_062.png
-/usr/share/fota/res/images/tw1_fota_progress_063.png
-/usr/share/fota/res/images/tw1_fota_progress_064.png
-/usr/share/fota/res/images/tw1_fota_progress_065.png
-/usr/share/fota/res/images/tw1_fota_progress_066.png
-/usr/share/fota/res/images/tw1_fota_progress_067.png
-/usr/share/fota/res/images/tw1_fota_progress_068.png
-/usr/share/fota/res/images/tw1_fota_progress_069.png
-/usr/share/fota/res/images/tw1_fota_progress_070.png
-/usr/share/fota/res/images/tw1_fota_progress_071.png
-/usr/share/fota/res/images/tw1_fota_progress_072.png
-/usr/share/fota/res/images/tw1_fota_progress_073.png
-/usr/share/fota/res/images/tw1_fota_progress_074.png
-/usr/share/fota/res/images/tw1_fota_progress_075.png
-/usr/share/fota/res/images/tw1_fota_progress_076.png
-/usr/share/fota/res/images/tw1_fota_progress_077.png
-/usr/share/fota/res/images/tw1_fota_progress_078.png
-/usr/share/fota/res/images/tw1_fota_progress_079.png
-/usr/share/fota/res/images/tw1_fota_progress_080.png
-/usr/share/fota/res/images/tw1_fota_progress_081.png
-/usr/share/fota/res/images/tw1_fota_progress_082.png
-/usr/share/fota/res/images/tw1_fota_progress_083.png
-/usr/share/fota/res/images/tw1_fota_progress_084.png
-/usr/share/fota/res/images/tw1_fota_progress_085.png
-/usr/share/fota/res/images/tw1_fota_progress_086.png
-/usr/share/fota/res/images/tw1_fota_progress_087.png
-/usr/share/fota/res/images/tw1_fota_progress_088.png
-/usr/share/fota/res/images/tw1_fota_progress_089.png
-/usr/share/fota/res/images/tw1_fota_progress_090.png
-/usr/share/fota/res/images/tw1_fota_progress_091.png
-/usr/share/fota/res/images/tw1_fota_progress_092.png
-/usr/share/fota/res/images/tw1_fota_progress_093.png
-/usr/share/fota/res/images/tw1_fota_progress_094.png
-/usr/share/fota/res/images/tw1_fota_progress_095.png
-/usr/share/fota/res/images/tw1_fota_progress_096.png
-/usr/share/fota/res/images/tw1_fota_progress_097.png
-/usr/share/fota/res/images/tw1_fota_progress_098.png
-/usr/share/fota/res/images/tw1_fota_progress_099.png
-/usr/share/fota/res/images/tw1_fota_progress_100.png
-/usr/share/fota/res/images/tw1_fota_progress_bg.png
-/usr/share/fota/res/images/tw1_fota_progress_final.png
-/usr/share/fota/res/images/tw1_start_downloading.png
-"
-
-WITHLIBS="
-/usr/bin/fota_gui
-/usr/bin/fota_gui_test
-/usr/lib/libtdm-mgr.so
-/usr/lib/tdm/libtdm-default.so
-/usr/lib/tdm/libtdm-exynos.so
-/usr/lib/bufmgr/libtbm_default.so
-"
diff --git a/scripts/wearable/41-tota-ua.list b/scripts/wearable/41-tota-ua.list
new file mode 100755 (executable)
index 0000000..8d340e7
--- /dev/null
@@ -0,0 +1,125 @@
+# ---- Target contents ----------------------------------------------------- #
+VERBATIMS="
+/usr/share/fota/res/images/tw_fota_downloading_0.png
+/usr/share/fota/res/images/tw_fota_downloading_1.png
+/usr/share/fota/res/images/tw_fota_downloading_2.png
+/usr/share/fota/res/images/tw_fota_downloading_3.png
+/usr/share/fota/res/images/tw_fota_downloading_4.png
+/usr/share/fota/res/images/tw_fota_downloading_5.png
+/usr/share/fota/res/images/tw_fota_downloading_6.png
+/usr/share/fota/res/images/tw_fota_downloading_7.png
+/usr/share/fota/res/images/tw_fota_downloading_8.png
+/usr/share/fota/res/images/tw_fota_downloading_9.png
+/usr/share/fota/res/images/tw_fota_downloading_percent.png
+/usr/share/fota/res/images/tw_fota_progress_000.png
+/usr/share/fota/res/images/tw_fota_progress_001.png
+/usr/share/fota/res/images/tw_fota_progress_002.png
+/usr/share/fota/res/images/tw_fota_progress_003.png
+/usr/share/fota/res/images/tw_fota_progress_004.png
+/usr/share/fota/res/images/tw_fota_progress_005.png
+/usr/share/fota/res/images/tw_fota_progress_006.png
+/usr/share/fota/res/images/tw_fota_progress_007.png
+/usr/share/fota/res/images/tw_fota_progress_008.png
+/usr/share/fota/res/images/tw_fota_progress_009.png
+/usr/share/fota/res/images/tw_fota_progress_010.png
+/usr/share/fota/res/images/tw_fota_progress_011.png
+/usr/share/fota/res/images/tw_fota_progress_012.png
+/usr/share/fota/res/images/tw_fota_progress_013.png
+/usr/share/fota/res/images/tw_fota_progress_014.png
+/usr/share/fota/res/images/tw_fota_progress_015.png
+/usr/share/fota/res/images/tw_fota_progress_016.png
+/usr/share/fota/res/images/tw_fota_progress_017.png
+/usr/share/fota/res/images/tw_fota_progress_018.png
+/usr/share/fota/res/images/tw_fota_progress_019.png
+/usr/share/fota/res/images/tw_fota_progress_020.png
+/usr/share/fota/res/images/tw_fota_progress_021.png
+/usr/share/fota/res/images/tw_fota_progress_022.png
+/usr/share/fota/res/images/tw_fota_progress_023.png
+/usr/share/fota/res/images/tw_fota_progress_024.png
+/usr/share/fota/res/images/tw_fota_progress_025.png
+/usr/share/fota/res/images/tw_fota_progress_026.png
+/usr/share/fota/res/images/tw_fota_progress_027.png
+/usr/share/fota/res/images/tw_fota_progress_028.png
+/usr/share/fota/res/images/tw_fota_progress_029.png
+/usr/share/fota/res/images/tw_fota_progress_030.png
+/usr/share/fota/res/images/tw_fota_progress_031.png
+/usr/share/fota/res/images/tw_fota_progress_032.png
+/usr/share/fota/res/images/tw_fota_progress_033.png
+/usr/share/fota/res/images/tw_fota_progress_034.png
+/usr/share/fota/res/images/tw_fota_progress_035.png
+/usr/share/fota/res/images/tw_fota_progress_036.png
+/usr/share/fota/res/images/tw_fota_progress_037.png
+/usr/share/fota/res/images/tw_fota_progress_038.png
+/usr/share/fota/res/images/tw_fota_progress_039.png
+/usr/share/fota/res/images/tw_fota_progress_040.png
+/usr/share/fota/res/images/tw_fota_progress_041.png
+/usr/share/fota/res/images/tw_fota_progress_042.png
+/usr/share/fota/res/images/tw_fota_progress_043.png
+/usr/share/fota/res/images/tw_fota_progress_044.png
+/usr/share/fota/res/images/tw_fota_progress_045.png
+/usr/share/fota/res/images/tw_fota_progress_046.png
+/usr/share/fota/res/images/tw_fota_progress_047.png
+/usr/share/fota/res/images/tw_fota_progress_048.png
+/usr/share/fota/res/images/tw_fota_progress_049.png
+/usr/share/fota/res/images/tw_fota_progress_050.png
+/usr/share/fota/res/images/tw_fota_progress_051.png
+/usr/share/fota/res/images/tw_fota_progress_052.png
+/usr/share/fota/res/images/tw_fota_progress_053.png
+/usr/share/fota/res/images/tw_fota_progress_054.png
+/usr/share/fota/res/images/tw_fota_progress_055.png
+/usr/share/fota/res/images/tw_fota_progress_056.png
+/usr/share/fota/res/images/tw_fota_progress_057.png
+/usr/share/fota/res/images/tw_fota_progress_058.png
+/usr/share/fota/res/images/tw_fota_progress_059.png
+/usr/share/fota/res/images/tw_fota_progress_060.png
+/usr/share/fota/res/images/tw_fota_progress_061.png
+/usr/share/fota/res/images/tw_fota_progress_062.png
+/usr/share/fota/res/images/tw_fota_progress_063.png
+/usr/share/fota/res/images/tw_fota_progress_064.png
+/usr/share/fota/res/images/tw_fota_progress_065.png
+/usr/share/fota/res/images/tw_fota_progress_066.png
+/usr/share/fota/res/images/tw_fota_progress_067.png
+/usr/share/fota/res/images/tw_fota_progress_068.png
+/usr/share/fota/res/images/tw_fota_progress_069.png
+/usr/share/fota/res/images/tw_fota_progress_070.png
+/usr/share/fota/res/images/tw_fota_progress_071.png
+/usr/share/fota/res/images/tw_fota_progress_072.png
+/usr/share/fota/res/images/tw_fota_progress_073.png
+/usr/share/fota/res/images/tw_fota_progress_074.png
+/usr/share/fota/res/images/tw_fota_progress_075.png
+/usr/share/fota/res/images/tw_fota_progress_076.png
+/usr/share/fota/res/images/tw_fota_progress_077.png
+/usr/share/fota/res/images/tw_fota_progress_078.png
+/usr/share/fota/res/images/tw_fota_progress_079.png
+/usr/share/fota/res/images/tw_fota_progress_080.png
+/usr/share/fota/res/images/tw_fota_progress_081.png
+/usr/share/fota/res/images/tw_fota_progress_082.png
+/usr/share/fota/res/images/tw_fota_progress_083.png
+/usr/share/fota/res/images/tw_fota_progress_084.png
+/usr/share/fota/res/images/tw_fota_progress_085.png
+/usr/share/fota/res/images/tw_fota_progress_086.png
+/usr/share/fota/res/images/tw_fota_progress_087.png
+/usr/share/fota/res/images/tw_fota_progress_088.png
+/usr/share/fota/res/images/tw_fota_progress_089.png
+/usr/share/fota/res/images/tw_fota_progress_090.png
+/usr/share/fota/res/images/tw_fota_progress_091.png
+/usr/share/fota/res/images/tw_fota_progress_092.png
+/usr/share/fota/res/images/tw_fota_progress_093.png
+/usr/share/fota/res/images/tw_fota_progress_094.png
+/usr/share/fota/res/images/tw_fota_progress_095.png
+/usr/share/fota/res/images/tw_fota_progress_096.png
+/usr/share/fota/res/images/tw_fota_progress_097.png
+/usr/share/fota/res/images/tw_fota_progress_098.png
+/usr/share/fota/res/images/tw_fota_progress_099.png
+/usr/share/fota/res/images/tw_fota_progress_100.png
+/usr/share/fota/res/images/tw_fota_progress_bg.png
+/usr/share/fota/res/images/tw_fota_progress_final.png
+/usr/share/fota/res/images/tw_start_downloading.png
+"
+
+WITHLIBS="
+/usr/bin/fota_gui
+/usr/bin/fota_gui_test
+/usr/lib/tdm/libtdm-default.so
+/usr/lib/bufmgr/libtbm_default.so
+"
similarity index 93%
rename from src/tw1/ua.c
rename to src/wearable/ua.c
index ed67a5e..dd5ca4a 100755 (executable)
 
 #define MAX_CFG_LEN    4096
 
-#define BOTA0_DEV      "/dev/mmcblk0p1"
-
-#define RAMDISK_PATH   "/opt/usr/data/fota"
-#define FOTA_GUI_INTERFACE             "/usr/bin/fota_gui_test"
-#define FOTA_GUI_MAIN          "/usr/bin/fota_gui"
+#define RAMDISK_PATH           "/opt/usr/data/fota"
+#define FOTA_GUI_INTERFACE     "/usr/bin/fota_gui_test"
+#define SYSTEM_LOG_DIR         "/opt/var/log"
 
 int ua_op_mode = UA_OP_MODE_FG;
 
@@ -56,6 +54,7 @@ static char delta_path[MAX_FILE_PATH];
 static char log_folder[MAX_FILE_PATH];
 static char result_folder[MAX_FILE_PATH];
 static char temp_folder[MAX_FILE_PATH];
+static char log_path[MAX_FILE_PATH];
 
 
 static ua_part_info_t def_part_info[UA_PARTI_MAX] = {
@@ -131,20 +130,6 @@ void fota_gui_update_progress(int percent)
 }
 
 /*-----------------------------------------------------------------------------
-  fota_gui_update_end
- ----------------------------------------------------------------------------*/
-void fota_gui_update_end(void)
-{
-       int ret = 0;
-       char cmd[1024];
-
-       snprintf(cmd, sizeof(cmd)-1, "%s %d", FOTA_GUI_INTERFACE, -1);
-
-       ret = _system_cmd_wait(cmd);
-       LOG("ret = %d\n", ret);
-}
-
-/*-----------------------------------------------------------------------------
   fota_gui_progress
  ----------------------------------------------------------------------------*/
 void fota_gui_progress(void * pbUserData, unsigned long uPercent)
@@ -153,9 +138,6 @@ void fota_gui_progress(void * pbUserData, unsigned long uPercent)
        ua_dataSS_t *ua_data = (ua_dataSS_t *)pbUserData;
        ua_update_data_t *ua_update_data = ua_data->update_data;
 
-       if (ua_op_mode == UA_OP_MODE_BG)
-               return;
-
        LOGL(LOG_FUNCS|LOG_GUI, "%s: ++ uPercent(%lu%%), config->weight=%lu\n", __func__,
                uPercent, (long unsigned int)ua_update_data->weight);
 
@@ -172,21 +154,13 @@ void fota_gui_progress(void * pbUserData, unsigned long uPercent)
                percent = 20 + percent * 4 / 5;
        }
 
-       fota_gui_update_progress(percent);      /* update progress bar and text */
+       if (ua_op_mode == UA_OP_MODE_FG)
+               fota_gui_update_progress(percent);      /* update progress bar and text */
 
        LOGL(LOG_FUNCS|LOG_GUI, "-- uPercent=%lu, Print Percent(%d%%)\n", uPercent, percent);
 }
 
 /*-----------------------------------------------------------------------------
-  _launch_fota_gui_process
- ----------------------------------------------------------------------------*/
-void _launch_fota_gui_process(void)
-{
-       _system_cmd_nowait(FOTA_GUI_MAIN);
-       sleep(1);
-}
-
-/*-----------------------------------------------------------------------------
   write_data_to_blkdev
   - blk_start : start sector number
   - blk_cnt : number of sectors to write
@@ -301,7 +275,6 @@ int verify_Full_Image(int part_idx)
 {
        int ret = SUCCESS;
        ua_dataSS_t ua_dataSS;
-       //int last_update_status = UP_START_NONE;
        ua_part_info_t *ua_part_info = &s_part_info[part_idx];
        ua_update_cfg_t *ua_update_cfg = &s_update_cfg[part_idx];
        ua_update_data_t *ua_update_data = &s_update_data[part_idx];
@@ -312,7 +285,6 @@ int verify_Full_Image(int part_idx)
        ua_dataSS.update_delta = ua_delta_info;
        ua_dataSS.ua_operation = UI_OP_SCOUT;
        ua_dataSS.ui_progress = fota_gui_progress;
-       //last_update_status = get_last_update_status();
 
        if (ua_update_data->ua_delta_path != NULL) {
                ret = SUCCESS;//SS_IMGVerfiyPartition(&ua_dataSS);
@@ -360,7 +332,6 @@ int update_Full_Image(int part_idx)
 int verify_Delta_FS(int part_idx)
 {
        int ret = SUCCESS;
-       //int last_update_status = UP_START_NONE;
        ua_dataSS_t ua_dataSS;
        ua_part_info_t *ua_part_info = &s_part_info[part_idx];
        ua_update_cfg_t *ua_update_cfg = &s_update_cfg[part_idx];
@@ -372,8 +343,6 @@ int verify_Delta_FS(int part_idx)
        ua_dataSS.update_delta = ua_delta_info;
        ua_dataSS.ua_operation = UI_OP_SCOUT;
        ua_dataSS.ui_progress = fota_gui_progress;
-       //last_update_status = get_last_update_status();
-       //if(last_update_status <= part_idx) // Should build nodes again, unless this partition already updated.
 
        if (ua_update_data->ua_delta_path != NULL) {
                LOG("Verifying %s \n", ua_dataSS.parti_info->ua_parti_name);
@@ -414,16 +383,10 @@ int verify_Delta_IMG(int part_idx)
 {
        int ret = SUCCESS;
        ua_dataSS_t ua_dataSS;
-       //int last_update_status = UP_START_NONE;
        ua_part_info_t *ua_part_info = &s_part_info[part_idx];
        ua_update_cfg_t *ua_update_cfg = &s_update_cfg[part_idx];
        ua_update_data_t *ua_update_data = &s_update_data[part_idx];
        ua_delta_info_t *ua_delta_info = &s_delta_info;
-#if defined(PT_FOTA_USE_LOCAL_TEMP)// NOT sure for TOTA, shd check this
-       size = check_existence(ua_update_data->ua_temp_path);
-       if (size == 0)
-               make_temp_file(ua_update_data->ua_temp_path, TEMP_SIZE);
-#endif
 
        ua_dataSS.parti_info = ua_part_info;
        ua_dataSS.update_cfg = ua_update_cfg;
@@ -431,7 +394,6 @@ int verify_Delta_IMG(int part_idx)
        ua_dataSS.update_delta = ua_delta_info;
        ua_dataSS.ua_operation = UI_OP_SCOUT;
        ua_dataSS.ui_progress = fota_gui_progress;
-       //last_update_status = get_last_update_status();
 
        if (ua_update_data->ua_delta_path != NULL)
                ret = SS_IMGVerfiyPartition(&ua_dataSS);
@@ -450,11 +412,6 @@ int update_Delta_IMG(int part_idx, unsigned long ui32Operation)
        ua_update_cfg_t *ua_update_cfg = &s_update_cfg[part_idx];
        ua_update_data_t *ua_update_data = &s_update_data[part_idx];
 
-#if defined(PT_FOTA_USE_LOCAL_TEMP)
-       size = check_existence(ua_update_data->ua_temp_path);
-       if (size == 0)
-               make_temp_file(ua_update_data->ua_temp_path, TEMP_SIZE);
-#endif
        ua_delta_info_t *ua_delta_info = &s_delta_info;
        ua_dataSS.parti_info = ua_part_info;
        ua_dataSS.update_cfg = ua_update_cfg;
@@ -511,8 +468,6 @@ int update_RecoveryDelta_IMG(int part_idx, int update_type)
        ua_dataSS.update_data->ua_temp_path = malloc(MAX_FILE_PATH);
        ua_dataSS.ua_operation = UI_OP_SCOUT_UPDATE;
        ua_dataSS.ui_progress = fota_gui_progress;
-       //ua_dataSS.update_data.ua_temp_path =
-
        if (ua_update_data->ua_delta_path != NULL && ua_dataSS.update_data->ua_temp_path) {
                snprintf(ua_dataSS.update_data->ua_temp_path, MAX_FILE_PATH, "%s/%s", RAMDISK_PATH, ua_dataSS.parti_info->ua_parti_name);
                LOG("update_RecoveryDelta_IMG() [%s] temp path [%s]\n", ua_dataSS.parti_info->ua_parti_name, ua_dataSS.update_data->ua_temp_path);
@@ -668,19 +623,6 @@ int write_num_to_file(const char *path, int num)
 }
 
 /*-----------------------------------------------------------------------------
-  remove_last_update_status
- ----------------------------------------------------------------------------*/
-static void remove_last_update_status(void)
-{
-       /*
-           remove status file.
-       */
-       int ret = -1;
-       ret = unlink(fota_status_path);
-       LOGL(LOG_DEBUG, "delete %s return %d\n", fota_status_path, ret);
-}
-
-/*-----------------------------------------------------------------------------
   get_last_update_status
  ----------------------------------------------------------------------------*/
 static int get_last_update_status(void)
@@ -737,7 +679,7 @@ static void get_time_stamp(void)
  ----------------------------------------------------------------------------*/
 int update_all()
 {
-       int i, data_count = 0, ret = FAIL;
+       int i, data_count = 0, ret = OK;
        unsigned long total_data_size = 0;
        int cause = 0;
        int item_size = 0;
@@ -817,7 +759,11 @@ int update_all()
                                else if (update_type == DELTA_FS)
                                        ret = verify_Delta_FS(part_idx);
                                else if (update_type == EXTRA)
+#ifdef SS_RECOVERYRAMDISK
                                        ret = verify_RecoveryDelta_IMG(part_idx, FULL_IMG);
+#else
+                                       ret = -1;
+#endif
                                else
                                        ret = -1;
 
@@ -861,7 +807,11 @@ int update_all()
                                else if (update_type == DELTA_FS)
                                        ret = update_Delta_FS(part_idx, ui32Operation);
                                else if (update_type == EXTRA) //TOTA
+#ifdef SS_RECOVERYRAMDISK
                                        ret = update_RecoveryDelta_IMG(part_idx, FULL_IMG);
+#else
+                                       ret = -1;
+#endif
                                else
                                        ret = -1;
 
@@ -877,6 +827,9 @@ int update_all()
                }
        }
 
+       if (part_idx == s_part_num)
+               set_last_update_status(UP_START_MAX);
+
        get_time_stamp();
        LOG("[%s] Update End ..............................................................\n", ts);
 
@@ -892,12 +845,10 @@ int update_all()
  ----------------------------------------------------------------------------*/
 void log_init(void)
 {
-       char log_file[MAX_FILE_PATH];
-
-       memset(log_file, 0x00, sizeof(log_file));
-       snprintf(log_file, sizeof(log_file), "%s%s", log_folder, LOG_FILE_PATH);
+       memset(log_path, 0x00, sizeof(log_path));
+       snprintf(log_path, sizeof(log_path), "%s%s", log_folder, LOG_FILE_PATH);
 
-       __log_out_file__ = fopen(log_file, "w");
+       __log_out_file__ = fopen(log_path, "w");
        if (__log_out_file__ == NULL) {
                perror("file open error\n");
                return;
@@ -931,6 +882,8 @@ static void print_error_cause(int error)
        switch (error) {
        case E_SS_PKG_CORRUPTED:
        case E_SS_SOURCE_CORRUPTED: /* not used */
+       case E_SS_IMGBADDELTA:
+       case E_SS_FSBADDELTA:
                LOG("Corrupted firmware update package, did not store correctly.  Detected, for example, by mismatched CRCs between actual and expected.");
                break;
        case E_SS_BAD_PARAMS:
@@ -944,8 +897,27 @@ static void print_error_cause(int error)
                LOG("Firmware Update Package is Not Acceptable");
                break;
        case E_SS_NOT_ENOUGH_RAM:
+       case E_SS_MALLOC_ERROR:
                LOG("The update fails because there isn't sufficient memory to update the device.");
                break;
+       case E_SS_FSSRCBACKUPFAILED:
+       case E_SS_IMGSRCBACKUPFAILED:
+       case E_SS_IMGRECOVERYWRITEFAILED:
+       case E_SS_IMGFLASHWRITEFAIL:
+       case E_SS_WRITE_ERROR:
+       case E_SS_FSFAILEDTOBACKUPPATCHINFO:
+       case E_SS_FSBADATTRIBUTES:
+               LOG("The update failed because writing data to the device was unsuccessful.");
+               break;
+       case E_SS_FSSRCCURRUPTED:
+       case E_SS_IMGSRCCURRUPTED:
+       case E_SS_IMGSHA_MISMATCH:
+       case E_SS_FSSHA_MISMATCH:
+       case E_SS_FSFAILEDTOPARSEDELTACNT:
+       case E_SS_FSFAILEDTOOPENPATCHINFO:
+       case E_SS_FSFAILEDTOPARSEDELTAINFO:
+               LOG("The update failed because data was corrupted during update of device.");
+               break;
        default:
                LOG("another error");
                break;
@@ -1054,7 +1026,6 @@ int fota_path_init(void)
                //sprintf(s_update_data[i].ua_temp_path, "%s/fota_temp_%s", delta_folder, s_part_info[i].ua_parti_name);
        }
 
-       snprintf(fota_result, sizeof(fota_result), "%s/%s", result_folder, "result");
        snprintf(fota_cause, sizeof(fota_cause), "%s/%s", result_folder, "cause");
        snprintf(fota_status_path, sizeof(fota_status_path), "%s/%s", result_folder, UP_STATUS_FILE);
 
@@ -1302,13 +1273,15 @@ int fota_configure_update(void)
                        field = strtok_r(NULL, "\t", &ctx2);
                }
                LOG("\n");
-if (!part_name)
-       return -1;
-               if (update_type != EXTRA
+
+               if (!part_name)
+                       return -1;
+
 #ifdef SS_RECOVERYRAMDISK
-               || (0 == strcmp(part_name, "RAMDISK2"))
+               if ((update_type != EXTRA) || (0 == strcmp(part_name, "RAMDISK2"))) {
+#else
+               if (update_type != EXTRA) {
 #endif
-) {
                        s_part_info[line_num].ua_parti_name = part_name;
                        s_part_info[line_num].ua_subject_name = subj_name;
                        s_part_info[line_num].ua_blk_name = blk_name;
@@ -1344,7 +1317,7 @@ if (!part_name)
  ----------------------------------------------------------------------------*/
 int main(int argc, char **argv)
 {
-       //char ver_str[MAX_PATH];
+       char ver_str[MAX_PATH];
        int ret = FAIL;
 
        _init_stdio();
@@ -1367,12 +1340,12 @@ int main(int argc, char **argv)
        snprintf(temp_folder, sizeof(temp_folder)-1, "%s", argv[2]);
 
        memset(log_folder, 0x00, sizeof(log_folder));
-       snprintf(log_folder, sizeof(log_folder)-1, "%s", temp_folder);
+       snprintf(log_folder, sizeof(log_folder)-1, "%s", SYSTEM_LOG_DIR);
 
        memset(result_folder, 0x00, sizeof(result_folder));
        snprintf(result_folder, sizeof(result_folder)-1, "%s", temp_folder);
 
-       _launch_fota_gui_process();
+       snprintf(fota_result, sizeof(fota_result), "%s/%s", result_folder, "result");
 
        log_init();
        fota_cfg_str_load();
@@ -1411,15 +1384,13 @@ int main(int argc, char **argv)
        LOG("<<<<<<<<<<< log_init >>>>>>>>>>>>\n");
 
        /* UPI version check */
-       /*
-       if(S_RB_SUCCESS == RB_GetUPIVersion((unsigned char*)ver_str)) {
-               LOG("<<<<<<<<< RedBend Update Agent %s >>>>>>>>>>>>\n", ver_str);
+       if (S_SS_SUCCESS == SS_GetUPIVersion((unsigned char*)ver_str)) {
+               LOG("<<<<<<<<< TOTA Update Agent %s >>>>>>>>>>>>\n", ver_str);
        } else {
-               LOG("[RB_GetUPIVersion fail] \n");
+               LOG("[SS_GetUPIVersion fail] \n");
                ret = UPI_VERSION_ERROR;
                goto Results;
        }
-*/
        /* Main Update Routine : Scout & Update */
        ret = update_all();
        LOG("[update_all ret=%d]\n", ret);
@@ -1427,7 +1398,6 @@ int main(int argc, char **argv)
  Results:
        LOG("Result=%d\n", ret);
        save_result(ret);
-       remove_last_update_status();
        //remove_temp_files(); // TOTA
 
        switch (ret) {
@@ -1453,18 +1423,16 @@ int main(int argc, char **argv)
        case UPI_BOOT_UPDATE_ERROR:
 
                sleep(1);
-               fota_gui_update_end();
                fota_path_deinit();
                log_deinit();
                _exit_stdio();
                return -1;
        case SUCCESS:
                sleep(1);
-               fota_gui_update_end();
                fota_path_deinit();
                log_deinit();
+               truncate_log_file(log_path, 0);
                _exit_stdio();
-               sleep(1);
                return 0;
        default:
                LOG("!!! Not expected ret (= %d)\n", ret);
similarity index 100%
rename from src/tw1/ua.h
rename to src/wearable/ua.h