From: Antoni Date: Wed, 7 Feb 2024 14:23:48 +0000 (+0100) Subject: Separate delta configurations to separate repos X-Git-Tag: accepted/tizen/unified/20240419.110853~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8612cfa5c00f5c22c76ba2181bcf2a6dd8d5461;p=platform%2Fcore%2Fsystem%2Fupgrade-tools.git Separate delta configurations to separate repos 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 --- diff --git a/Dockerfile b/Dockerfile index 48eab8b..d323197 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/ diff --git a/docker-build.sh b/docker-build.sh index b6f6486..f1473ef 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -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 index 09380e1..0000000 --- a/mk_delta/rpi4/cfg/delta.cfg +++ /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 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 index e69de29..0000000 diff --git a/scripts/directory-setup.sh b/scripts/directory-setup.sh new file mode 100644 index 0000000..fba965a --- /dev/null +++ b/scripts/directory-setup.sh @@ -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