* grub-core/disk/ieee1275/nand.c (grub_nand_open): Use prefix nand.
+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>
* grub-core/kern/misc.c (grub_stpcpy): Move from here ...
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
name.
-RAID (md), ofdisk (ieee1275), LVM (lv) and arcdisk (arc) use intrinsic name
-of disk prefixed by driver name. Conflicts are solved by suffixing a number
-if necessarry. Commas need to be escaped.
+RAID (md), ofdisk (ieee1275 and nand), LVM (lv) and arcdisk (arc) use
+intrinsic name of disk prefixed by driver name. Additionally just ``nand''
+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.
Hostdisk uses names specified in device.map or hostdisk/<OS NAME>.
For crypto and RAID (md) additionally you can use the syntax
(md/0)
(ieee1275/disk2)
(ieee1275//pci@@1f\,0/ide@@d/disk@@2)
+(nand)
(memdisk)
(host)
(myloop)
{
auto int dev_iterate (struct grub_ieee1275_devalias *alias);
int dev_iterate (struct grub_ieee1275_devalias *alias)
- {
- if (! grub_strcmp (alias->name, "nand"))
- {
- hook (alias->name);
- return 1;
- }
-
- return 0;
- }
+ {
+ if (grub_strcmp (alias->name, "nand") == 0)
+ {
+ hook (alias->name);
+ return 1;
+ }
+
+ return 0;
+ }
if (pull != GRUB_DISK_PULL_NONE)
return 0;
{
grub_ieee1275_ihandle_t dev_ihandle = 0;
struct grub_nand_data *data = 0;
+ const char *devname;
struct size_args
{
struct grub_ieee1275_common_hdr common;
grub_ieee1275_cell_t size2;
} args;
- if (! grub_strstr (name, "nand"))
- return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a NAND device");
+ 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");
data = grub_malloc (sizeof (*data));
if (! data)
goto fail;
- grub_ieee1275_open (name, &dev_ihandle);
+ grub_ieee1275_open (devname, &dev_ihandle);
if (! dev_ihandle)
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");