#1103935 os-prober: Hurd detection produces unusable grub.cfg fragment

Package:
os-prober
Source:
os-prober
Description:
utility to detect other OSes on a set of drives
Submitter:
Martin-Éric Racine
Date:
2025-04-23 06:33:01 UTC
Severity:
normal
#1103935#5
Date:
2025-04-23 04:08:22 UTC
From:
To:
In its current form, os-prober produces an unusable GRUB config segment when it finds a Hurd partition:

1) It wants to boot a /boot/gnumach.gz file that doesn't exist. Mach kernel files include version numbers.

Once that has been manually fixed in grub.cfg to e.g. /boot/gnumach-1.8-486-up.gz, a second problem emerges:

2) The config fragment passes the incorrect root device, which makes the Mach kernel fail to find its Hurd of services.

What's expected is something like this (for each Mach kernel found):

menuentry "Debian GNU/Hurd, with Mach 1.8" {
        set root='hd0,msdos1'
        echo    'Loading GNU Mach ...'
        multiboot       /boot/gnumach-1.8-486-up.gz root=part:1:device:hd0
        echo    'Loading the Hurd ...'
        module  /hurd/pci-arbiter.static pci-arbiter \
                --host-priv-port='${host-port}' --device-master-port='${device-port}' \
                --next-task='${acpi-task}' \
                '$(pci-task=task-create)' '$(task-resume)'
        module  /hurd/acpi.static acpi \
                --next-task='${disk-task}' \
                '$(acpi-task=task-create)'
        module  /hurd/rumpdisk.static rumpdisk \
                --next-task='${fs-task}' \
                '$(disk-task=task-create)'
        module  /hurd/ext2fs.static ext2fs \
                --multiboot-command-line='${kernel-command-line}' \
                --exec-server-task='${exec-task}' -T typed '${root}' \
                '$(fs-task=task-create)'
        module  /hurd/exec.static exec '$(exec-task=task-create)'
}

Perhaps it would be a good idea for os-prober to copy the 10_hurd script that comes with GRUB for the Hurd port, passing it the correct root device for the Hurd partition (instead of the Linux partition that os-prober runs from), to generate the menu entries.

Martin-Éric

#1103935#10
Date:
2025-04-23 06:13:08 UTC
From:
To:
os-prober does not generate GRUB menu entries. It just detects operating
systems, and GRUB helper script 30_os-prober uses its output to generate
menu entries. Is os-prober output for Hurd incorrect ?

#1103935#15
Date:
2025-04-23 06:20:11 UTC
From:
To:
ke 23.4.2025 klo 9.13 Pascal Hambourg (pascal@plouf.fr.eu.org) kirjoitti:

Yes, as stated above, the output is incorrect.

Martin-Éric

#1103935#20
Date:
2025-04-23 06:25:43 UTC
From:
To:
ke 23.4.2025 klo 9.20 Martin-Éric Racine (martin-eric.racine@iki.fi) kirjoitti:

More precisely, what 30_os-prober produces is incorrect. Looking
towards the end of the script is where the incorrect menu entry gets
generated. If you think that this makes it a bin:grub-common issue,
you're welcome to reassign the bug.

Martin-Éric

#1103935#25
Date:
2025-04-23 06:30:04 UTC
From:
To:
Can you show a raw os-prober actual output (not the resulting GRUB menu
entry) for Hurd and what you think it should be ?