Always copy whole /usr/libexec/upgrade-support to delta tar
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Mon, 4 Apr 2022 18:27:16 +0000 (20:27 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Mon, 4 Apr 2022 18:27:16 +0000 (20:27 +0200)
Recently there have been quite a few changes with upgrade scripts,
with each change requiring in this repository _in additon_ to changes
in packages which provide such scripts (tota-ua).

This commit generalizes the script concept, allowing it for any
package to install needed scrips to /usr/libexec/upgrade-support whose
contents will be copied in verbatim to delta.tar.

Change-Id: Ia6baec1ab777da842c4ea5b87e83046cbaa0b8fd

mk_delta/common/bin/mk_delta.sh

index 8eec040..c6b1176 100755 (executable)
@@ -252,7 +252,9 @@ fn_extract_from_image()
        fi
 
        EXTRACT_FILE="${MNT_PNT}${TARGET_FILE}"
-       if [ -e ${EXTRACT_FILE} ]; then
+       if [ -d ${EXTRACT_FILE} ]; then
+               sudo cp -Rd ${EXTRACT_FILE}/* ${DELTA_DIR}
+       elif [ -e ${EXTRACT_FILE} ]; then
                sudo cp ${EXTRACT_FILE} ${DELTA_DIR}
        else
                echo "There is no ${TARGET_FILE} in ${IMAGE}"
@@ -361,12 +363,7 @@ do
 
        #--- extract files which would be appended to delta.tar ---
        echo "Extract binaries for update from images"
-       fn_extract_from_image rootfs.img /usr/bin/upgrade-trigger.sh
-       fn_extract_from_image rootfs.img /usr/bin/upgrade-legacy.sh
-       fn_extract_from_image rootfs.img /usr/bin/upgrade-full.sh
-       fn_extract_from_image rootfs.img /usr/bin/upgrade-fota.sh
-       fn_extract_from_image rootfs.img /usr/bin/upgrade-partial.sh
-       fn_extract_from_image rootfs.img /usr/bin/upgrade-prepare-partitions.sh
+       fn_extract_from_image rootfs.img /usr/libexec/upgrade-support
        fn_extract_from_image ramdisk-recovery.img /usr/bin/delta.ua
 
        #--- archive result directory ---