[mlnx-fw-upgrade]: Define required FW version in build time. (#902)

- Do not query required FW from file.
This commit is contained in:
Oleksandr Ivantsiv 2017-08-22 18:08:07 +03:00 committed by Qi Luo
parent ed66588473
commit 7c75030cea
4 changed files with 12 additions and 9 deletions

View File

@ -223,6 +223,7 @@ sudo cp {{src}} $FILESYSTEM_ROOT/{{dst}}
{% if sonic_asic_platform == "mellanox" %} {% if sonic_asic_platform == "mellanox" %}
sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/ sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/
sudo cp target/files/$MLNX_FW $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa sudo cp target/files/$MLNX_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa
sudo cp platform/mellanox/mlnx-fw-upgrade.sh $FILESYSTEM_ROOT/usr/bin/ j2 platform/mellanox/mlnx-fw-upgrade.j2 | sudo tee $FILESYSTEM_ROOT/usr/bin/mlnx-fw-upgrade.sh
sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/mlnx-fw-upgrade.sh
{% endif %} {% endif %}

View File

@ -1,7 +1,9 @@
# mellanox firmware # mellanox firmware
MLNX_FW = fw-SPC-rel-13_1224_0140-EVB.mfa MLNX_FW_VERSION = 13.1224.0140
$(MLNX_FW)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_FW) MLNX_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_FW_VERSION))-EVB.mfa
SONIC_ONLINE_FILES += $(MLNX_FW) $(MLNX_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_FW_FILE)
SONIC_ONLINE_FILES += $(MLNX_FW_FILE)
export MLNX_FW export MLNX_FW_VERSION
export MLNX_FW_FILE

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
fw_required="{{ MLNX_FW_VERSION }}"
query_retry_count_max="10" query_retry_count_max="10"
fw_file=/etc/mlnx/fw-SPC.mfa fw_file=/etc/mlnx/fw-SPC.mfa
@ -13,7 +14,7 @@ run_or_fail() {
# wait until devices will be available # wait until devices will be available
query_retry_count="0" query_retry_count="0"
query_cmd="mlxfwmanager --query -i ${fw_file}" query_cmd="mlxfwmanager --query"
${query_cmd} > /dev/null ${query_cmd} > /dev/null
while [[ (${query_retry_count} -lt ${query_retry_count_max}) && ($? -ne "0") ]]; do while [[ (${query_retry_count} -lt ${query_retry_count_max}) && ($? -ne "0") ]]; do
@ -27,7 +28,6 @@ run_or_fail "${query_cmd}" > /tmp/mlnxfwmanager-query.txt
# get current firmware version and required version # get current firmware version and required version
fw_info=$(grep FW /tmp/mlnxfwmanager-query.txt) fw_info=$(grep FW /tmp/mlnxfwmanager-query.txt)
fw_current=$(echo $fw_info | cut -f2 -d' ') fw_current=$(echo $fw_info | cut -f2 -d' ')
fw_required=$(echo $fw_info | cut -f3 -d' ')
if [[ -z ${fw_current} ]]; then if [[ -z ${fw_current} ]]; then
echo "Could not retreive current FW version." echo "Could not retreive current FW version."

View File

@ -5,5 +5,5 @@ $(SONIC_ONE_IMAGE)_MACHINE = mellanox
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_DEPENDS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT) $(MLNX_HW_MANAGEMENT) $(SONIC_ONE_IMAGE)_DEPENDS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT) $(MLNX_HW_MANAGEMENT)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
$(SONIC_ONE_IMAGE)_FILES += $(MLNX_FW) $(SONIC_ONE_IMAGE)_FILES += $(MLNX_FW_FILE)
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)