Greg KH <gregkh@suse...> wrote:
> On Tue, Mar 25, 2008 at 04:05:32PM -0700, H. Peter Anvin wrote:
>>> How does this have anything to do with boot times? Do you really have a
>>> foolish shell script that iteratorates over every single disk in the
>>> sysfs tree for every disk? What does it do that for?
>> Any time you want to get the sysfs information for a filesystem which is
>> already mounted, that's what you're forced to do.
>>> I thought we were talking about 2TB disks here, with a proposed new
>>> ioctl, not foolishness of boot scripts...
>> I pointed out that having a way to map device numbers to sysfs directories
>> would have the same effect, *and* would be usable for other purposes. I'd
>> rather see that than a new ioctl, and another, and another...
> Again, a simple udev rule will give you that today if you really want
So e.g. lilo should depend on sysfs and *a*special*configuration* of udev,
while the admin MUST NOT use mknod'ed device files nor manually create
symlinks pointing to them, and not use relative path names?
That's plain stupid.
> And I think 'udevinfo' can be used to retrieve this information as well.
$ udevinfo /dev/hda
$ udevinfo /dev/hda --help
Usage: udevinfo OPTIONS
--query=<type> query database for the specified value:
name name of device node
symlink pointing to node
path sysfs device path
env the device related imported environment
all all values
--path=<devpath> sysfs device path used for query or chain
--name=<name> node or symlink name used for query
--root prepend to query result or print udev_root
--attribute-walk print all SYSFS_attributes along the device chain
--export-db export the content of the udev database
--help print this text
$ udevinfo --name=/dev/hda
$ udevinfo --name=/dev/hda --query=all
As you can see, it gives no major:minor information. But it is in the DB: