Introduce the asic_subtype field for adding the sub platform variants. (#10235)
* Introduce the asic_subtype field for adding the sub platform variants. It uses the value of TARGET_MACHINE variable in slave.mk.
This commit is contained in:
parent
cc938e73a3
commit
8e642848c2
@ -492,6 +492,7 @@ export build_version="${SONIC_IMAGE_VERSION}"
|
|||||||
export debian_version="$(cat $FILESYSTEM_ROOT/etc/debian_version)"
|
export debian_version="$(cat $FILESYSTEM_ROOT/etc/debian_version)"
|
||||||
export kernel_version="${kversion}"
|
export kernel_version="${kversion}"
|
||||||
export asic_type="${sonic_asic_platform}"
|
export asic_type="${sonic_asic_platform}"
|
||||||
|
export asic_subtype="${TARGET_MACHINE}"
|
||||||
export commit_id="$(git rev-parse --short HEAD)"
|
export commit_id="$(git rev-parse --short HEAD)"
|
||||||
export branch="$(git rev-parse --abbrev-ref 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)"
|
export release="$(if [ -f $FILESYSTEM_ROOT/etc/sonic/sonic_release ]; then cat $FILESYSTEM_ROOT/etc/sonic/sonic_release; fi)"
|
||||||
|
@ -5,6 +5,7 @@ SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2
|
|||||||
# Retrieve SWSS vars from sonic-cfggen
|
# Retrieve SWSS vars from sonic-cfggen
|
||||||
SWSS_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $SWSS_VARS_FILE) || exit 1
|
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 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')
|
MAC_ADDRESS=$(echo $SWSS_VARS | jq -r '.mac')
|
||||||
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
|
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
|
||||||
|
@ -7,6 +7,9 @@ debian_version: '{{ debian_version }}'
|
|||||||
kernel_version: '{{ kernel_version }}'
|
kernel_version: '{{ kernel_version }}'
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
asic_type: {{ asic_type }}
|
asic_type: {{ asic_type }}
|
||||||
|
{% if asic_subtype is defined and asic_subtype != '' -%}
|
||||||
|
asic_subtype: '{{ asic_subtype }}'
|
||||||
|
{% endif -%}
|
||||||
commit_id: '{{ commit_id }}'
|
commit_id: '{{ commit_id }}'
|
||||||
branch: '{{ branch }}'
|
branch: '{{ branch }}'
|
||||||
{% if release is defined and release != '' -%}
|
{% if release is defined and release != '' -%}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"asic_type": "{{ asic_type }}",
|
"asic_type": "{{ asic_type }}",
|
||||||
|
{% if asic_subtype is defined and asic_subtype != '' -%}
|
||||||
|
"asic_subtype": "{{ asic_subtype }}",
|
||||||
|
{% endif -%}
|
||||||
"asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}",
|
"asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}",
|
||||||
"mac": "{{ DEVICE_METADATA.localhost.mac }}",
|
"mac": "{{ DEVICE_METADATA.localhost.mac }}",
|
||||||
"resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}",
|
"resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}",
|
||||||
|
Reference in New Issue
Block a user