Created attachment 405822 [details, diff] Suggested patch for /etc/init.d/kexec In the stop() function of /etc/init.d/kexec the check for LOAD_DURING SHUTDOWN is performed before checking RC_REBOOT and /nokexec - hence if the image has already been loaded (LOAD_DURING_SHUTDOWN == "no") then manually stopping kexec does not unload the image. Was this the intention, it shouldn't be. And another minor issue: DONT_MOUNT_BOOT is not checked against actual value, merely if it is set or no. I'm uploading a suggested patch: --- a/etc/init.d/kexec 2015-05-31 01:52:47.000000000 +1000 +++ a/etc/init.d/kexec 2015-06-27 09:44:49.606644040 +1000 @@ -45,21 +45,21 @@ return 0 fi done return 1 } mount_boot(){ local ret - [ -n "${DONT_MOUNT_BOOT}" ] && return 1 + [ "${DONT_MOUNT_BOOT:-no}" = "no" ] || return 1 grep -q " ${BOOTPART:-/boot} " /proc/mounts && return 1 BOOTPART="${BOOTPART:-/boot}" ebegin "Mounting ${BOOTPART}" mount "${BOOTPART}"; ret=$? eend ${ret} return ${ret} } load_image() { @@ -137,29 +137,29 @@ fi return ${ret} else ebegin "Configuring kexec" load_image eend $? fi } stop() { - [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0 - if ! yesno $RC_REBOOT; then einfo "Not rebooting, so disabling" kexec -u return 0 fi if [ -f /nokexec ]; then einfo "Not using kexec during reboot" rm -f /nokexec kexec -u return 0 fi + [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0 + ebegin "Configuring kexec" load_image eend $? }
+*kexec-tools-2.0.9-r2 (29 Jun 2015) + + 29 Jun 2015; Justin Lecher <jlec@gentoo.org> +files/kexec.init-2.0.4-r3, + +kexec-tools-2.0.9-r2.ebuild: + Correctly handle loaded image during reboot with LOAD_DURING_SHUTDOWN, bug + #553372; thanks AaylaSecura for the patch +