On Tue, 2010-10-05 at 13:53 +0200, Karel Zak wrote: > On Mon, Oct 04, 2010 at 10:56:10AM -0400, Davidlohr Bueso wrote: > > These series of patches add a new command, devinfo(1), which aids > > users to quickly get details of any linux device. > > > > I have been using this program for my own purpose for some time now > > and thought that it might be a useful addition. > > Thanks that you share your program with community. > > > There is room for improvements and suggestions, so please let me know. > > > > Some examples: > > $ devinfo /dev/video0 > > Character device: `video0' (81:0) Class: video4linux Access: crw-rw---- > > Name: Integrated Camera Driver: `uvcvideo' > > Type: usb_interface > > I have doubts that there is any demand for such output. We already > have lshw, lspci, stat, ... > > > # devinfo /dev/sda > > Block device: `sda' (8:0) Class: sd Access: brw-rw---- > > Fabricant: ATA HITACHI HTS54502 Driver: `sd' > > Type: disk (read-write, non-removable) > > Partitions (3): > > #1: 468518912 Linux > > #2: 19873794 Extended > > #5: 19873792 Linux swap / Solaris > > This belongs to fdisk or partx (rewrite partx to use libblkid is > still in my TODO list...). Note that you need root permissions > to parse partition tables. Yes, devinfo mixes up a few things because I was tired of having to look in different places and use different commands to get the info I wanted (fdisk, stat, dmesg, cat /proc/*, cat /sys/*, etc.). This output is simply a summary of what I consider relevant at first sight. > > We shouldn't forget that all such information are already gathered by > udev and all this is accessible for non-root users, try: > > udevadm info --query=all --name=sda1 Some info is there, but some is available through devinfo (partitions, model/name, permissions, etc.) > > maybe it would be better to create a new command with human readable > output for udev db rather than write all from scratch. Yep, will consider it. > > > $ devinfo -b > > DEVICE MAJOR:MINOR > > sr > > ââsr0 11:0 > > ramdisk > > ââram0 1:0 > > ââram1 1:1 > > ââram10 1:10 > > ââram11 1:11 > > ââram12 1:12 > > ... > > Nice, Milan Broz is working on a new command called "lsblk", the > command will be able to print tree of block devices (with > slaves/holders dependencies) -- something like "dmsetup ls --tree" > but for all block devices and with more information. > Interesting, actually I started to write something very similar (actually called lsblk, but then extended it to what you see here). Cheers, Davidlohr -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html