Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 94b71b3

Browse files
stepanblyschaknirenjan
authored andcommitted
fix fast reboot compatibility (sonic-net#3083)
* 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
1 parent 8791759 commit 94b71b3

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

files/build_templates/docker_image_ctl.j2

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ function updateHostName()
5050

5151
function getBootType()
5252
{
53-
local BOOT_TYPE
54-
case "$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" in
55-
warm*)
53+
# same code snippet in files/scripts/syncd.sh
54+
case "$(cat /proc/cmdline)" in
55+
*SONIC_BOOT_TYPE=warm*)
5656
TYPE='warm'
5757
;;
58-
fastfast)
58+
*SONIC_BOOT_TYPE=fastfast*)
5959
TYPE='fastfast'
6060
;;
61-
fast*)
61+
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
6262
TYPE='fast'
6363
;;
6464
*)
@@ -195,7 +195,7 @@ start() {
195195
echo "Creating new {{docker_container_name}} container with HWSKU $HWSKU"
196196
{%- endif %}
197197
{%- if sonic_asic_platform == "mellanox" %}
198-
# TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version
198+
# TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version
199199
{%- endif %}
200200
docker create {{docker_image_run_opt}} \
201201
{%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %}

files/scripts/syncd.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ function wait_for_database_service()
5555

5656
function getBootType()
5757
{
58-
case "$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" in
59-
warm*)
58+
# same code snippet in files/build_templates/docker_image_ctl.j2
59+
case "$(cat /proc/cmdline)" in
60+
*SONIC_BOOT_TYPE=warm*)
6061
TYPE='warm'
6162
;;
62-
fastfast)
63+
*SONIC_BOOT_TYPE=fastfast*)
6364
TYPE='fastfast'
6465
;;
65-
fast*)
66+
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
6667
TYPE='fast'
6768
;;
6869
*)

0 commit comments

Comments
 (0)