* [PATCH] allow non-block devices for udevinfo
@ 2004-02-25 14:11 Hannes Reinecke
2004-02-25 16:31 ` Kay Sievers
2004-02-28 0:22 ` Greg KH
0 siblings, 2 replies; 3+ messages in thread
From: Hannes Reinecke @ 2004-02-25 14:11 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 567 bytes --]
Hi all,
with the attached patch to udevinfo it is possible to look also at
devices in /class which do not provide the 'dev' attribute, e.g. net
devices.
Agreed, it is of limited usefulness as it stands, but with it we can
check devices for consistency with the 'standard' or 'acceptable'
behaviour re. sysfs. And complain loudly to the driver maintainer if
they don't (Hi Arnd !).
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux AG S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: udevinfo-net.patch --]
[-- Type: text/plain, Size: 782 bytes --]
===== udevinfo.c 1.13 vs edited =====
--- 1.13/udevinfo.c Mon Feb 23 20:07:25 2004
+++ edited/udevinfo.c Wed Feb 25 14:44:02 2004
@@ -143,14 +143,12 @@
/* read the 'dev' file for major/minor*/
attr = sysfs_get_classdev_attr(class_dev, "dev");
- if (attr == NULL) {
- printf("couldn't get the \"dev\" file\n");
- retval = -1;
- goto exit;
+ if (attr) {
+ printf("\ndevice '%s' has major:minor %s", class_dev->path,
+ attr->value);
+ sysfs_close_attribute(attr);
}
- printf("\ndevice '%s' has major:minor %s", class_dev->path, attr->value);
- sysfs_close_attribute(attr);
-
+
/* open sysfs class device directory and print all attributes */
printf(" looking at class device '%s':\n", class_dev->path);
if (print_all_attributes(class_dev->path) != 0) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] allow non-block devices for udevinfo
2004-02-25 14:11 [PATCH] allow non-block devices for udevinfo Hannes Reinecke
@ 2004-02-25 16:31 ` Kay Sievers
2004-02-28 0:22 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2004-02-25 16:31 UTC (permalink / raw)
To: linux-hotplug
On Wed, 2004-02-25 at 15:11, Hannes Reinecke wrote:
> Hi all,
>
> with the attached patch to udevinfo it is possible to look also at
> devices in /class which do not provide the 'dev' attribute, e.g. net
> devices.
> Agreed, it is of limited usefulness as it stands, but with it we can
> check devices for consistency with the 'standard' or 'acceptable'
> behaviour re. sysfs. And complain loudly to the driver maintainer if
> they don't (Hi Arnd !).
I don't think, that we should print udev keys for devices that udev
can't handle. It claims that the printed keys are usable in a rule.
I agree that we should check the standard compliance as much as we can,
but I don't think that's the goal of udevinfo. Remember that all
multiline values and values containing nonprintable chars are simply
skipped in the current udevinfo device walk. So nonconformant attributes
are as well not printed.
If you really need it, please make it a separate tool or at least a
different command line option of udevinfo.
Please don't print any attribute we can't use, in the SYSFS{attribute}
format. I expect a lot of legitimate confusion otherwise.
thanks,
Kay
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] allow non-block devices for udevinfo
2004-02-25 14:11 [PATCH] allow non-block devices for udevinfo Hannes Reinecke
2004-02-25 16:31 ` Kay Sievers
@ 2004-02-28 0:22 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2004-02-28 0:22 UTC (permalink / raw)
To: linux-hotplug
On Wed, Feb 25, 2004 at 03:11:06PM +0100, Hannes Reinecke wrote:
> Hi all,
>
> with the attached patch to udevinfo it is possible to look also at
> devices in /class which do not provide the 'dev' attribute, e.g. net
> devices.
Why? udev doesn't care about those kind of devices at all.
If you want to see info about those kinds of devices, use the tools in
sysutils, that's what they are for, right?
thanks,
greg k-h
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-28 0:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-25 14:11 [PATCH] allow non-block devices for udevinfo Hannes Reinecke
2004-02-25 16:31 ` Kay Sievers
2004-02-28 0:22 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).