Add support for delta.tar.gz 35/257635/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 27 Apr 2021 11:53:20 +0000 (13:53 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 12 May 2021 13:07:21 +0000 (15:07 +0200)
By using compressed delta.tar files, the amount of data that must be
downloaded to perform a device update is reduced.

Change-Id: I67a0f8405d67d8b07711e421b8fb782e7fadb82f

update-manager/fota/fota-installer.c
update-manager/fota/fota-storage-checker.c

index 20d7b06a7d0bf1262171bef1db9a4fa20600c80e..5635ff08458615ccdab609eda0a72778dc7369c1 100644 (file)
@@ -29,9 +29,15 @@ int fota_installer_execute()
 
        client_delta_path = g_strjoin("/", APP_SHARED_DIR, appid, APP_SHARED_DATA, FOTA_DELTA_FILENAME, NULL);
        if (!g_file_test(client_delta_path, G_FILE_TEST_EXISTS)) {
-               _FLOGI("%s doesn't have delta.tar", appid);
-               status = -2;
-               goto execute_destroy;
+               gchar *tmp_client_delta_path = client_delta_path;
+               client_delta_path = g_strconcat(tmp_client_delta_path, ".gz", NULL);
+               free(tmp_client_delta_path);
+
+               if (!g_file_test(client_delta_path, G_FILE_TEST_EXISTS)) {
+                       _FLOGI("%s doesn't have delta.tar.gz", appid);
+                       status = -2;
+                       goto execute_destroy;
+               }
        }
 
        /* 2. Check client have appropriate delta  */
index c04b387c873f516df2424ee1438e021557e62fb0..ca50249f0c0a180f69a0b390fed654a1f4478c04 100644 (file)
@@ -28,8 +28,14 @@ gchar *fota_storage_find_delta(const char* mount_path, const char *folder_name)
        /* 2. Check storage have delta.tar */
        storage_delta_path = g_strjoin("/", mount_path, folder_name, FOTA_DELTA_FILENAME, NULL);
        if (!g_file_test(storage_delta_path, G_FILE_TEST_EXISTS)) {
-               _FLOGI("Storage doesn't have %s", storage_delta_path);
-               goto verify_destroy;
+               gchar *tmp_storage_delta_path = storage_delta_path;
+               storage_delta_path = g_strconcat(tmp_storage_delta_path, ".gz", NULL);
+               free(tmp_storage_delta_path);
+
+               if (!g_file_test(storage_delta_path, G_FILE_TEST_EXISTS)) {
+                       _FLOGI("Storage doesn't have %s", storage_delta_path);
+                       goto verify_destroy;
+               }
        }
 
        /* 3. Check storage have appropriate delta */