Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce the asic_subtype field for adding the sub platform variants. #10235

Merged
merged 2 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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