Skip to content

Commit

Permalink
Support to add SONiC OS Version in device info (#14601) (#14623)
Browse files Browse the repository at this point in the history
Why I did it
Cherry-pick #14601, for code conflict.
Support to add SONiC OS Version in device info.
It will be used to display the version info in the SONiC command "show version". The version is used to do the FIPS certification. We do not do the FIPS certification on a specific release, but on the SONiC OS Version.

SONiC Software Version: SONiC.master-13812.218661-7d94c0c28
SONiC OS Version: 11
Distribution: Debian 11.6
Kernel: 5.10.0-18-2-amd64
Work item tracking
Microsoft ADO (number only): 17894593
How I did it
How to verify it
  • Loading branch information
xumia authored Apr 13, 2023
1 parent 81ebbf1 commit 5dbf512
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
MIRROR_URLS=$(MIRROR_URLS) \
MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
SONIC_OS_VERSION=$(SONIC_OS_VERSION) \
$(SONIC_OVERRIDE_BUILD_VARS)

.PHONY: sonic-slave-build sonic-slave-bash init reset
Expand Down
1 change: 1 addition & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ export release="$(if [ -f $FILESYSTEM_ROOT/etc/sonic/sonic_release ]; then cat $
export build_date="$(date -u)"
export build_number="${BUILD_NUMBER:-0}"
export built_by="$USER@$BUILD_HOSTNAME"
export sonic_os_version="${SONIC_OS_VERSION}"
j2 files/build_templates/sonic_version.yml.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/sonic_version.yml

## Copy over clean-up script
Expand Down
1 change: 1 addition & 0 deletions files/build_templates/sonic_version.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ built_by: {{ built_by }}
{% if ENABLE_ASAN == "y" -%}
asan: 'yes'
{% endif -%}
sonic_os_version: {{ sonic_os_version }}
2 changes: 2 additions & 0 deletions platform/vs/sonic-version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

sonic_version=$(SONIC_GET_VERSION)
sonic_asic_platform=$(CONFIGURED_PLATFORM)
sonic_os_version=$(SONIC_OS_VERSION)

export sonic_version
export sonic_asic_platform
export sonic_os_version

SONIC_VERSION = sonic_version.yml
$(SONIC_VERSION)_SRC_PATH = $(PLATFORM_PATH)/sonic-version
Expand Down
3 changes: 3 additions & 0 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,6 @@ ENABLE_FIPS ?= n

# SONIC_SLAVE_DOCKER_DRIVER - set the sonic slave docker storage driver
SONIC_SLAVE_DOCKER_DRIVER ?= vfs

# SONIC_OS_VERSION - sonic os version
SONIC_OS_VERSION ?= 11
1 change: 1 addition & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export CROSS_BUILD_ENVIRON
export BLDENV
export BUILD_WORKDIR
export MIRROR_SNAPSHOT
export SONIC_OS_VERSION

###############################################################################
## Utility rules
Expand Down

0 comments on commit 5dbf512

Please sign in to comment.