@@ -171,7 +171,7 @@ function init_warm_reboot_states()
171
171
# If the current running instance was booted up with warm reboot. Then
172
172
# the current DB contents will likely mark warm reboot is done.
173
173
# Clear these states so that the next boot up image won't get confused.
174
- if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " fast-reboot" ]]; then
174
+ if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " express-reboot " || " $REBOOT_TYPE " = " fast-reboot" ]]; then
175
175
sonic-db-cli STATE_DB eval "
176
176
for _, key in ipairs(redis.call('keys', 'WARM_RESTART_TABLE|*')) do
177
177
redis.call('hdel', key, 'state')
@@ -197,8 +197,13 @@ function request_pre_shutdown()
197
197
debug " Requesting platform reboot pre-check ..."
198
198
${DEVPATH} /${PLATFORM} /${PLATFORM_REBOOT_PRE_CHECK} ${REBOOT_TYPE}
199
199
fi
200
- debug " Requesting pre-shutdown ..."
201
- STATE=$( timeout 5s docker exec syncd /usr/bin/syncd_request_shutdown --pre & > /dev/null; if [[ $? == 124 ]]; then echo " timed out" ; fi)
200
+ if [[ " $REBOOT_TYPE " = " express-reboot" ]]; then
201
+ debug " Requesting express boot pre-shutdown ..."
202
+ STATE=$( timeout 5s docker exec syncd /usr/bin/syncd_request_shutdown --pxe & > /dev/null; if [[ $? == 124 ]]; then echo " timed out" ; fi)
203
+ else
204
+ debug " Requesting pre-shutdown ..."
205
+ STATE=$( timeout 5s docker exec syncd /usr/bin/syncd_request_shutdown --pre & > /dev/null; if [[ $? == 124 ]]; then echo " timed out" ; fi)
206
+ fi
202
207
if [[ x" ${STATE} " == x" timed out" ]]; then
203
208
error " Failed to request pre-shutdown"
204
209
fi
@@ -245,7 +250,7 @@ function backup_database()
245
250
{
246
251
debug " Backing up database ..."
247
252
248
- if [[ " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " fast-reboot" ]]; then
253
+ if [[ " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " express-reboot " || " $REBOOT_TYPE " = " fast-reboot" ]]; then
249
254
# Advanced reboot: dump state to host disk
250
255
sonic-db-cli ASIC_DB FLUSHDB > /dev/null
251
256
sonic-db-cli COUNTERS_DB FLUSHDB > /dev/null
@@ -475,7 +480,7 @@ function check_docker_exec()
475
480
476
481
function check_db_integrity()
477
482
{
478
- if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " fast-reboot" ]]; then
483
+ if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " express-reboot " || " $REBOOT_TYPE " = " fast-reboot" ]]; then
479
484
CHECK_DB_INTEGRITY=0
480
485
/usr/local/bin/check_db_integrity.py || CHECK_DB_INTEGRITY=$?
481
486
if [[ CHECK_DB_INTEGRITY -ne 0 ]]; then
@@ -520,7 +525,7 @@ function reboot_pre_check()
520
525
# Make sure ASIC configuration has not changed between images
521
526
ASIC_CONFIG_CHECK_SCRIPT=" /usr/local/bin/asic_config_check"
522
527
ASIC_CONFIG_CHECK_SUCCESS=0
523
- if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" ]]; then
528
+ if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " express-reboot " ]]; then
524
529
ASIC_CONFIG_CHECK_EXIT_CODE=0
525
530
${ASIC_CONFIG_CHECK_SCRIPT} || ASIC_CONFIG_CHECK_EXIT_CODE=$?
526
531
@@ -604,6 +609,9 @@ function check_conflict_boot_in_fw_update() {
604
609
" warm-reboot" )
605
610
FW_AU_TASK_FILE_EXP=" ${FIRMWARE_AU_STATUS_DIR} /warm_fw_au_task"
606
611
;;
612
+ " express-reboot" )
613
+ FW_AU_TASK_FILE_EXP=" ${FIRMWARE_AU_STATUS_DIR} /express_fw_au_task"
614
+ ;;
607
615
esac
608
616
FW_AU_TASK_FILE=$( compgen -G ${FW_AU_TASK_FILE_REGEX} ) || true
609
617
if [[ -n " ${FW_AU_TASK_FILE} " ]] && [[ ! -f " ${FW_AU_TASK_FILE_EXP} " ]]; then
@@ -631,12 +639,15 @@ if [[ x"${DETACH}" == x"yes" && x"${ALREADY_DETACHED}" == x"" ]]; then
631
639
exit $?
632
640
fi
633
641
642
+ sonic_asic_type=$( sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
643
+ if [[ " $REBOOT_TYPE " = " express-reboot" ]] && [[ " $sonic_asic_type " != " cisco-8000" ]]; then
644
+ echo " eXpress Boot is not supported"
645
+ exit " ${EXIT_FAILURE} "
646
+ fi
634
647
635
648
check_conflict_boot_in_fw_update
636
649
637
650
638
- sonic_asic_type=$( sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
639
-
640
651
# Check reboot type supported
641
652
BOOT_TYPE_ARG=" cold"
642
653
case " $REBOOT_TYPE " in
@@ -662,6 +673,12 @@ case "$REBOOT_TYPE" in
662
673
trap clear_boot EXIT HUP INT QUIT TERM KILL ABRT ALRM
663
674
config warm_restart enable system
664
675
;;
676
+ " express-reboot" )
677
+ check_warm_restart_in_progress
678
+ BOOT_TYPE_ARG=" express"
679
+ trap clear_boot EXIT HUP INT QUIT TERM KILL ABRT ALRM
680
+ config warm_restart enable system
681
+ ;;
665
682
* )
666
683
error " Not supported reboot type: $REBOOT_TYPE "
667
684
exit " ${EXIT_NOT_SUPPORTED} "
@@ -710,7 +727,6 @@ if [[ "$sonic_asic_type" == "mellanox" ]]; then
710
727
fi
711
728
fi
712
729
713
-
714
730
if is_secureboot && grep -q aboot_machine= /host/machine.conf; then
715
731
load_aboot_secureboot_kernel
716
732
else
@@ -731,7 +747,7 @@ init_warm_reboot_states
731
747
setup_control_plane_assistant
732
748
733
749
TEAMD_INCREASE_RETRY_COUNT=0
734
- if [[ " ${REBOOT_TYPE} " = " warm-reboot" || " ${REBOOT_TYPE} " = " fastfast-reboot" ]]; then
750
+ if [[ " ${REBOOT_TYPE} " = " warm-reboot" || " ${REBOOT_TYPE} " = " fastfast-reboot" || " $REBOOT_TYPE " = " express-reboot " ]]; then
735
751
TEAMD_RETRY_COUNT_PROBE_RC=0
736
752
/usr/local/bin/teamd_increase_retry_count.py --probe-only || TEAMD_RETRY_COUNT_PROBE_RC=$?
737
753
if [[ ${TEAMD_RETRY_COUNT_PROBE_RC} -ne 0 ]]; then
@@ -746,7 +762,7 @@ if [[ "${REBOOT_TYPE}" = "warm-reboot" || "${REBOOT_TYPE}" = "fastfast-reboot" ]
746
762
fi
747
763
fi
748
764
749
- if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " fast-reboot" ]]; then
765
+ if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " express-reboot " || " $REBOOT_TYPE " = " fast-reboot" ]]; then
750
766
# Freeze orchagent for warm restart
751
767
# Ask orchagent_restart_check to try freeze 5 times with interval of 2 seconds,
752
768
# it is possible that the orchagent is in transient state and no opportunity to freeze
@@ -774,7 +790,7 @@ if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
774
790
fi
775
791
fi
776
792
777
- if [[ ( " ${REBOOT_TYPE} " = " warm-reboot" || " ${REBOOT_TYPE} " = " fastfast-reboot" ) && " ${TEAMD_INCREASE_RETRY_COUNT} " -eq 1 ]]; then
793
+ if [[ ( " ${REBOOT_TYPE} " = " warm-reboot" || " ${REBOOT_TYPE} " = " fastfast-reboot" || " ${REBOOT_TYPE} " = " express-reboot " ) && " ${TEAMD_INCREASE_RETRY_COUNT} " -eq 1 ]]; then
778
794
/usr/local/bin/teamd_increase_retry_count.py
779
795
fi
780
796
@@ -817,6 +833,10 @@ for timer in ${TIMERS}; do
817
833
debug " Stopped ${timer} ..."
818
834
done
819
835
836
+ if [[ " ${REBOOT_TYPE} " == " express-reboot" ]]; then
837
+ SHUTDOWN_ORDER_FILE=" /etc/sonic/warm-reboot_order"
838
+ fi
839
+
820
840
if [[ -f ${SHUTDOWN_ORDER_FILE} ]]; then
821
841
SERVICES_TO_STOP=" $( cat ${SHUTDOWN_ORDER_FILE} ) "
822
842
else
@@ -853,7 +873,7 @@ for service in ${SERVICES_TO_STOP}; do
853
873
debug " Stopped ${service} "
854
874
855
875
if [[ " ${service} " = " swss" ]]; then
856
- if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" ]]; then
876
+ if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" || " $REBOOT_TYPE " = " express-reboot " ]]; then
857
877
# Pre-shutdown syncd
858
878
initialize_pre_shutdown
859
879
0 commit comments