No verification of EXTRA (RAMDISK2) as FULL_IMG 97/147097/1
authorSunmin Lee <sunm.lee@samsung.com>
Fri, 1 Sep 2017 02:39:28 +0000 (11:39 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Fri, 1 Sep 2017 02:39:28 +0000 (11:39 +0900)
If RAMDISK2 (EXTRA) is updated as FULL_IMG,
IMG verification is not necessary.

Change-Id: I6a0cacfdf046a08ab45801f6393f6af5f142a02c
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
src/rpi3/ua.c
src/tw1/ua.c

index a79619cfae95638f755df59ea20bcb04f5ee69bf..f04fd4dc446a94a98bef61b407f80169bc8b8e06 100644 (file)
@@ -467,7 +467,7 @@ int update_Delta_IMG(int part_idx, unsigned long ui32Operation)
 //RAMDISK.delta for recovery FS.
 #ifdef SS_RECOVERYRAMDISK
 
-int verify_RecoveryDelta_IMG(int part_idx)
+int verify_RecoveryDelta_IMG(int part_idx, int update_type)
 {
        int ret = SUCCESS;
        ua_dataSS_t ua_dataSS;
@@ -481,11 +481,16 @@ int verify_RecoveryDelta_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;
-
-       if (ua_update_data->ua_delta_path != NULL) {
-               ret = SS_IMGVerfiyPartition(&ua_dataSS);
+       if (update_type == FULL_IMG) {
+               if (ua_update_data->ua_delta_path != NULL){
+                       ret = SUCCESS;
+                       fota_gui_progress(&ua_dataSS, 100);
                }
-
+       } else if (update_type == DELTA_IMG) {
+               if (ua_update_data->ua_delta_path != NULL) {
+                       ret = SS_IMGVerfiyPartition(&ua_dataSS);
+               }
+       }
        return ret;
 }
 
@@ -817,7 +822,7 @@ int update_all()
                                else if (update_type == DELTA_FS)
                                        ret = verify_Delta_FS(part_idx);
                                else if (update_type == EXTRA)
-                                       ret = verify_RecoveryDelta_IMG(part_idx);
+                                       ret = verify_RecoveryDelta_IMG(part_idx, FULL_IMG);
                                else
                                        ret = -1;
 
@@ -862,7 +867,7 @@ int update_all()
                                else if (update_type == DELTA_FS)
                                        ret = update_Delta_FS(part_idx, ui32Operation);
                                else if (update_type == EXTRA) //TOTA
-                                       ret = update_RecoveryDelta_IMG(part_idx, DELTA_IMG);
+                                       ret = update_RecoveryDelta_IMG(part_idx, FULL_IMG);
                                else
                                        ret = -1;
 
index b0bede88bfd549064c830dc14a6b23e5a80aeb74..8ae71ceed23cb1d89b3e094d560034329740b111 100755 (executable)
@@ -41,6 +41,7 @@
 
 #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"
 
@@ -477,7 +478,7 @@ int update_Delta_IMG(int part_idx, unsigned long ui32Operation)
 }
 
 #ifdef SS_RECOVERYRAMDISK
-int verify_RecoveryDelta_IMG(int part_idx)
+int verify_RecoveryDelta_IMG(int part_idx, int update_type)
 {
        int ret = SUCCESS;
        ua_dataSS_t ua_dataSS;
@@ -491,9 +492,16 @@ int verify_RecoveryDelta_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;
-       if (ua_update_data->ua_delta_path != NULL) {
-               ret = SS_IMGVerfiyPartition(&ua_dataSS);
+       if (update_type == FULL_IMG) {
+               if (ua_update_data->ua_delta_path != NULL){
+                       ret = SUCCESS;
+                       fota_gui_progress(&ua_dataSS, 100);
+               }
+       } else if (update_type == DELTA_IMG) {
+               if (ua_update_data->ua_delta_path != NULL) {
+                       ret = SS_IMGVerfiyPartition(&ua_dataSS);
                }
+       }
        return ret;
 }
 
@@ -516,7 +524,7 @@ int update_RecoveryDelta_IMG(int part_idx, int update_type)
        //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/fota_temp_%s", delta_folder, ua_dataSS.parti_info->ua_parti_name);
+               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);
                ret = SS_IMGUpdatemain(&ua_dataSS, update_type);        //PASS temp path whr file has to be written, Once written it should be UNLINKED after upgrade.
                }
@@ -828,7 +836,7 @@ int update_all()
                                else if (update_type == DELTA_FS)
                                        ret = verify_Delta_FS(part_idx);
                                else if (update_type == EXTRA)
-                                       ret = verify_RecoveryDelta_IMG(part_idx);
+                                       ret = verify_RecoveryDelta_IMG(part_idx, FULL_IMG);
                                else
                                        ret = -1;