Skip to content

Commit

Permalink
fix fast reboot compatibility (#3083)
Browse files Browse the repository at this point in the history
* fix fast reboot compatibility

We should handle both cases for backward-compatible with 201803:
 - fast-reboot
 - SONIC_BOOT_TYPE=fast-reboot

* handle review comments
* add a comment that getBootType code snippet is shared between two files
  • Loading branch information
stepanblyschak authored and qiluo-msft committed Jun 26, 2019
1 parent b92d980 commit 6961816
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ function updateHostName()

function getBootType()
{
local BOOT_TYPE
case "$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" in
warm*)
# same code snippet in files/scripts/syncd.sh
case "$(cat /proc/cmdline)" in
*SONIC_BOOT_TYPE=warm*)
TYPE='warm'
;;
fastfast)
*SONIC_BOOT_TYPE=fastfast*)
TYPE='fastfast'
;;
fast*)
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
TYPE='fast'
;;
*)
Expand Down Expand Up @@ -167,7 +167,7 @@ start() {
echo "Creating new {{docker_container_name}} container with HWSKU $HWSKU"
{%- endif %}
{%- if sonic_asic_platform == "mellanox" %}
# TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version
# TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version
{%- endif %}
docker create {{docker_image_run_opt}} \
{%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %}
Expand Down
9 changes: 5 additions & 4 deletions files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ function wait_for_database_service()

function getBootType()
{
case "$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" in
warm*)
# same code snippet in files/build_templates/docker_image_ctl.j2
case "$(cat /proc/cmdline)" in
*SONIC_BOOT_TYPE=warm*)
TYPE='warm'
;;
fastfast)
*SONIC_BOOT_TYPE=fastfast*)
TYPE='fastfast'
;;
fast*)
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
TYPE='fast'
;;
*)
Expand Down

0 comments on commit 6961816

Please sign in to comment.