Skip to content

Commit 68e3c03

Browse files
Support Golden Images in PLDM format
Signed-off-by: Vladimir Sokolovsky <[email protected]>
1 parent 6e4ed82 commit 68e3c03

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

scripts/bfb-tool

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,9 +778,17 @@ handle_opn()
778778
BMC_FW_VERSION=$(cat ./usr/lib/firmware/mellanox/bmc/bf3-bmc-fw.version 2> /dev/null)
779779
CEC_FW="./usr/lib/firmware/mellanox/cec/bf3-cec-fw.fwpkg"
780780
CEC_FW_VERSION=$(cat ./usr/lib/firmware/mellanox/cec/bf3-cec-fw.version 2> /dev/null)
781-
DPU_GI="./usr/lib/firmware/mellanox/bmc/bf3-bmc-preboot-install.bfb"
781+
if [ -e ./usr/lib/firmware/mellanox/bmc/bf3-bmc-preboot-install.pldm ]; then
782+
DPU_GI="./usr/lib/firmware/mellanox/bmc/bf3-bmc-preboot-install.pldm"
783+
elif [ -e ./usr/lib/firmware/mellanox/bmc/bf3-bmc-preboot-install.bfb ]; then
784+
DPU_GI="./usr/lib/firmware/mellanox/bmc/bf3-bmc-preboot-install.bfb"
785+
fi
782786
DPU_GI_VERSION=$(cat ./usr/lib/firmware/mellanox/bmc/bf3-bmc-preboot-install.version 2> /dev/null)
783-
NIC_FW_GI=$(/bin/ls -1 ./usr/lib/firmware/mellanox/bmc/fw-BlueField-3-rel-*-${OPN}-*.bfb 2> /dev/null)
787+
if [ -e "$(/bin/ls -1 ./usr/lib/firmware/mellanox/bmc/fw-BlueField-3-rel-*-${OPN}-*.pldm 2> /dev/null)" ]; then
788+
NIC_FW_GI="$(/bin/ls -1 ./usr/lib/firmware/mellanox/bmc/fw-BlueField-3-rel-*-${OPN}-*.pldm 2> /dev/null)"
789+
elif [ -e "$(/bin/ls -1 ./usr/lib/firmware/mellanox/bmc/fw-BlueField-3-rel-*-${OPN}-*.bfb 2> /dev/null)" ]; then
790+
NIC_FW_GI="$(/bin/ls -1 ./usr/lib/firmware/mellanox/bmc/fw-BlueField-3-rel-*-${OPN}-*.bfb 2> /dev/null)"
791+
fi
784792
NIC_FW_GI_VERSION=$(echo $NIC_FW_GI | grep -oP '(?<=BlueField-3-rel-)\d+_\d+_\d+')
785793
fi
786794

@@ -789,12 +797,21 @@ handle_opn()
789797
echo "ERROR: Profile not found: $profile"
790798
exit 1
791799
fi
792-
PROFILE_VERSION=$(echo $profile | grep -oP '(?<=config-image-)[0-9.-]+(?=\.bfb)')
793-
PROFILE=./usr/lib/firmware/mellanox/bmc/config-image.bfb
800+
if [[ "$profile" =~ "pldm" ]]; then
801+
PROFILE_VERSION=$(echo $profile | grep -oP '(?<=config-image-)[0-9.-]+(?=\.pldm)')
802+
PROFILE="./usr/lib/firmware/mellanox/bmc/config-image.pldm"
803+
elif [[ "$profile" =~ "bfb" ]]; then
804+
PROFILE_VERSION=$(echo $profile | grep -oP '(?<=config-image-)[0-9.-]+(?=\.bfb)')
805+
PROFILE="./usr/lib/firmware/mellanox/bmc/config-image.bfb"
806+
fi
794807
cp $profile $PROFILE
795808
else
796-
if [ -e ./usr/lib/firmware/mellanox/bmc/config-image.bfb ]; then
797-
PROFILE=./usr/lib/firmware/mellanox/bmc/config-image.bfb
809+
if [ -e ./usr/lib/firmware/mellanox/bmc/config-image.pldm ]; then
810+
PROFILE="./usr/lib/firmware/mellanox/bmc/config-image.pldm"
811+
elif [ -e ./usr/lib/firmware/mellanox/bmc/config-image.bfb ]; then
812+
PROFILE="./usr/lib/firmware/mellanox/bmc/config-image.bfb"
813+
fi
814+
if [ -n "$PROFILE" ]; then
798815
PROFILE_VERSION=$(cat ./usr/lib/firmware/mellanox/bmc/config-image.version 2> /dev/null)
799816
profile="${TARGET_DIR}/${PROFILE##*/}"
800817
fi

0 commit comments

Comments
 (0)