From 64420615c2bb2e2d270a948ff05358aa1ad5595e Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 4 Jun 2018 18:28:07 +0200 Subject: [PATCH] More fixes for BLS Add some fixes for BLS parsing logic and also make 20-grub.install script to query the relative path of the kernel and initramfs images, so BLS can also work when /boot is not a mount point or is a btrfs subvolume. Also pull some build fixes. Resolves: rhbz#1588184 Signed-off-by: Javier Martinez Canillas --- 20-grub.install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/20-grub.install b/20-grub.install index 4cf8fe6..8c6ae68 100755 --- a/20-grub.install +++ b/20-grub.install @@ -87,6 +87,16 @@ case "$COMMAND" in >"${BLS_TARGET}" fi + LINUX="$(grep '^linux[ \t]' "${BLS_TARGET}" | sed -e 's,^linux[ \t]*,,')" + INITRD="$(grep '^initrd[ \t]' "${BLS_TARGET}" | sed -e 's,^initrd[ \t]*,,')" + LINUX_RELPATH="$(grub2-mkrelpath /boot${LINUX})" + BOOTPREFIX="$(dirname ${LINUX_RELPATH})" + + if [[ $LINUX != $LINUX_RELPATH ]]; then + sed -i -e "s,^linux.*,linux ${BOOTPREFIX}${LINUX},g" "${BLS_TARGET}" + sed -i -e "s,^initrd.*,initrd ${BOOTPREFIX}${INITRD},g" "${BLS_TARGET}" + fi + eval "$(grub2-get-kernel-settings)" || true if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then ARCH="$(uname -m)"