grub2/util/devicemap.c
Colin Watson 9f2b1f4747 Restore grub-mkdevicemap
This is kind of a mess, requiring lots of OS-specific code to iterate
over all possible devices.  However, we use it in a number of scripts to
discover devices and reimplementing those in terms of something else
would be very complicated.

Author: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Forwarded: no
Last-Update: 2016-09-18

Patch-Name: restore_mkdevicemap.patch
2016-09-18 18:15:55 +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);
}