mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-28 07:44:52 +00:00
20-grub-install: Use relative paths for btrfs in BLS snippets
When SUSE_BTRFS_SNAPSHOT_BOOTING=true is set in /etc/default/grub, paths to kernel and initrd images need to be relative. Since are used along with snapper, configured so the default btrfs subvolume is the current snapshot. Resolves: rhbz#1906191
This commit is contained in:
parent
419340f25e
commit
fbeda573a9
1 changed files with 6 additions and 1 deletions
|
@ -112,7 +112,12 @@ case "$COMMAND" in
|
||||||
|
|
||||||
LINUX="$(grep '^linux[ \t]' "${BLS_TARGET}" | sed -e 's,^linux[ \t]*,,')"
|
LINUX="$(grep '^linux[ \t]' "${BLS_TARGET}" | sed -e 's,^linux[ \t]*,,')"
|
||||||
INITRD="$(grep '^initrd[ \t]' "${BLS_TARGET}" | sed -e 's,^initrd[ \t]*,,')"
|
INITRD="$(grep '^initrd[ \t]' "${BLS_TARGET}" | sed -e 's,^initrd[ \t]*,,')"
|
||||||
|
if [[ "$(grub2-probe --device $(grub2-probe --target=device /) --target=fs)" == "btrfs" &&
|
||||||
|
"${SUSE_BTRFS_SNAPSHOT_BOOTING}" == "true" ]]; then
|
||||||
|
LINUX_RELPATH="$(grub2-mkrelpath -r /boot${LINUX})"
|
||||||
|
else
|
||||||
LINUX_RELPATH="$(grub2-mkrelpath /boot${LINUX})"
|
LINUX_RELPATH="$(grub2-mkrelpath /boot${LINUX})"
|
||||||
|
fi
|
||||||
BOOTPREFIX="$(dirname ${LINUX_RELPATH})"
|
BOOTPREFIX="$(dirname ${LINUX_RELPATH})"
|
||||||
ROOTPREFIX="$(dirname "/boot${LINUX}")"
|
ROOTPREFIX="$(dirname "/boot${LINUX}")"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue