[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Linux I2O devices

From: Robert Millan
Subject: Re: [PATCH] Linux I2O devices
Date: Thu, 21 Sep 2006 19:50:24 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Thu, Sep 21, 2006 at 03:59:29AM +0200, Yoshinori K. Okuji wrote:
> On Sunday 17 September 2006 23:25, Robert Millan wrote:
> > For I2O we have /dev/i2o/hd[a-z][0-9].  There's also a big family of device
> > sets using this scheme (/dev/*/hd[a-z][0-9]).  Unless the second "if" can
> > be made the default option, we'll have to add knowledge of every of these
> > device paths here?
> If you think we can make this ugly code simpler and more consistent, let me 
> know... Is there ever any rule in Linux?!

I think grub legacy did it right.  This is the code from lib/device.c:

  strcpy (dev, map[drive]);
  if (have_devfs ())
      if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
        strcpy (dev + strlen(dev) - 5, "/part");
      if ((strncmp (dev, "/dev/ataraid/", 13) == 0) ||
         (strncmp (dev, "/dev/rd/", 8) == 0))
        strcpy (dev + strlen(dev), "p");
  sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);

There's a generic case that just appends partition suffix at the end.  I think
this covers the majority of cases, and grub2 doesn't have it.

I'll try to cook up something.

Robert Millan

My spam trap is address@hidden  Note: this address is only intended for
spam harvesters.  Writing to it will get you added to my black list.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]