Separate delta configurations to separate repos 59/305859/4
authorAntoni <a.adaszkiewi@samsung.com>
Wed, 7 Feb 2024 14:23:48 +0000 (15:23 +0100)
committerAntoni <a.adaszkiewi@samsung.com>
Mon, 26 Feb 2024 15:51:26 +0000 (16:51 +0100)
Delta configuration files will now be downloaded during docker image
build. Two host env variables are used for this:
- DOCKER_CFG_GIT_CLONE_PATH
- DOCKER_CFG_GIT_BRANCH

Change-Id: Id4982ab167ea4e3fa0d23e98e918f978b7859801

Dockerfile
docker-build.sh
mk_delta/rpi4/cfg/delta.cfg [deleted file]
mk_delta/rpi4/data/new_tar/.gitignore [deleted file]
mk_delta/rpi4/data/old_tar/.gitignore [deleted file]
scripts/directory-setup.sh [new file with mode: 0644]

index 48eab8b..d323197 100644 (file)
@@ -24,6 +24,16 @@ RUN pip3 install requests beautifulsoup4 PyYAML
 COPY mass-delta-builder/pre_run.sh /app/
 COPY mass-delta-builder/mass-delta-builder.py /app/
 
+ARG CFG_GIT_CLONE_PATH
+ARG CFG_GIT_BRANCH
+
+RUN git clone "$CFG_GIT_CLONE_PATH" /tota-upg/mk_delta/temp && \
+       git --git-dir=/tota-upg/mk_delta/temp/.git --work-tree=/tota-upg/mk_delta/temp checkout "$CFG_GIT_BRANCH" && \
+       rm -rf /tota-upg/mk_delta/temp/.git && \
+       bash /tota-upg/scripts/directory-setup.sh /tota-upg/mk_delta/temp/ && \
+       cp -r /tota-upg/mk_delta/temp/* /tota-upg/mk_delta/ && \
+       rm -rf /tota-upg/mk_delta/temp/
+
 WORKDIR /app
 
 VOLUME /images/
index b6f6486..f1473ef 100755 (executable)
@@ -1,3 +1,12 @@
 #!/bin/sh
 
-exec docker build --no-cache -t upgrade-tools:latest .
+if [ -z "${DOCKER_CFG_GIT_CLONE_PATH}" ]; then
+       DOCKER_CFG_GIT_CLONE_PATH="git://git.tizen.org/platform/core/system/plugin/upgrade-tools-generic"
+fi
+
+if [ -z "${DOCKER_CFG_GIT_BRANCH}" ]; then
+       DOCKER_CFG_GIT_BRANCH="origin/tizen"
+fi
+
+exec docker build --build-arg CFG_GIT_CLONE_PATH="${DOCKER_CFG_GIT_CLONE_PATH}" \
+       --build-arg CFG_GIT_BRANCH="${DOCKER_CFG_GIT_BRANCH}" --no-cache -t upgrade-tools:latest .
diff --git a/mk_delta/rpi4/cfg/delta.cfg b/mk_delta/rpi4/cfg/delta.cfg
deleted file mode 100644 (file)
index 09380e1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# Configuration for generation of delta
-# Filesystem label, bin name (in tar), delta name, update type, blk dev, blk offset
-BOOT                   boot.img                boot.img                FULL_IMAGE:BEFORE_BOOT_FOTA             /dev/mmcblk0p1  0
-hal                    hal.img                 hal.img                 DELTA_IMAGE:AT_BOOT_FOTA                /dev/mmcblk0p10 0
-modules                        modules.img             modules.img             FULL_IMAGE:BEFORE_BOOT_FOTA             /dev/mmcblk0p6  0
-rootfs                 rootfs.img              rootfs.img              DELTA_IMAGE:AT_BOOT_FOTA                /dev/mmcblk0p2  0
-ramdisk                        ramdisk.img             ramdisk.img             FULL_IMAGE:AT_BOOT_FOTA                 /dev/mmcblk0p7  0
-ramdisk-recovery       ramdisk-recovery.img    ramdisk-recovery.img    FULL_IMAGE:BEFORE_BOOT_FOTA             /dev/mmcblk0p8  0
diff --git a/mk_delta/rpi4/data/new_tar/.gitignore b/mk_delta/rpi4/data/new_tar/.gitignore
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/mk_delta/rpi4/data/old_tar/.gitignore b/mk_delta/rpi4/data/old_tar/.gitignore
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/scripts/directory-setup.sh b/scripts/directory-setup.sh
new file mode 100644 (file)
index 0000000..fba965a
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+ROOT_DIR=$1
+
+for DIR in "${ROOT_DIR}"/*/; do
+       mkdir -p "${DIR}"/data/new_tar
+       mkdir -p "${DIR}"/data/old_tar
+done