Skip to content

Commit 5dbf512

Browse files
authored
Support to add SONiC OS Version in device info (#14601) (#14623)
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
1 parent 81ebbf1 commit 5dbf512

File tree

6 files changed

+9
-0
lines changed

6 files changed

+9
-0
lines changed

Makefile.work

+1
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
513513
MIRROR_URLS=$(MIRROR_URLS) \
514514
MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \
515515
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
516+
SONIC_OS_VERSION=$(SONIC_OS_VERSION) \
516517
$(SONIC_OVERRIDE_BUILD_VARS)
517518

518519
.PHONY: sonic-slave-build sonic-slave-bash init reset

build_debian.sh

+1
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ export release="$(if [ -f $FILESYSTEM_ROOT/etc/sonic/sonic_release ]; then cat $
573573
export build_date="$(date -u)"
574574
export build_number="${BUILD_NUMBER:-0}"
575575
export built_by="$USER@$BUILD_HOSTNAME"
576+
export sonic_os_version="${SONIC_OS_VERSION}"
576577
j2 files/build_templates/sonic_version.yml.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/sonic_version.yml
577578

578579
## Copy over clean-up script

files/build_templates/sonic_version.yml.j2

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ built_by: {{ built_by }}
2929
{% if ENABLE_ASAN == "y" -%}
3030
asan: 'yes'
3131
{% endif -%}
32+
sonic_os_version: {{ sonic_os_version }}

platform/vs/sonic-version.mk

+2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
sonic_version=$(SONIC_GET_VERSION)
44
sonic_asic_platform=$(CONFIGURED_PLATFORM)
5+
sonic_os_version=$(SONIC_OS_VERSION)
56

67
export sonic_version
78
export sonic_asic_platform
9+
export sonic_os_version
810

911
SONIC_VERSION = sonic_version.yml
1012
$(SONIC_VERSION)_SRC_PATH = $(PLATFORM_PATH)/sonic-version

rules/config

+3
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,6 @@ ENABLE_FIPS ?= n
269269

270270
# SONIC_SLAVE_DOCKER_DRIVER - set the sonic slave docker storage driver
271271
SONIC_SLAVE_DOCKER_DRIVER ?= vfs
272+
273+
# SONIC_OS_VERSION - sonic os version
274+
SONIC_OS_VERSION ?= 11

slave.mk

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export CROSS_BUILD_ENVIRON
8787
export BLDENV
8888
export BUILD_WORKDIR
8989
export MIRROR_SNAPSHOT
90+
export SONIC_OS_VERSION
9091

9192
###############################################################################
9293
## Utility rules

0 commit comments

Comments
 (0)