Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scripts/fast-reboot] Add option to include ssd-upgrader-part boot option with SONiC partition #2150

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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