Skip to contentSkip to conversation

udevinfo - now a real program :)

PATCH In review Kay Sievers 2 participants 2 messages Jan 26, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udevinfo - now a real program :)

I want to make udevinfo the standard query interface, so all the user features of the main udev are copied in here. It is now capable to:

o query the database for a given value
o dump the whole database
o extract all possible device attributes for a sysfs_device

In addition to the known options of udev it supports the query for the mode of the device node, and it includes the mode in the database dump:

udevinfo -d
P: /class/video4linux/video0
N: video/webcam0
M: 0666
S: camera0 kamera0
O: 500
G: 500

It is also a bit more friendly with the pathnames specified for devices or nodes. We remove the absolute path or add it if neccessary:

udevinfo -q mode -n video/webcam0
udevinfo -q mode -n /udev/video/webcam0
0666

udevinfo -q mode -p /sys/class/video4linux/video0 udevinfo -q mode -p /class/video4linux/video0 udevinfo -q mode -p class/video4linux/video0 0666

Greg, I want to move the program out of extras/udevinfo to the root folder and include it in the install target. Then we may remove the user mode code from the main udev program and update the man page. What do you think?

thanks,
Kay

extras/udevinfo/Makefile +21 -7
diff -Nru a/extras/udevinfo/Makefile b/extras/udevinfo/Makefile
@@ -1,14 +1,28 @@
 PROG=udevinfo
-LD=$(CC)
-OBJS=udevinfo.o
+OBJS=	../../udev_config.o \
+	../../udev-add.o \
+	../../udev-remove.o \
+	../../udevdb.o \
+	../../logging.o \
+	../../namedev.o  \
+	../../namedev_parse.o \
+	../../libsysfs/sysfs_bus.o \
+	../../libsysfs/sysfs_class.o \
+	../../libsysfs/sysfs_device.o \
+	../../libsysfs/sysfs_dir.o \
+	../../libsysfs/sysfs_driver.o \
+	../../libsysfs/sysfs_utils.o \
+	../../libsysfs/dlist.o \
+	../../tdb/tdb.o \
+	../../tdb/spinlock.o \
 
-all:	$(PROG)
+all: $(PROG)
 
-clean:
-	rm -f $(PROG) $(OBJS)
+$(PROG): $(PROG).o
+	$(LD) $(LDFLAGS) -o $(PROG) $(PROG).o $(OBJS) -lc
 
-$(PROG):	$(OBJS)
-	$(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(SYSFS)
+clean:
+	rm -f $(PROG) $(OBJS) $(PROG).o
 
 me:
 	cd ../..; make EXTRAS=extras/udevinfo
extras/udevinfo/udevinfo.c +281 -16

337 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · Kay Sievers

I want to make udevinfo the standard query interface, so all the user features of the main udev are copied in here. It is now capable to:

o query the database for a given value
o dump the whole database
o extract all possible device attributes for a sysfs_device

Very nice, I've applied this.

Quoted 4 lines

Greg, I want to move the program out of extras/udevinfo to the root folder and include it in the install target. Then we may remove the user mode code from the main udev program and update the man page. What do you think?

Great idea, I just did that and checked all of the changes in.

thanks again.

greg k-h

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel