#!/usr/bin/env bash # Defaults LAYOUT=compat BOOTPART=/boot KNAME=kernel INITRD=initramfs.img instkern_state=/var/lib/misc/installkernel if [[ -s ${instkern_state} ]]; then # If we have a log file, set defaults from there. IFS=$'\t' read -r -a LastKernArray <<< "$(tail -n1 ${instkern_state})" LAYOUT="${LastKernArray[4]}" BOOTPART="${LastKernArray[7]}" KNAME="${LastKernArray[8]}" if [[ "${LastKernArray[9]}" != unknown && ${LAYOUT} != uki ]]; then INITRD="${LastKernArray[9]}" else INITRD= fi fi if [[ ${LAYOUT} == uki ]]; then echo "WARNING: kexec currently does not support UKIs" KPARAM= else if [[ -f /etc/kernel/cmdline ]]; then KPARAM="$(tr -s "${IFS}" ' '