From ca1f22108ef69381ae51d83497abb08043405703 Mon Sep 17 00:00:00 2001 From: Dostoievski Batista Date: Mon, 18 Dec 2023 10:52:19 -0300 Subject: [PATCH] Pull only the latest ostree commit to pre-patched ISO This commit change the patch-iso-debian script to pull only the latest ostree commit from the repository used to create it. This make the iso not increase in size exponentially. Test plan: PASS: Create ISO using the script. PASS: Check if ostree_repo/ contains only the latest commit. PASS: Install AIO-SX system. Closes-Bug: 2046811 Change-Id: I96ef803e3b93535cdd2b9e077ab94df98164cdfa Signed-off-by: Dostoievski Batista --- build-tools/patch-iso-debian | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build-tools/patch-iso-debian b/build-tools/patch-iso-debian index 9b90e3fe..93dc782e 100755 --- a/build-tools/patch-iso-debian +++ b/build-tools/patch-iso-debian @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2022 Wind River Systems, Inc. +# Copyright (c) 2023 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -42,7 +42,7 @@ function extract_metadata() { local patchesdir=${BUILDDIR}/patches local patchfile=$1 local patchid=$(basename $patchfile .patch) - local ostree_log=$(ostree --repo=${BUILDDIR}/ostree_repo log starlingx) + local ostree_log=$(ostree --repo=${OSTREE_REPO} log starlingx) echo "Extracting ${patchfile}" # Extract it @@ -218,7 +218,7 @@ fi # Mount the ISO mount_iso -rsync -a ${MNTDIR}/ ${BUILDDIR}/ +rsync -a --exclude 'ostree_repo' ${MNTDIR}/ ${BUILDDIR}/ rc=$? if [ $rc -ne 0 ]; then echo "Call to rsync ISO content. Aborting..." @@ -230,13 +230,14 @@ unmount_iso # Fix for permission denied if not running as root chmod +w ${BUILDDIR} chmod -R +w ${BUILDDIR}/isolinux -chmod -R +w ${BUILDDIR}/ostree_repo + # Create the directory where metadata will be stored mkdir -p ${BUILDDIR}/patches chmod -R +w ${BUILDDIR}/patches -echo "Updating ostree_repo..." -ostree --repo=${BUILDDIR}/ostree_repo pull-local ${OSTREE_REPO} starlingx +echo "Copying only the latest commit from ostree_repo..." +ostree --repo=${BUILDDIR}/ostree_repo init --mode=archive-z2 +ostree --repo=${BUILDDIR}/ostree_repo pull-local --depth=0 ${OSTREE_REPO} starlingx ostree --repo=${BUILDDIR}/ostree_repo summary --update echo "Updated iso ostree commit:" ostree --repo=${BUILDDIR}/ostree_repo log starlingx