From a7d0b85ede3dde023a695856c813003fa1ce0c95 Mon Sep 17 00:00:00 2001 From: Jonathan Steffan Date: Aug 04 2023 01:34:44 +0000 Subject: Update kernel-install Plugin - Update memtest86+.kernel-install-plugin to fallback to 20-grub.install behaviour (RHBZ#2137395) --- diff --git a/memtest86+.kernel-install-plugin b/memtest86+.kernel-install-plugin index 9710771..b87aea7 100644 --- a/memtest86+.kernel-install-plugin +++ b/memtest86+.kernel-install-plugin @@ -1,4 +1,8 @@ #!/usr/bin/bash +# +# Manage memtest86+ install location and bootloader config. +# Currently only manages GRUB with BLS support enabled. +# # Sanity Checks if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then @@ -17,10 +21,16 @@ MEMTEST_VERSION="$2" BOOT_DIR_ABS="$3" MEMTEST_IMAGE="$4" -IMAGE_DIR="${MEMTEST_IMAGE%/*}" +MEMTEST_DIR="${MEMTEST_IMAGE%/*}" BOOT_ROOT="${KERNEL_INSTALL_BOOT_ROOT}" MACHINE_ID="${KERNEL_INSTALL_MACHINE_ID}" BLS_DIR="${BOOT_ROOT}/loader/entries" +# Fail back to /boot default if BLS_DIR +# doesn't exist already, matching 20-grub.install +if [[ ! -d "${BLS_DIR}" ]]; then + BOOT_ROOT="/boot" + BLS_DIR="/boot/loader/entries" +fi BLS_ENTRY="${BLS_DIR}/${MACHINE_ID}-0-memtest86+.conf" # Setup functions @@ -38,7 +48,7 @@ grub_class ${ID} EOF } -# If ${BOOT_DIR_ABS} exists, some other boot loader is active. +# If ${BOOT_DIR_ABS} exists, non-grub boot loader is active. [[ -d "${BOOT_DIR_ABS}" ]] && exit 0 case "$COMMAND" in