Skip to content

Commit 87fc0a4

Browse files
[scripts/fast-reboot] Add option to include ssd-upgrader-part boot option with SONiC partition (sonic-net#2150)
What I did Add new option "-u" in ‘fast-reboot’ script, to add the “ssd-upgrader-part” boot option with SONiC partition and filesystem type. Required by: sonic-net#10748 How I did it Included a new option "-u" in fast-reboot script. If the option '-u' is specified, add "ssd-upgrader-part" with the SONiC partition and filesystem to the boot options to be used with kexec.
1 parent 90abc07 commit 87fc0a4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/fast-reboot

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin"
2424
LOG_SSD_HEALTH="/usr/local/bin/log_ssd_health"
2525
PLATFORM_FWUTIL_AU_REBOOT_HANDLE="platform_fw_au_reboot_handle"
2626
SSD_FW_UPDATE="ssd-fw-upgrade"
27+
SSD_FW_UPDATE_BOOT_OPTION=no
2728
TAG_LATEST=yes
2829
DETACH=no
2930
LOG_PATH="/var/log/${REBOOT_TYPE}.txt"
@@ -77,13 +78,14 @@ function showHelpAndExit()
7778
echo " - control plane assistant IP list."
7879
echo " -t : Don't tag the current kube images as latest"
7980
echo " -D : detached mode - closing terminal will not cause stopping reboot"
81+
echo " -u : include ssd-upgrader-part in boot options"
8082

8183
exit "${EXIT_SUCCESS}"
8284
}
8385

8486
function parseOptions()
8587
{
86-
while getopts "vfidh?rkxc:sD" opt; do #TODO "t" is missing
88+
while getopts "vfidh?rkxc:sDu" opt; do #TODO "t" is missing
8789
case ${opt} in
8890
h|\? )
8991
showHelpAndExit
@@ -121,6 +123,9 @@ function parseOptions()
121123
D )
122124
DETACH=yes
123125
;;
126+
u )
127+
SSD_FW_UPDATE_BOOT_OPTION=yes
128+
;;
124129
esac
125130
done
126131
}
@@ -355,6 +360,11 @@ function setup_reboot_variables()
355360
error "Unknown bootloader. ${REBOOT_TYPE} is not supported."
356361
exit "${EXIT_NOT_SUPPORTED}"
357362
fi
363+
if [[ x"${SSD_FW_UPDATE_BOOT_OPTION}" == x"yes" ]]; then
364+
local sonic_dev=$(blkid -L SONiC-OS)
365+
local fstype=$(blkid -o value -s TYPE ${sonic_dev})
366+
BOOT_OPTIONS="${BOOT_OPTIONS} ssd-upgrader-part=${sonic_dev},${fstype}"
367+
fi
358368
}
359369
360370
function check_docker_exec()

0 commit comments

Comments
 (0)