Skip to content

Commit 4139e06

Browse files
ArunSaravananBalachandranyxieca
authored andcommitted
DellEMC: Z9332f - Component firmware upgrade platform API implementation (#8973)
1 parent 517d81a commit 4139e06

File tree

5 files changed

+346
-16
lines changed

5 files changed

+346
-16
lines changed

device/dell/x86_64-dellemc_z9332f_d1508-r0/platform.json

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
},
2020
{
2121
"name": "Switch CPLD 2"
22+
},
23+
{
24+
"name": "SSD"
25+
},
26+
{
27+
"name": "PCIe"
2228
}
2329
],
2430
"fans": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/bash
2+
3+
ONIE_PATH="/mnt/onie-boot"
4+
ONIE_PENDING_DIR="${ONIE_PATH}/onie/update/pending"
5+
6+
unset FWPKG
7+
8+
function stage_fwpkg()
9+
{
10+
local name=$(basename ${FWPKG})
11+
local pending="${ONIE_PENDING_DIR}/$name"
12+
13+
# Exit if not superuser
14+
if [[ "$EUID" -ne 0 ]]; then
15+
echo "ERROR: This command must be run as root" >&2
16+
exit 1
17+
fi
18+
19+
# Mount ONIE partition if not already mounted
20+
if ! grep -qs ${ONIE_PATH} /proc/mounts; then
21+
mkdir -p ${ONIE_PATH}
22+
mount LABEL=ONIE-BOOT ${ONIE_PATH} || {
23+
echo "ERROR: Failed to mount ONIE partition"
24+
exit 1
25+
}
26+
fi
27+
28+
[ -f "$pending" ] && {
29+
echo "INFO: Firmware update package ${name} is already staged"
30+
exit 2
31+
}
32+
33+
${ONIE_PATH}/onie/tools/bin/onie-fwpkg add ${FWPKG} || {
34+
echo "ERROR: onie-fwpkg add for ${name} failed"
35+
exit 1
36+
}
37+
}
38+
39+
SCRIPT=$0
40+
41+
function show_help_and_exit()
42+
{
43+
echo "Usage ${SCRIPT} [options]"
44+
echo " This script will stage ONIE firmware update package."
45+
echo " "
46+
echo " Available options:"
47+
echo " -h, -? : getting this help"
48+
echo " -o [fwpkg] : stages the firmware update package"
49+
50+
exit 0
51+
}
52+
53+
54+
function parse_options()
55+
{
56+
while getopts ":h?a:" opt; do
57+
case $opt in
58+
a )
59+
FWPKG=$(realpath $OPTARG)
60+
stage_fwpkg
61+
;;
62+
h|\? )
63+
show_help_and_exit
64+
;;
65+
esac
66+
done
67+
}
68+
69+
parse_options $@
70+
exit 0

platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ common/platform_reboot usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0
99
common/pcisysfs.py usr/bin
1010
common/fw-updater usr/local/bin
1111
common/onie_mode_set usr/local/bin
12+
common/onie_stage_fwpkg usr/local/bin

platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
MAX_Z9332F_FAN = 2
2929
MAX_Z9332F_PSU = 2
3030
MAX_Z9332F_THERMAL = 14
31-
MAX_Z9332F_COMPONENT = 6 # BIOS,FPGA,BMC,BB CPLD and 2 Switch CPLDs
31+
MAX_Z9332F_COMPONENT = 8 # BIOS,FPGA,BMC,BB CPLD,2 Switch CPLDs,SSD and PCIe
3232

3333
media_part_num_list = set([ \
3434
"8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC",

0 commit comments

Comments
 (0)