Skip to content

Commit

Permalink
[scripts/fast-reboot] Add option to include ssd-upgrader-part boot op…
Browse files Browse the repository at this point in the history
…tion with SONiC partition (#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/sonic-buildimage#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.
  • Loading branch information
ArunSaravananBalachandran authored May 12, 2022
1 parent 90abc07 commit 87fc0a4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin"
LOG_SSD_HEALTH="/usr/local/bin/log_ssd_health"
PLATFORM_FWUTIL_AU_REBOOT_HANDLE="platform_fw_au_reboot_handle"
SSD_FW_UPDATE="ssd-fw-upgrade"
SSD_FW_UPDATE_BOOT_OPTION=no
TAG_LATEST=yes
DETACH=no
LOG_PATH="/var/log/${REBOOT_TYPE}.txt"
Expand Down Expand Up @@ -77,13 +78,14 @@ function showHelpAndExit()
echo " - control plane assistant IP list."
echo " -t : Don't tag the current kube images as latest"
echo " -D : detached mode - closing terminal will not cause stopping reboot"
echo " -u : include ssd-upgrader-part in boot options"

exit "${EXIT_SUCCESS}"
}

function parseOptions()
{
while getopts "vfidh?rkxc:sD" opt; do #TODO "t" is missing
while getopts "vfidh?rkxc:sDu" opt; do #TODO "t" is missing
case ${opt} in
h|\? )
showHelpAndExit
Expand Down Expand Up @@ -121,6 +123,9 @@ function parseOptions()
D )
DETACH=yes
;;
u )
SSD_FW_UPDATE_BOOT_OPTION=yes
;;
esac
done
}
Expand Down Expand Up @@ -355,6 +360,11 @@ function setup_reboot_variables()
error "Unknown bootloader. ${REBOOT_TYPE} is not supported."
exit "${EXIT_NOT_SUPPORTED}"
fi
if [[ x"${SSD_FW_UPDATE_BOOT_OPTION}" == x"yes" ]]; then
local sonic_dev=$(blkid -L SONiC-OS)
local fstype=$(blkid -o value -s TYPE ${sonic_dev})
BOOT_OPTIONS="${BOOT_OPTIONS} ssd-upgrader-part=${sonic_dev},${fstype}"
fi
}
function check_docker_exec()
Expand Down

0 comments on commit 87fc0a4

Please sign in to comment.