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 <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2018-06-04 18:28:07 +02:00 committed by Peter Jones
parent cee2256e1c
commit 64420615c2

View File

@ -87,6 +87,16 @@ case "$COMMAND" in
>"${BLS_TARGET}" >"${BLS_TARGET}"
fi 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 eval "$(grub2-get-kernel-settings)" || true
if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then
ARCH="$(uname -m)" ARCH="$(uname -m)"