Skip to content

Commit

Permalink
enable MIRROR_SNAPSHOT if SONIC_VERSION_CONTROL_COMPONENTS includes d…
Browse files Browse the repository at this point in the history
…eb (#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
  • Loading branch information
k-v1 committed May 19, 2024
1 parent d31e84a commit 881abd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_mirror_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 881abd3

Please sign in to comment.