From 72dbff72e7404a4c9712993cdf48ac05b0661046 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sun, 19 May 2024 10:08:06 +0300 Subject: [PATCH] enable MIRROR_SNAPSHOT if SONIC_VERSION_CONTROL_COMPONENTS includes deb (#17148) Fix #17113 If we set MIRROR_SNAPSHOT=y in build_mirror_config.sh then we have incorrect value of MIRROR_SNAPSHOT in other places like buildinfo/config/buildinfo.config How I did it Override MIRROR_SNAPSHOT=y in rules/config if SONIC_VERSION_CONTROL_COMPONENTS=all or SONIC_VERSION_CONTROL_COMPONENTS includes deb component. How to verify it Start to build with different values of SONIC_VERSION_CONTROL_COMPONENTS and MIRROR_SNAPSHOT in cmdline and check value of MIRROR_SNAPSHOT in buildinfo.config and debian mirrors in sources.list files --- rules/config | 8 ++++++++ scripts/build_mirror_config.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rules/config b/rules/config index c54424c569cb..d081fd5aab91 100644 --- a/rules/config +++ b/rules/config @@ -262,6 +262,14 @@ TRUSTED_GPG_URLS = https://packages.trafficmanager.net/debian/public_key.gpg,htt # docker: docker base images SONIC_VERSION_CONTROL_COMPONENTS ?= none +ifeq ($(SONIC_VERSION_CONTROL_COMPONENTS),all) +override MIRROR_SNAPSHOT = y +endif + +ifneq (,$(findstring deb,$(SONIC_VERSION_CONTROL_COMPONENTS))) +override MIRROR_SNAPSHOT = y +endif + # MIRROR_SNAPSHOT - support mirror snapshot flag MIRROR_SNAPSHOT ?= n diff --git a/scripts/build_mirror_config.sh b/scripts/build_mirror_config.sh index 971390d0045f..be67052ced4c 100755 --- a/scripts/build_mirror_config.sh +++ b/scripts/build_mirror_config.sh @@ -11,7 +11,7 @@ export APT_RETRIES_COUNT DEFAULT_MIRROR_URL_PREFIX=http://packages.trafficmanager.net MIRROR_VERSION_FILE= -[[ "$SONIC_VERSION_CONTROL_COMPONENTS" == *deb* || $SONIC_VERSION_CONTROL_COMPONENTS == *all* ]] && MIRROR_VERSION_FILE=files/build/versions/default/versions-mirror && MIRROR_SNAPSHOT=y +[[ "$SONIC_VERSION_CONTROL_COMPONENTS" == *deb* || $SONIC_VERSION_CONTROL_COMPONENTS == *all* ]] && MIRROR_VERSION_FILE=files/build/versions/default/versions-mirror [ -f target/versions/default/versions-mirror ] && MIRROR_VERSION_FILE=target/versions/default/versions-mirror # The default mirror urls