grub2/util/devicemap.c
Colin Watson 8fdff34828 Restore grub-mkdevicemap for now. While it's kind of a mess, requiring
lots of OS-specific code to iterate over all possible devices, we use it
in a number of scripts to discover devices and reimplementing those in
terms of something else would be very complicated.
2012-09-05 10:26:07 +01:00

14 lines
301 B
C

#include <stdio.h>
#include <grub/util/deviceiter.h>
void
grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy,
int *num_fd, int *num_hd)
{
if (is_floppy)
fprintf (fp, "(fd%d)\t%s\n", (*num_fd)++, name);
else
fprintf (fp, "(hd%d)\t%s\n", (*num_hd)++, name);
}