Make nand a prefix for nand devices.
* grub-core/disk/ieee1275/nand.c (grub_nand_open): Use prefix nand.
This commit is contained in:
parent
10133b5ff3
commit
d5534665ff
3 changed files with 29 additions and 15 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Make nand a prefix for nand devices.
|
||||||
|
|
||||||
|
* grub-core/disk/ieee1275/nand.c (grub_nand_open): Use prefix nand.
|
||||||
|
|
||||||
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/kern/misc.c (grub_stpcpy): Move from here ...
|
* grub-core/kern/misc.c (grub_stpcpy): Move from here ...
|
||||||
|
|
|
@ -2250,9 +2250,11 @@ by a digit, like @samp{fd0}, or @samp{cd}.
|
||||||
AHCI, PATA (ata), crypto, USB use the name of driver followed by a number.
|
AHCI, PATA (ata), crypto, USB use the name of driver followed by a number.
|
||||||
Memdisk and host are limited to one disk and so it's refered just by driver
|
Memdisk and host are limited to one disk and so it's refered just by driver
|
||||||
name.
|
name.
|
||||||
RAID (md), ofdisk (ieee1275), LVM (lv) and arcdisk (arc) use intrinsic name
|
RAID (md), ofdisk (ieee1275 and nand), LVM (lv) and arcdisk (arc) use
|
||||||
of disk prefixed by driver name. Conflicts are solved by suffixing a number
|
intrinsic name of disk prefixed by driver name. Additionally just ``nand''
|
||||||
if necessarry. Commas need to be escaped.
|
refers to the disk aliased as ``nand''.
|
||||||
|
Conflicts are solved by suffixing a number if necessarry.
|
||||||
|
Commas need to be escaped.
|
||||||
Loopback uses whatever name specified to @command{loopback} command.
|
Loopback uses whatever name specified to @command{loopback} command.
|
||||||
Hostdisk uses names specified in device.map or hostdisk/<OS NAME>.
|
Hostdisk uses names specified in device.map or hostdisk/<OS NAME>.
|
||||||
For crypto and RAID (md) additionally you can use the syntax
|
For crypto and RAID (md) additionally you can use the syntax
|
||||||
|
@ -2273,6 +2275,7 @@ For crypto and RAID (md) additionally you can use the syntax
|
||||||
(md/0)
|
(md/0)
|
||||||
(ieee1275/disk2)
|
(ieee1275/disk2)
|
||||||
(ieee1275//pci@@1f\,0/ide@@d/disk@@2)
|
(ieee1275//pci@@1f\,0/ide@@d/disk@@2)
|
||||||
|
(nand)
|
||||||
(memdisk)
|
(memdisk)
|
||||||
(host)
|
(host)
|
||||||
(myloop)
|
(myloop)
|
||||||
|
|
|
@ -39,7 +39,7 @@ grub_nand_iterate (int (*hook) (const char *name),
|
||||||
auto int dev_iterate (struct grub_ieee1275_devalias *alias);
|
auto int dev_iterate (struct grub_ieee1275_devalias *alias);
|
||||||
int dev_iterate (struct grub_ieee1275_devalias *alias)
|
int dev_iterate (struct grub_ieee1275_devalias *alias)
|
||||||
{
|
{
|
||||||
if (! grub_strcmp (alias->name, "nand"))
|
if (grub_strcmp (alias->name, "nand") == 0)
|
||||||
{
|
{
|
||||||
hook (alias->name);
|
hook (alias->name);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -63,6 +63,7 @@ grub_nand_open (const char *name, grub_disk_t disk)
|
||||||
{
|
{
|
||||||
grub_ieee1275_ihandle_t dev_ihandle = 0;
|
grub_ieee1275_ihandle_t dev_ihandle = 0;
|
||||||
struct grub_nand_data *data = 0;
|
struct grub_nand_data *data = 0;
|
||||||
|
const char *devname;
|
||||||
struct size_args
|
struct size_args
|
||||||
{
|
{
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
|
@ -73,14 +74,18 @@ grub_nand_open (const char *name, grub_disk_t disk)
|
||||||
grub_ieee1275_cell_t size2;
|
grub_ieee1275_cell_t size2;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
if (! grub_strstr (name, "nand"))
|
if (grub_memcmp (name, "nand/", sizeof ("nand/") - 1) == 0)
|
||||||
|
devname = name + sizeof ("nand/") - 1;
|
||||||
|
else if (grub_strcmp (name, "nand") == 0)
|
||||||
|
devname = name;
|
||||||
|
else
|
||||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a NAND device");
|
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a NAND device");
|
||||||
|
|
||||||
data = grub_malloc (sizeof (*data));
|
data = grub_malloc (sizeof (*data));
|
||||||
if (! data)
|
if (! data)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
grub_ieee1275_open (name, &dev_ihandle);
|
grub_ieee1275_open (devname, &dev_ihandle);
|
||||||
if (! dev_ihandle)
|
if (! dev_ihandle)
|
||||||
{
|
{
|
||||||
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
|
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
|
||||||
|
|
Loading…
Reference in a new issue