- Package:
- grub-common
- Source:
- grub2
- Description:
- GRand Unified Bootloader (common files)
- Submitter:
- Rodrigo Valiña Gutiérrez
- Date:
- 2025-06-07 10:03:02 UTC
- Severity:
- normal
- Tags:
The script /etc/grub.d/30_os-prober does not provide the correct device name
for booting the Hurd, e.g. when installed with crosshurd.
The bug also applies to the grub version currently in sid.
The patch changes provided device names from, e.g.:
(hostdisk//dev/sda,msdos2)
to:
hd0s2
This is the patch that solved the problem in my case, and may be correct:
-----------------------------------------------------------------------------
--- 30_os-prober 2016-02-05 18:30:35.000000000 +0100
+++ 30_os-prober-2 2016-05-25 17:13:17.518318125 +0200
@@ -332,13 +332,14 @@
prepare_grub_to_access_device ${DEVICE} | grub_add_tab
grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`"
+ hurd_device=`${grub_probe} --device ${DEVICE} --target=compatibility_hint | sed 's/,msdos/s/'`
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
case "${grub_fs}" in
*fs) hurd_fs="${grub_fs}" ;;
*) hurd_fs="${grub_fs}fs" ;;
esac
cat << EOF
- multiboot /boot/gnumach.gz root=device:${mach_device}
+ multiboot /boot/gnumach.gz root=device:${hurd_device}
module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
--multiboot-command-line='\${kernel-command-line}' \\
--host-priv-port='\${host-port}' \\
-----------------------------------------------------------------------------
Hello, Rodrigo Valiña Gutiérrez, on Wed 25 May 2016 17:53:47 +0200, wrote: Why adding another variable, instead of just fixing mach_device? I guess grub-probe simply changed something and the mach_device definition needs to be updated. This is really meant to be a mach device name, not a "hurd device name". Samuel
I understand. I did not know the exact terminology. So the patch might boil down to:------------------------------------------------------------------------------------------------- --- 30_os-prober 2016-02-05 18:30:35.000000000 +0100 +++ 30_os-prober-3 2016-05-26 11:54:35.819822599 +0200 @@ -331,7 +331,7 @@ save_default_entry | grub_add_tab prepare_grub_to_access_device ${DEVICE} | grub_add_tab grub_device="`${grub_probe} --device ${DEVICE} --target=drive`" - mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`" + mach_device=`${grub_probe} --device ${DEVICE} --target=compatibility_hint | sed 's/,msdos/s/'` grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`" case "${grub_fs}" in *fs) hurd_fs="${grub_fs}" ;; ------------------------------------------------------------------------------------------------- So this is one more step to get working flawlessly and out of the box the procedure at: https://www.gnu.org/software/hurd/hurd/running/debian/CrossInstall.html It remains at least to determine whether --readonly is needed, and maybe to provide a way to boot in single user mode (-s) (needed for the first two reboots). By the moment it does not work out of the box yet because of these and maybe other issues. Rodrigo.
Hello, Rodrigo Valiña Gutiérrez, on Thu 26 May 2016 12:05:37 +0200, wrote: Yes, that should be correct. Note that it's the 30_os-prober.in file which needs to be modified. Also, since this is an upstream file, you should probably contact upstream to get it integrated there, so Debian doesn't maintain the change ad æternam. Yes it is. That would be useful indeed. Samuel
El 30/5/2016 21:07, "Samuel Thibault" <sthibault@debian.org> escribió: Ok. Reported upstream at: http://savannah.gnu.org/bugs/?48068
This issue remains unresolved. As a result, the grub.cfg fragment generated by 30_os-prober is still incorrect and thus still fails to tell Hurd the correct disk to boot from. Please compare to the fragment generated via 40_custom later in the config. Martin-Éric