Bug#1006495: hurd: Add probing for wd disks

Samuel Thibault sthibault at debian.org
Sun Oct 18 16:20:04 BST 2026


Hello,

Samuel Thibault, le sam. 26 févr. 2022 12:55:28 +0100, a ecrit:
> The Hurd is moving to rump-based disk drivers, which are named wd*. We
> thus need grub2 to probe for them so as to propose them for installing
> grub. The attached patch implements this.

Here is an updated patch, as well as an additional patch for the
/dev/ud* files (USB disk)

Samuel
-------------- next part --------------
Index: grub2-2.06/util/deviceiter.c
===================================================================
--- grub2-2.06.orig/util/deviceiter.c
+++ grub2-2.06/util/deviceiter.c
@@ -392,6 +392,14 @@ get_fio_disk_name (char *name, int unit)
 }
 #endif
 
+#ifdef __GNU__
+static void
+get_rump_disk_name (char *name, int unit)
+{
+  sprintf (name, "/dev/wd%d", unit);
+}
+#endif
+
 static struct seen_device
 {
   struct seen_device *next;
@@ -1041,6 +1049,21 @@ dmraid_end:
 # endif /* HAVE_DEVICE_MAPPER */
 #endif /* __linux__ */
 
+#ifdef __GNU__
+  /* Rump-supported disks.  */
+  for (i = 0; i < 96; i++)
+    {
+      char name[16];
+
+      get_rump_disk_name (name, i);
+      if (check_device_readable_unique (name))
+	{
+	  if (hook (name, 0, hook_data))
+	    goto out;
+	}
+    }
+#endif /* __GNU__ */
+
 out:
   clear_seen_devices ();
 }
-------------- next part --------------
Index: grub2-2.12/util/deviceiter.c
===================================================================
--- grub2-2.12.orig/util/deviceiter.c
+++ grub2-2.12/util/deviceiter.c
@@ -398,6 +398,12 @@ get_rump_disk_name (char *name, int unit
 {
   sprintf (name, "/dev/wd%d", unit);
 }
+
+static void
+get_rump_usb_disk_name (char *name, int unit)
+{
+  sprintf (name, "/dev/ud%d", unit);
+}
 #endif
 
 static struct seen_device
@@ -1059,6 +1065,19 @@ dmraid_end:
       if (check_device_readable_unique (name))
 	{
 	  if (hook (name, 0, hook_data))
+	    goto out;
+	}
+    }
+
+  /* Rump-supported USB disks.  */
+  for (i = 0; i < 96; i++)
+    {
+      char name[16];
+
+      get_rump_usb_disk_name (name, i);
+      if (check_device_readable_unique (name))
+	{
+	  if (hook (name, 0, hook_data))
 	    goto out;
 	}
     }


More information about the Pkg-grub-devel mailing list