2008-05-05 Christian Franke <franke@computer.org>
* util/grub-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]: Add Cygwin device names. (get_ide_disk_name) [__CYGWIN__]: Likewise. (get_scsi_disk_name) [__CYGWIN__]: Likewise. (check_device): Return error instead of success on empty name. (make_device_map): Move label inside linux specific code to prevent compiler warning.
This commit is contained in:
parent
8124cdb77e
commit
0fbb311786
2 changed files with 24 additions and 3 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2008-05-05 Christian Franke <franke@computer.org>
|
||||||
|
|
||||||
|
* util/grub-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]:
|
||||||
|
Add Cygwin device names.
|
||||||
|
(get_ide_disk_name) [__CYGWIN__]: Likewise.
|
||||||
|
(get_scsi_disk_name) [__CYGWIN__]: Likewise.
|
||||||
|
(check_device): Return error instead of success on empty name.
|
||||||
|
(make_device_map): Move label inside linux specific code to
|
||||||
|
prevent compiler warning.
|
||||||
|
|
||||||
2008-04-30 Robert Millan <rmh@aybabtu.com>
|
2008-04-30 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
Based on patch from Fabian Greffrath <greffrath@leat.rub.de>
|
Based on patch from Fabian Greffrath <greffrath@leat.rub.de>
|
||||||
|
|
|
@ -166,6 +166,9 @@ get_floppy_disk_name (char *name, int unit)
|
||||||
#elif defined(__QNXNTO__)
|
#elif defined(__QNXNTO__)
|
||||||
/* QNX RTP */
|
/* QNX RTP */
|
||||||
sprintf (name, "/dev/fd%d", unit);
|
sprintf (name, "/dev/fd%d", unit);
|
||||||
|
#elif defined(__CYGWIN__)
|
||||||
|
/* Cygwin */
|
||||||
|
sprintf (name, "/dev/fd%d", unit);
|
||||||
#else
|
#else
|
||||||
# warning "BIOS floppy drives cannot be guessed in your operating system."
|
# warning "BIOS floppy drives cannot be guessed in your operating system."
|
||||||
/* Set NAME to a bogus string. */
|
/* Set NAME to a bogus string. */
|
||||||
|
@ -207,6 +210,10 @@ get_ide_disk_name (char *name, int unit)
|
||||||
/* Actually, QNX RTP doesn't distinguish IDE from SCSI, so this could
|
/* Actually, QNX RTP doesn't distinguish IDE from SCSI, so this could
|
||||||
contain SCSI disks. */
|
contain SCSI disks. */
|
||||||
sprintf (name, "/dev/hd%d", unit);
|
sprintf (name, "/dev/hd%d", unit);
|
||||||
|
#elif defined(__CYGWIN__)
|
||||||
|
/* Cygwin emulates all disks as /dev/sdX. */
|
||||||
|
(void) unit;
|
||||||
|
*name = 0;
|
||||||
#else
|
#else
|
||||||
# warning "BIOS IDE drives cannot be guessed in your operating system."
|
# warning "BIOS IDE drives cannot be guessed in your operating system."
|
||||||
/* Set NAME to a bogus string. */
|
/* Set NAME to a bogus string. */
|
||||||
|
@ -248,6 +255,9 @@ get_scsi_disk_name (char *name, int unit)
|
||||||
/* QNX RTP doesn't distinguish SCSI from IDE, so it is better to
|
/* QNX RTP doesn't distinguish SCSI from IDE, so it is better to
|
||||||
disable the detection of SCSI disks here. */
|
disable the detection of SCSI disks here. */
|
||||||
*name = 0;
|
*name = 0;
|
||||||
|
#elif defined(__CYGWIN__)
|
||||||
|
/* Cygwin emulates all disks as /dev/sdX. */
|
||||||
|
sprintf (name, "/dev/sd%c", unit + 'a');
|
||||||
#else
|
#else
|
||||||
# warning "BIOS SCSI drives cannot be guessed in your operating system."
|
# warning "BIOS SCSI drives cannot be guessed in your operating system."
|
||||||
/* Set NAME to a bogus string. */
|
/* Set NAME to a bogus string. */
|
||||||
|
@ -283,9 +293,9 @@ check_device (const char *device)
|
||||||
char buf[512];
|
char buf[512];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
/* If DEVICE is empty, just return 1. */
|
/* If DEVICE is empty, just return error. */
|
||||||
if (*device == 0)
|
if (*device == 0)
|
||||||
return 1;
|
return 0;
|
||||||
|
|
||||||
fp = fopen (device, "r");
|
fp = fopen (device, "r");
|
||||||
if (! fp)
|
if (! fp)
|
||||||
|
@ -513,9 +523,10 @@ make_device_map (const char *device_map, int floppy_disks)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* __linux__ */
|
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
|
#endif /* __linux__ */
|
||||||
|
|
||||||
if (fp != stdout)
|
if (fp != stdout)
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue