Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#4055 - lshwd needs adapting for xorg7?

Attached to Project: Arch Linux
Opened by Michael Towers (gradgrind) - Friday, 24 February 2006, 14:29 GMT
Last edited by Tobias Powalowski (tpowa) - Tuesday, 28 February 2006, 06:12 GMT
Task Type Bug Report
Category Packages: Current
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.1 Noodle
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Could the hard-wired paths XPATH and XMODPATH (no longer correct for Xorg7) in lshwd.c be responsible for the newly encountered failure of video module detection?

Unfortunately when I tried to recompile the package, I got a pile of errors:

lshwd.c: In function 'check_module':
lshwd.c:753: error: 'byte' undeclared (first use in this function)
lshwd.c:753: error: (Each undeclared identifier is reported only once
lshwd.c:753: error: for each function it appears in.)
lshwd.c:753: error: syntax error before 'descbuf'
lshwd.c:758: error: 'modulebuf' undeclared (first use in this function)
lshwd.c:759: error: 'descbuf' undeclared (first use in this function)
lshwd.c: In function 'list_pci':
lshwd.c:775: error: 'byte' undeclared (first use in this function)
lshwd.c:775: error: syntax error before 'lastclassbuf'
lshwd.c:774: warning: unused variable 'dev'
lshwd.c:773: warning: unused variable 'pacc'

and so on.

I'm afraid this beats my very limited C-knowledge!
This task depends upon

Closed by  Jan de Groot (JGC)
Sunday, 04 February 2007, 13:18 GMT
Reason for closing:  Implemented
Additional comments about closing:  Thanks for your changes. Made a patch out of your modified .c file, checked it and it appears to work well.
Comment by Michael Towers (gradgrind) - Wednesday, 08 March 2006, 10:30 GMT
I think I've solved this one. Here is my list changes:

1) New paths:
line 524/5:
#define XPATH "/usr/bin/"
#define XMODPATH "/usr/lib/xorg/modules/drivers/"

2) The drivers now have a .so ending instead of .o:
line 619:
sprintf ( fullpath, XMODPATH "", xmodule );

3) Changed all declarations of type byte to char

4) Seems not to be used, but should probably be Xorg rather than XFree86:
line 545:
const char *xfree4 = "Xorg", *xvesa4 = "vesa";

New lshwd.c attached
   lshwd.c (35.6 KiB)
Comment by Michael Towers (gradgrind) - Wednesday, 08 March 2006, 11:32 GMT
It looks like I spoke too soon: the -n option doesn't work now,
which means it makes a mess of hwd ...
Comment by Michael Towers (gradgrind) - Thursday, 09 March 2006, 08:57 GMT
I think I've got it now. The vendor_id and device_id fields were being compared in sort_pci_list (about line 188), but sort_pci_list was called (line 813) before these fields were initialized (pci_fill_info ... line 817). By moving the pci_fill_info call into the already existing for-loop in sort_pci_list, I can cure this:

for(cnt=0,d=first_dev; d; d=d->next)
{ cnt++;
pci_fill_info(d, PCI_FILL_IDENT | PCI_FILL_BASES); /* Fill in header info we need */

What I don't understand is how the existing source code could have produced a working binary - did it really come from this source?

My latest, apparently working version of lshwd.c:

   lshwd.c (35.6 KiB)
Comment by Roman Kyrylych (Romashka) - Wednesday, 03 January 2007, 21:57 GMT