# Defaults for kexec initscript
# sourced by kexec-tools.config, /etc/init.d/kexec and /etc/init.d/kexec-load

# Load a kexec kernel (true/false)
LOAD_KEXEC=true

# Kernel and initrd image
# Unused: wiperam-reconfigure-kexec appends the correct values to this file
#         at boot time.
KERNEL_IMAGE="/vmlinuz"
INITRD="/initrd.img"

rebooting() {
   systemctl list-jobs systemd-reboot.service | grep -qs systemd-reboot.service
}

if rebooting ; then
   APPEND="${APPEND} sdmem=reboot sdmemopts=vllf"
else
   APPEND="${APPEND} sdmem=halt sdmemopts=vllf"
fi

# For some reason (don't ask), leading spaces in the string passed to kexec's
# --append option make it ignored.
APPEND=$(echo "$APPEND" | sed -r -e 's,^\s+,,')
