MaddieM4 / os-prober

Tool for adding other distros to GRUB. A fork of the original Debian util, but designed to be more distro-agnostic.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linux-boot-prober fails when $mpoint/boot is on a separate file system

jw-rav opened this issue · comments

Cause of the problem is a wrong negation of the result of the grep command. As a result, update-grub creates bad (that is, not bootable) menu entries for such installs.

This fixes the problem for me:

--- /usr/bin/linux-boot-prober~  2024-06-22 01:14:33.544288655 +0200
+++ /usr/bin/linux-boot-prober 2024-06-22 01:09:52.722376766 +0200
@@ -35,7 +35,7 @@
        mpoint="$(unescape_mount "$mpoint")"
        if [ "$mpoint" != "/target/boot" ] && [ "$mpoint" != "/target" ] && [ "$mpoint" != "/" ]; then
                type=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 3)
-               if ! grep -q " $mpoint/boot " "$OS_PROBER_TMP/mounted-map"; then
+               if grep -q " $mpoint/boot " "$OS_PROBER_TMP/mounted-map"; then
                        linux_mount_boot "$partition" "$mpoint"
                        bootpart="${mountboot%% *}"
                        bootmounted="${mountboot#* }"