+2011-06-16 Robert Millan <rmh@gnu.org>
+
+ Detect `ataraid' devices on GNU/kFreeBSD. Fix for ATA devices using
+ `ata' driver on kernel of FreeBSD 9.
+
+ * util/deviceiter.c [__FreeBSD_kernel__] (get_ada_disk_name)
+ (get_ataraid_disk_name): New functions.
+ [__FreeBSD_kernel__] (grub_util_iterate_devices): Scan for ataraid
+ (/dev/ar[0-9]+) and ada (/dev/ada[0-9]+) devices using
+ get_ataraid_disk_name() and get_ada_disk_name().
+
2011-06-13 Colin Watson <cjwatson@ubuntu.com>
* docs/man/grub-mklayout.h2m (DESCRIPTION): Add a reference to the
/* deviceiter.c - iterate over system devices */
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc.
+ * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2011 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#endif
}
+#ifdef __FreeBSD_kernel__
+static void
+get_ada_disk_name (char *name, int unit)
+{
+ sprintf (name, "/dev/ada%d", unit);
+}
+
+static void
+get_ataraid_disk_name (char *name, int unit)
+{
+ sprintf (name, "/dev/ar%d", unit);
+}
+#endif
+
#ifdef __linux__
static void
get_virtio_disk_name (char *name, int unit)
}
}
+#ifdef __FreeBSD_kernel__
+ /* IDE disks using ATA Direct Access driver. */
+ if (get_kfreebsd_version () >= 800000)
+ for (i = 0; i < 96; i++)
+ {
+ char name[16];
+
+ get_ada_disk_name (name, i);
+ if (check_device_readable_unique (name))
+ {
+ if (hook (name, 0))
+ goto out;
+ }
+ }
+
+ /* ATARAID disks. */
+ for (i = 0; i < 8; i++)
+ {
+ char name[20];
+
+ get_ataraid_disk_name (name, i);
+ if (check_device_readable_unique (name))
+ {
+ if (hook (name, 0))
+ goto out;
+ }
+ }
+#endif
+
#ifdef __linux__
/* Virtio disks. */
for (i = 0; i < 26; i++)