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

fix fast reboot compatibility #3083

Merged
merged 3 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
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: 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()
Copy link
Collaborator

@qiluo-msft qiluo-msft Jun 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getBootType [](start = 9, length = 11)

Can we reuse the function in /usr/bin/syncd.sh? If not, make sure you share the exactly same code snippet, add code comments referring each other so we will not modify one without the other in future by mistake. #Closed

{
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