Skip to content

Commit 1a9d6cd

Browse files
authored
Support to add SONiC OS Version in device info (#14601) (#14624)
Why I did it 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 How I did it
1 parent 5c4d424 commit 1a9d6cd

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
@@ -403,6 +403,7 @@ SONIC_BUILD_INSTRUCTION := make \
403403
MIRROR_URLS=$(MIRROR_URLS) \
404404
MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \
405405
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
406+
SONIC_OS_VERSION=$(SONIC_OS_VERSION) \
406407
$(SONIC_OVERRIDE_BUILD_VARS)
407408

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

build_debian.sh

+1
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ export release="$(if [ -f $FILESYSTEM_ROOT/etc/sonic/sonic_release ]; then cat $
560560
export build_date="$(date -u)"
561561
export build_number="${BUILD_NUMBER:-0}"
562562
export built_by="$USER@$BUILD_HOSTNAME"
563+
export sonic_os_version="${SONIC_OS_VERSION}"
563564
j2 files/build_templates/sonic_version.yml.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/sonic_version.yml
564565

565566
## 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
@@ -253,3 +253,6 @@ ENABLE_FIPS ?= n
253253

254254
# SONIC_SLAVE_DOCKER_DRIVER - set the sonic slave docker storage driver
255255
SONIC_SLAVE_DOCKER_DRIVER ?= vfs
256+
257+
# SONIC_OS_VERSION - sonic os version
258+
SONIC_OS_VERSION ?= 11

slave.mk

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export MULTIARCH_QEMU_ENVIRON
8282
export DOCKER_BASE_ARCH
8383
export BLDENV
8484
export MIRROR_SNAPSHOT
85+
export SONIC_OS_VERSION
8586

8687
###############################################################################
8788
## Utility rules

0 commit comments

Comments
 (0)