You are not logged in.
hey all.
im reworking lshwd to provide subvendorid/subdeviceid parameters for some weird hw support. as a result, i was thinking of loosing the pciutils/usbutils packages dependency and format /proc/bus/xxx myself. this will enhance lshwd to be able to work from initrd/etc... only drawback i see is the direct use of /proc/bus/xxx info where i've read somewhere its not encouraged - however, the pcilib/usblib are doing just the same...
so, any comments? and thank you all for your support
Offline
if you need the proc filesystem, you can't run from an initrc, because proc won't be mounted....
but there's probably a way to emulate the same output
Offline
usually you'll mount /proc in initrd (from initrc) too except for initrd prompt only (ie, no booting from hw-devices which must be enumed using /proc).
but what u think? any drawbacks for using /proc directly?
Offline
Only drawback is that it's more work for you, but that's all. That said, if I were you I'd go for it, I don't like unneeded dependencies much.
Offline
i dont care much for the extra work (i actually used /proc/bus/usb in older versions ) so its not gonna take long anyway (hopefully).
well, unless ppl find any other drawbacks, consider less dependencies on lshwd 2.0
Offline
lspci and lsusb are less than 100K though, while pci.ids and usb.ids are almost 350K, so it looks like it isn't worth it much.
You say that currently hwd can't work from initrd, why do you think that is the case?
Offline
if i drop lspci & lsusb, there is no need for the *.ids files any longer. also, the main reason for loosing the libs is to simplify lshwd - formatting /proc/bus/xxx is fairly easy imo.
lshwd can be used in initrd - its simply a matter of space - reducing dependencies will help with this.
i just dont see much reason anymore for using the libs if /proc is just sitting waiting to be probed...
Offline
Hm, indeed, you don't need most info in those *.ids files, only the id-->module mappings, which can be found in /lib/modules/`uname -r`/modules.* anyway.
As a total sidenote, are you aware of the recent hotplug developments? Mainly passing on the module alias directly instead of the slow /sys parsing which happens now? If those are stored somewhere in /sys so that coldplugging and just viewing them is possible then there's no need for any complicated stuff anymore. Ever considered helping to improve hotplug instead of making a sort of alternative?
Offline
i admit shamelessly, i did take a look at hotplug sources - but its a huge project, and will take me sometime to learn it, not to mention - im lazy, hate hotplug, and used lshwd as a starting point for my linux programming experience...
all and all, i think i'll give /proc/bus/xxx a go
ps.
i just remembered, im using "/proc/bus/ieee1394/devices" anyway for firewire probing... so we're one foot in it already
Offline
They seem to be moving from /proc to /sys though, at least in the long run. I'd take a good look at sys, perhaps it can make some things easier.
Hotplug isn't that big, it's just a bunch of shellscripts. pacman -Ql hotplug output isn't that intimidating. I'm not talking about the (real) hotplug implementation in the kernel, but for you the only interesting part is the kernel-usermode interface anyway (/sbin/hotplug + environment vars).
Offline
sorry, i thought u ment the complete hotplug kernel-stuff sources. anyway, the i might look into improving hotplug later on, but i think lshwd has a niche for itsown, and i better fix it 1st.
regarding /sys vs /proc - any pros/cons ? they seems to provide same level of data, but in different formats.
Offline
improve lshwd, apply what you learned to hotplug. :-)
IIRC, it says in the kernel that /proc is 'legacy support'. This means it will be removed someday. I suppose its replaced by /sys?
Arch tends to be bleeding edge, so /sys would win if this is the case.
Dusty
Offline
Proc certinly isnt obsolete or dated. and there is no mention of it being such in it's entry under Filesystems > Pseudofilesystems.
What you're thinking of is the entry for /proc/scsi/ which is under scsi, which is called 'legacy /proc/scsi support' which indicates that the scsi entry in proc has been superseded by the entries in /sys.
Either way, proc is unlikely to be removed anytime soon, and probably not in 2.8 either, it'll be here to stay for a while.
iphitus
Offline
What you're thinking of is the entry for /proc/scsi/ which is under scsi, which is called 'legacy /proc/scsi support' which indicates that the scsi entry in proc has been superseded by the entries in /sys.
I doubt that's what I was thinking of because I never touched scsi before. But I don't remember what it was I was thinking of if that's the case, its been a long time since I compiled a kernel.
Dusty
Offline
i read all docs under Documentation/filesystems/ regarding procfs/sysfs and couldnt find any mention of "obsolete" or "outdated". only difference is procfs is dated from 2000, and sysfs from 2003.
since both fs are used in all distros i know (please correct me if im wrong on this...) i cant see much difference in using any of them.
just 1 small remark - it seems /proc will be quicker to parse, but its only from 1st glance. i might be wrong on this also...
Offline
/sys is linux 2.6 only. The main goal of /sys is to clean up /proc and move all hardware related and driver specific info into it, so that /proc is used for what it was meant to originally. In /sys all files have one value, making parsing it peanuts, though instead you may need to do readdir more often. New hardware will have sys support, and things are moved from /proc to /sys, so in the long run /proc will have no hardware info anymore, but that will take a while (2.7 I guess). /sys seems to have more info than /proc, making it harder to figure out which part you need. So for now use whatever you want, but keep in mind that you may need to look in /sys for certain hardware.
Offline
tnx for the explanation, i highly needed that.
i think the best is to make lshwd procfs compatible, while keeping in mind future sysfs use. once we have complete "parsing engine" i guess we could adopt it to sysfs easily enough (we might keep them both...).
request:
i seems to lost old lshwd sources (0.3) so if anyone might has them i'd appreciate it. i dont feel like recoding the usb parsing part which was on 0.3 but removed on 0.4 in favor of usbutils...
Offline
I think I've found something which looks like 0.3 sources :-)
I've tared and gzipped the files and you can download it here:
http://lanrat.webpark.pl/lshwd-03.tar.gz
Offline
put it under version control, you goof!
Dusty
Offline
kisses kisses
and we did have webcvs in user-contributions, but for some reason its gone, and Rasat is on another of his travels...
Offline
i took some time to learn more about sysfs, and it simply THE bomb... standardized like one expects an information filesystem to be. though i finished removing the usbutils/pciutils dependencies from lshwd and changed to parsing /proc/bus/usbpci instead, i admit using the sysfs would have been a better step...
but hey - thats just a good reason as any for having a 3.0 version! :twisted:
Offline
Oh well, tried to inform you about sysfs before you wasted time on /proc, but now you've something to look forward to. ;-)
Offline
Offline
z4ziggy, you might check this thread
http://bbs.archlinux.org/viewtopic.php?t=12070
Favorite systems: ArchLinux, OpenBSD
"Yes, I love UNIX"
Offline
8)
lshwd 2.0 is finished. only 1 question before releasing it (not yet as pkgbuild to allow Rasat to return from abroad and adopt hwd) - i dropped pcmcia detection since from what i've learned all pcmcia devices are listed under /proc/bus/pci anyway (and so they did on my testings also). i'd like to confirm this please if you may, just so i can know i didnt drop an important function... as a result, no need for pcmciatable anymore since the devices listed as pci will be found in pcitable
anyway, just confirmation and 2.0 is released
Offline