Detect LSI MegaRAID SAS (`mfi') devices on GNU/kFreeBSD.
* util/deviceiter.c [__FreeBSD_kernel__] (get_mfi_disk_name): New
function.
[__FreeBSD_kernel__] (grub_util_iterate_devices): Scan for mfi
(/dev/mfid[0-9]+) devices using get_mfi_disk_name().
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().
* util/deviceiter.c (grub_util_iterate_devices): Increase SCSI
limit to 48 (to cope with Sun Fire X4500), and IDE limit to 96
(its SATA disks are detected as slaveless IDE master drives on
kFreeBSD).
Reported by Carsten Aulbert.
2010-07-20 Colin Watson <cjwatson@ubuntu.com>
Generate device.map in something closer to the old ordering.
* util/deviceiter.c (struct device): New declaration.
(compare_file_names): Rename to ...
(compare_devices): ... this. Sort by kernel name in preference to
the stable by-id name, but keep the latter as a fallback comparison.
Update header comment.
(grub_util_iterate_devices) [__linux__]: Construct and sort an array
of `struct device' rather than of plain file names.
Also-By: Colin Watson <cjwatson@ubuntu.com>
possible on Linux.
* util/deviceiter.c (check_device): Rename to ...
(check_device_readable_unique): ... this. Update all callers.
Maintain and check a list of which devices (by canonicalized name)
have already been seen.
(clear_seen_devices): New function.
(compare_file_names) [__linux__]: New function.
(grub_util_iterate_devices): Clear the list of seen devices on exit
and (just in case) on entry.
(grub_util_iterate_devices) [__linux__]: Iterate over non-partition
devices in /dev/disk/by-id/, in sorted order. Remove DM-RAID
seen-devices list, superseded by general code in check_device.
(grub_device_mapper_supported): New function.
* include/grub/emu/misc.h (grub_device_mapper_supported): Add
prototype.
* kern/emu/hostdisk.c (find_partition_start): Check whether
device-mapper is supported before trying to use it.
* util/deviceiter.c (grub_util_iterate_devices): Likewise.
* conf/common.rmk (grub_mkdevicemap_SOURCES): Add kern/env.c,
kern/err.c, kern/list.c, and kern/misc.c.
* util/deviceiter.c [__linux__]: Define MINOR.
(grub_util_iterate_devices): Add support for DM-RAID disk devices.
* util/mkdevicemap.c (grub_putchar): New function.
(grub_getkey): New function.
(grub_refresh): New function.
(main): Set debug=all if -v -v is used.
* util/sparc64/ieee1275/grub-setup.c: New file.
* util/sparc64/ieee1275/grub-ofpathname.c: New file.
* util/sparc64/ieee1275/grub-mkimage.c: New file.
* util/sparc64/ieee1275/grub-install.in: New file.
* util/ieee1275/ofpath.c: New file.
* util/ieee1275/devicemap.c: New file.
* util/devicemap.c: New file.
* util/deviceiter.c: New file.
* kern/sparc64/ieee1275/init.c: New file.
* include/grub/util/ofpath.h: New file.
* include/grub/util/deviceiter.h: New file.
* util/grub-mkdevicemap.c: Include deviceiter.h.
Implement using grub_util_emit_devicemap_entry and
grub_util_iterate_devices.
* conf/i386-corebook.rmk: Build util/deviceiter.c and
util/devicemap.c into grub-mkdevicemap
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Add rules to build boot block
images and installation utilities. Build kernel as image
instead of as elf binary. Use common rules as much as possible.