Skip to content

Commit

Permalink
Introduce the asic_subtype field for adding the sub platform variants. (
Browse files Browse the repository at this point in the history
#10235)

* Introduce the asic_subtype field for adding the sub platform variants. 
   It uses the value of TARGET_MACHINE variable in slave.mk.
  • Loading branch information
judyjoseph authored Mar 28, 2022
1 parent cc938e7 commit 8e64284
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ export build_version="${SONIC_IMAGE_VERSION}"
export debian_version="$(cat $FILESYSTEM_ROOT/etc/debian_version)"
export kernel_version="${kversion}"
export asic_type="${sonic_asic_platform}"
export asic_subtype="${TARGET_MACHINE}"
export commit_id="$(git rev-parse --short HEAD)"
export branch="$(git rev-parse --abbrev-ref HEAD)"
export release="$(if [ -f $FILESYSTEM_ROOT/etc/sonic/sonic_release ]; then cat $FILESYSTEM_ROOT/etc/sonic/sonic_release; fi)"
Expand Down
1 change: 1 addition & 0 deletions dockers/docker-orchagent/orchagent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2
# Retrieve SWSS vars from sonic-cfggen
SWSS_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $SWSS_VARS_FILE) || exit 1
export platform=$(echo $SWSS_VARS | jq -r '.asic_type')
export sub_platform=$(echo $SWSS_VARS | jq -r '.asic_subtype')

MAC_ADDRESS=$(echo $SWSS_VARS | jq -r '.mac')
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
Expand Down
3 changes: 3 additions & 0 deletions files/build_templates/sonic_version.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ debian_version: '{{ debian_version }}'
kernel_version: '{{ kernel_version }}'
{% endif -%}
asic_type: {{ asic_type }}
{% if asic_subtype is defined and asic_subtype != '' -%}
asic_subtype: '{{ asic_subtype }}'
{% endif -%}
commit_id: '{{ commit_id }}'
branch: '{{ branch }}'
{% if release is defined and release != '' -%}
Expand Down
3 changes: 3 additions & 0 deletions files/build_templates/swss_vars.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"asic_type": "{{ asic_type }}",
{% if asic_subtype is defined and asic_subtype != '' -%}
"asic_subtype": "{{ asic_subtype }}",
{% endif -%}
"asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}",
"mac": "{{ DEVICE_METADATA.localhost.mac }}",
"resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}",
Expand Down

0 comments on commit 8e64284

Please sign in to comment.