Handle IBM OFW path.
* util/ieee1275/ofpath.c (find_obppath): Use devspec if obppath isn't available. (of_path_of_scsi): Handle vdevice.
This commit is contained in:
parent
efbeefe90f
commit
4557a36d2c
2 changed files with 41 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2012-06-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Handle IBM OFW path.
|
||||||
|
|
||||||
|
* util/ieee1275/ofpath.c (find_obppath): Use devspec if obppath isn't
|
||||||
|
available.
|
||||||
|
(of_path_of_scsi): Handle vdevice.
|
||||||
|
|
||||||
2012-06-03 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-06-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/mmap/i386/pc/mmap.c (malloc_hook):
|
* grub-core/mmap/i386/pc/mmap.c (malloc_hook):
|
||||||
|
|
|
@ -65,7 +65,9 @@ grub_util_info (const char *fmt, ...)
|
||||||
fputc ('\n', stderr);
|
fputc ('\n', stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define grub_util_warn grub_util_info
|
||||||
#define _(x) x
|
#define _(x) x
|
||||||
|
#define xstrdup strdup
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -118,6 +120,12 @@ find_obppath (const char *sysfs_path_orig)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
|
if (fd < 0 || fstat (fd, &st) < 0)
|
||||||
|
{
|
||||||
|
snprintf(path, path_size, "%s/devspec", sysfs_path);
|
||||||
|
fd = open(path, O_RDONLY);
|
||||||
|
}
|
||||||
|
|
||||||
if (fd < 0 || fstat (fd, &st) < 0)
|
if (fd < 0 || fstat (fd, &st) < 0)
|
||||||
{
|
{
|
||||||
kill_trailing_dir(sysfs_path);
|
kill_trailing_dir(sysfs_path);
|
||||||
|
@ -391,6 +399,24 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev
|
||||||
disk_name = "disk";
|
disk_name = "disk";
|
||||||
|
|
||||||
digit_string = trailing_digits (device);
|
digit_string = trailing_digits (device);
|
||||||
|
if (strncmp (of_path, "/vdevice/", sizeof ("/vdevice/") - 1) == 0)
|
||||||
|
{
|
||||||
|
unsigned long id = 0x8000 | (tgt << 8) | (bus << 5) | lun;
|
||||||
|
if (*digit_string == '\0')
|
||||||
|
{
|
||||||
|
snprintf(disk, sizeof (disk), "/%s@%04x000000000000", disk_name, id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int part;
|
||||||
|
|
||||||
|
sscanf(digit_string, "%d", &part);
|
||||||
|
snprintf(disk, sizeof (disk),
|
||||||
|
"/%s@%04x000000000000:%c", disk_name, id, 'a' + (part - 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (*digit_string == '\0')
|
if (*digit_string == '\0')
|
||||||
{
|
{
|
||||||
snprintf(disk, sizeof (disk), "/%s@%x,%d", disk_name, tgt, lun);
|
snprintf(disk, sizeof (disk), "/%s@%x,%d", disk_name, tgt, lun);
|
||||||
|
@ -403,6 +429,7 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev
|
||||||
snprintf(disk, sizeof (disk),
|
snprintf(disk, sizeof (disk),
|
||||||
"/%s@%x,%d:%c", disk_name, tgt, lun, 'a' + (part - 1));
|
"/%s@%x,%d:%c", disk_name, tgt, lun, 'a' + (part - 1));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
strcat(of_path, disk);
|
strcat(of_path, disk);
|
||||||
return of_path;
|
return of_path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue