mirror of
https://git.proxmox.com/git/grub2
synced 2025-10-29 17:31:06 +00:00
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
14 lines
301 B
C
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);
|
|
}
|