lkml.org 
[lkml]   [1997]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: hinv (hardware inventory)
Date
Larry McVoy writes:
> This is a poor man's copy of hinv. Please try it and send me patches. If it
> gets good enough maybe the distributions will pick it up.

You've commented out the floppy controller counter in the main program:
#$fdc{$_}++;
but it's still present in the commented examples.
The floppy drive counter doesn't work for more than one floppy disk.
The dmesg output is of the form:
Floppy drive(s): fd0 is 1.44M, fd1 is 1.2M

but you only ever pick up the last word on the line. Here's a patch:
------------------------------ cut here ------------------------------
--- hinv.ORI Thu Sep 25 10:27:34 1997
+++ hinv Thu Sep 25 10:35:30 1997
@@ -67,7 +67,7 @@
} elsif (/^tty/) {
$ttys{$_[$#_]}++;
} elsif (/^Floppy/) {
- $floppy{$_[$#_]}++;
+ $floppy{$1}++ while /is ([\w.]+)/g;
} elsif (/^hd(.): /) {
$which = $1;
s/hd.: //;
------------------------------ cut here ------------------------------
It also doesn't pick up devices whose drivers are loaded as modules
(unless there's both no /var/log/dmesg and the real dmesg buffer
hasn't lost the module load line off the top). This will prevent
picking up ethernet cards which are typically both popular and
loaded as modules. Nevertheless, it's a good and useful start.

--Malcolm

--
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Unix Systems Programmer
Oxford University Computing Services

\
 
 \ /
  Last update: 2005-03-22 13:40    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site