Skip to content
This repository was archived by the owner on Nov 15, 2025. It is now read-only.

Commit 1cdbff1

Browse files
kolyshkinkeszybz
authored andcommitted
kernel-install/90-loaderentry: fix when /boot is not mountpoint
I happen to have a machine where /boot is not a separate mountpoint, but rather just a directory under /. After upgrade to recent Fedora, I found out that grub2 can't find any new kernels. This happens because loadentry script generates kernel and initrd file paths relative to /boot, while grub2 expects path to be relative to the root of filesystem on which they are residing. This commit fixes this issue by using stat's %m to find the mount point of a partition holding the images, and using it as a prefix to be removed from ENTRY_DIR_ABS. Note that %m for stat requires coreutils 8.6, released in Oct 2010. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 6f646e0 commit 1cdbff1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/kernel-install/90-loaderentry.install

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ fi
1818

1919
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
2020

21-
ENTRY_DIR="/$MACHINE_ID/$KERNEL_VERSION"
22-
BOOT_ROOT=${ENTRY_DIR_ABS%$ENTRY_DIR}
21+
BOOT_ROOT=${ENTRY_DIR_ABS%/$MACHINE_ID/$KERNEL_VERSION}
22+
BOOT_MNT=$(stat -c %m $BOOT_ROOT)
23+
ENTRY_DIR=/${ENTRY_DIR_ABS#$BOOT_MNT}
2324

2425
if [[ $COMMAND == remove ]]; then
2526
rm -f "$BOOT_ROOT/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"

0 commit comments

Comments
 (0)