simplify kernel setting

This commit is contained in:
Tobias Powalowski 2023-09-03 16:05:46 +02:00
parent df8186b339
commit cfae715ae5

View file

@ -186,16 +186,13 @@ fi
[[ -e /dev/fd ]] || die "/dev must be mounted!" [[ -e /dev/fd ]] || die "/dev must be mounted!"
! . "$_f_config" 2>"${_NO_LOG}" && die "Failed to read configuration '%s'" "$_f_config" ! . "$_f_config" 2>"${_NO_LOG}" && die "Failed to read configuration '%s'" "$_f_config"
if [[ -z "${KERNEL}" ]]; then if [[ -z "${KERNEL}" ]]; then
msg "Autodetecting kernel from ${_RUNNING_ARCH}" msg "Fallback to kernel from ${_RUNNING_ARCH}"
[[ "${_RUNNING_ARCH}" == "x86_64" || "${_RUNNING_ARCH}" == "riscv64" ]] && KERNEL="/usr/lib/modules/*/vmlinuz" [[ "${_RUNNING_ARCH}" == "x86_64" || "${_RUNNING_ARCH}" == "riscv64" ]] && KERNEL="/usr/lib/modules/*/vmlinuz"
[[ "${_RUNNING_ARCH}" == "aarch64" ]] && KERNEL="/boot/Image.gz" [[ "${_RUNNING_ARCH}" == "aarch64" ]] && KERNEL="/boot/Image.gz"
fi
# allow * in config # allow * in config
KERNEL="$(echo ${KERNEL})" KERNEL="$(echo ${KERNEL})"
msg "Using kernel: ${KERNEL}"
else
KERNEL="$(echo ${KERNEL})"
msg "Using specified kernel: ${KERNEL}" msg "Using specified kernel: ${KERNEL}"
fi
if [[ ! -f "${KERNEL}" ]]; then if [[ ! -f "${KERNEL}" ]]; then
die "specified kernel image does not exist!" die "specified kernel image does not exist!"
fi fi