Copy partitions listed in the /hal/etc/upgrade/background_copy.list 27/267527/1
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 6 Dec 2021 16:40:50 +0000 (17:40 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 6 Dec 2021 16:50:39 +0000 (17:50 +0100)
Change-Id: I283ad7e6de2997ecdfb17c44096eb5c57380e50f

scripts/upgrade-prepare-partitions.sh

index cb281a2..a014913 100644 (file)
@@ -9,6 +9,8 @@ FOTA_DIR="/opt/usr/data/fota"
 STATUS_DIR="/opt/data/update"
 SCRIPT_NAME="upgrade-prepare-partitions.sh"
 LOG_FILE="/tmp/upgrade-prepare-partitions.log"
+HAL_UPGRADE_CFG_DIR="/hal/etc/upgrade/"
+HAL_PART_LIST_FILE="background_copy.list"
 #------------------------------------------------
 #       log msg [file]
 #------------------------------------------------
@@ -72,7 +74,7 @@ check_optional_partition() {
 
 background_copy() {
        flog "[Info] Background copying A|B partitions for update..."
-       for partition_name in boot ramdisk recovery modules hal rootfs; do
+       for partition_name in ${PARTITION_LIST}; do
                # echo is there to suspend abort when partition will not be found e.g. hal
                if ! CURRENT_PARTITION="$(/usr/bin/blkid-print "$EMMC_DEVICE" "$partition_name" "$CURRENT_AB" |\
                        sed -E 's|(part_nr: [0-9]+ )\((.*)\): (.*)|\3|' || echo "__FALSE__")" || \
@@ -101,8 +103,12 @@ background_copy() {
        done
 }
 
+load_background_copy_list() {
+       PARTITION_LIST=$(grep -v -e "^#" -e "^$" ${HAL_UPGRADE_CFG_DIR}/${HAL_PART_LIST_FILE})
+}
 
 check_ab_partition_scheme
 check_used_block_device
 create_update_dirs
+load_background_copy_list
 background_copy