From 1879fd02ea74ff5426b41e7fe7452729bc1fc169 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Mon, 19 Nov 2018 19:11:17 -0800 Subject: [PATCH] [warm reboot] unload kexec before rebooting and when error exiting from warm boot (#383) Signed-off-by: Ying Xie --- scripts/fast-reboot | 1 + scripts/reboot | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 2e4e386773aa..a3e666f7c3ff 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -9,6 +9,7 @@ WARM_DIR=/host/warmboot function clear_warm_boot() { config warm_restart disable || /bin/true + /sbin/kexec -u || /bin/true TIMESTAMP=`date +%Y%m%d-%H%M%S` if [[ -f ${WARM_DIR}/config_db.json ]]; then diff --git a/scripts/reboot b/scripts/reboot index c420d9e512ed..2fdedfc70dcb 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -23,6 +23,7 @@ function clear_warm_boot() if [[ -f ${WARM_DIR}/config_db.json ]]; then mv -f ${WARM_DIR}/config_db.json ${WARM_DIR}/config_db-${TIMESTAMP}.json fi + /sbin/kexec -u || /bin/true } # Exit if not superuser