Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the Register tab at the top. If you are already registered, you can login at the Login tab.
Syndicate Syndicate Listing Display Search Login/Register
Bug Id ?
Reporter ?
Guest
Product/Version ?
HardInfo / 0.5.1
Status ?
Closed
Severity ?
Enhancement
Duplicate Of ?
- none -
Summary ?
Enhance Hardinfo Detection Options for network devices as well as uClibc libc
Report Time ?
September 14, 2009 06:40:02 PM
Assignment ?
Leandro Pereira
Resolution ?
Fixed
Priority ?
Normal
Dependencies ?
- none -


Votes
For: 0 (0%)
Against: 0 (0%)
Total: 0

September 14, 2009 06:40:02 PM Guest
I am using a uClibc system that I built.
Hardinfo is missing two things in my case.

1) With the addition of udev, a new name for eth* devices has appeared.
These tend to be net*.
I made a patch that adds support for net* device detection.
Also, there are a number of device types missing that are also added: ifb*, gre*, msh*, and wmaster*
I am not fully certain what ifb* is.
gre* is for network tunneling.
msh* is the olpc style mesh networking
wmaster* is internal wireless master stuff that is exposed to userspace for whatever reason..

The patch:
diff -r -u hardinfo-0.5.1.orig/arch/linux/common/net.h hardinfo-0.5.1/arch/linux/common/net.h
--- hardinfo-0.5.1.orig/arch/linux/common/net.h 2009-09-14 13:01:26 -0500
+++ hardinfo-0.5.1/arch/linux/common/net.h 2009-09-14 13:03:10 -0500
@@ -243,6 +243,11 @@
{ "pan", "Personal Area Network (PAN)", "bluetooth" },
{ "bnep", "Bluetooth", "bluetooth" },
{ "br", "Bridge Interface", "network" },
+ { "net", "Ethernet", "network-interface" },
+ { "ifb", "Intermediate Functional Block", "network" },
+ { "gre", "GRE Network Tunnel", "network" },
+ { "msh", "Mesh Network", "network" },
+ { "wmaster", "Wireless Master Interface", "network" },
{ NULL, "Unknown", "network" },
};


2) As I mentioned before, I am using a uClibc system.
hardinfo does not detect uClibc, so I made a patch to do the bare minimum detection.
I do not know how to detect the specific version from within the uClibc libc.so file (if possible), so all I return is "uClibc Library"
I added a g_file_test for the glibc libc.so as well as this feels like a cleaner way to test the presence of a file.

The patch:
diff -r -u hardinfo-0.5.1.orig/arch/linux/common/os.h hardinfo-0.5.1/arch/linux/common/os.h
--- hardinfo-0.5.1.orig/arch/linux/common/os.h 2009-09-14 13:22:54 -0500
+++ hardinfo-0.5.1/arch/linux/common/os.h 2009-09-14 13:30:50 -0500
@@ -52,6 +52,12 @@
FILE *libc;
gchar buf[256], *tmp, *p;

+ if (g_file_test("/lib/ld-uClibc.so.0", G_FILE_TEST_EXISTS)){
+ return g_strdup("uClibc Library");
+ } else if (g_file_test("/lib/libc.so.6", G_FILE_TEST_EXISTS)){
+ goto err;
+ }
+
libc = popen("/lib/libc.so.6", "r");
if (!libc) goto err;



September 21, 2009 02:31:43 AM Leandro Pereira
I'll apply the patches, but I need your name to credit them.

December 20, 2009 06:56:57 PM Leandro Pereira
Patches applied; still waiting for your name to credit the changes.