File tree 2 files changed +15
-19
lines changed
2 files changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -38,22 +38,19 @@ sonic_asic_type=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
38
38
39
39
# Install new FW for mellanox platforms before control plane goes down
40
40
# So on boot switch will not spend time to upgrade FW increasing the CP downtime
41
- if [[ " $sonic_asic_type " == " mellanox" ]];
42
- then
43
- CURRENT_SONIC_IMAGE=$( sonic_installer list | grep " Current: " | cut -d ' ' -f 2)
44
- if [[ " ${CURRENT_SONIC_IMAGE} " != " ${NEXT_SONIC_IMAGE} " ]]; then
45
- echo " Prepare ASIC to fast reboot: install new FW if requiered"
46
- NEXT_IMAGE_FS_PATH=" /host/image-${NEXT_SONIC_IMAGE# SONiC-OS-} /fs.squashfs"
47
- FS_MOUNTPOINT=" /tmp/image-${NEXT_SONIC_IMAGE# SONiC-OS-} -fs"
48
- mkdir -p " $FS_MOUNTPOINT "
49
- mount -t squashfs " $NEXT_IMAGE_FS_PATH " " $FS_MOUNTPOINT "
50
- /usr/bin/mlnx-fw-upgrade.sh " $FS_MOUNTPOINT /etc/mlnx/fw-SPC.mfa"
51
- EXIT_CODE=$?
52
- umount " $FS_MOUNTPOINT "
53
- if [[ $EXIT_CODE != 0 ]]; then
54
- echo " Failed to burn FW"
55
- exit 1
56
- fi
41
+ if [[ " $sonic_asic_type " == " mellanox" ]]; then
42
+ echo " Prepare MLNX ASIC to fast reboot: install new FW if required"
43
+
44
+ MLNX_EXIT_SUCCESS=" 0"
45
+ MLNX_EXIT_ERROR=" 1"
46
+
47
+ MLNX_FW_UPGRADE_SCRIPT=" /usr/bin/mlnx-fw-upgrade.sh"
48
+
49
+ ${MLNX_FW_UPGRADE_SCRIPT} --upgrade
50
+ MLNX_EXIT_CODE=" $? "
51
+ if [[ " ${MLNX_EXIT_CODE} " != " ${MLNX_EXIT_SUCCESS} " ]]; then
52
+ echo " Failed to burn MLNX FW: errno=${MLNX_EXIT_CODE} "
53
+ exit " ${MLNX_EXIT_ERROR} "
57
54
fi
58
55
fi
59
56
Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /bin/bash
2
2
3
3
REBOOT_USER=$( logname)
4
4
REBOOT_TIME=$( date)
@@ -14,7 +14,6 @@ function stop_sonic_services()
14
14
sleep 3
15
15
}
16
16
17
-
18
17
# Exit if not superuser
19
18
if [[ " $EUID " -ne 0 ]]; then
20
19
echo " This command must be run as root" >&2
@@ -33,7 +32,7 @@ sleep 3
33
32
34
33
if [ -x ${DEVPATH} /${PLATFORM} /${PLAT_REBOOT} ]; then
35
34
echo " Rebooting with platform ${PLATFORM} specific tool ..."
36
- exec ${DEVPATH} /${PLATFORM} /${PLAT_REBOOT}
35
+ exec ${DEVPATH} /${PLATFORM} /${PLAT_REBOOT} $@
37
36
else
38
37
# If no platform-specific reboot tool, just run /sbin/reboot
39
38
exec /sbin/reboot $@
You can’t perform that action at this time.
0 commit comments