You are not logged in.

#1 2013-03-20 21:53:13

yodaz
Member
Registered: 2011-03-08
Posts: 41

[SOLVED] Crystalhd driver compilation

Hi,

I was using crystalhd driver provided by crystalhd-git package from AUR, but it won't build since latest kernel upgrade (3.8.3-2-ARCH). When I tried to build the package, I have the following error at compile time :

configure: creating ./config.status
config.status: creating ./Makefile
make -C /lib/modules/3.8.3-2-ARCH/build SUBDIRS=/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux modules
make[1] : on entre dans le répertoire « /usr/src/linux-3.8.3-2-ARCH »
  CC [M]  /tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.o
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:434:22: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_init_chdev’
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:501:23: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_release_chdev’
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:526:22: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_pci_reserve_mem’
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:585:23: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_pci_release_mem’
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:600:23: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_pci_remove’
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:628:22: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_pci_probe’
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:817:14: erreur: ‘chd_dec_pci_probe’ undeclared here (not in a function)
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:818:2: erreur: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:818:26: erreur: ‘chd_dec_pci_remove’ undeclared here (not in a function)
/tmp/yaourt-tmp-xbmc/aur-crystalhd-git/src/crystalhd/driver/linux/crystalhd_lnx.c:22:22: attention : ‘crystalhd_class’ defined but not used [-Wunused-variable]
cc1: some warnings being treated as errors

I have no C programming skills, so if someone can explain if there's a simple workaround, or if it's a major problem, it will be very helpful.

Thanks.

Last edited by yodaz (2013-04-04 18:54:58)

Offline

#2 2013-04-03 14:54:36

M25
Member
Registered: 2013-04-03
Posts: 2

Re: [SOLVED] Crystalhd driver compilation

Found it! This worked for me building from source on Ubuntu, after receiving the same exact set of errors, so I assume it'll work as well on Arch. 
The problem is that with the 3.8 kernel update, the __devinit and __devexit macros were removed.  Those macros are used in the source, so that's what's causing the failures.  I did some research, these macros check if hotplugging is enabled in the kernel, and if it is, they get replaced with __init and __exit respectively. Since I can't imagine a situation where you wouldn't want hotplugging, the solution is to replace all instances of __devinit and __devexit with __init and __exit in driver/linux/crystalhd_cmds.c and driver/linux/crystalhd_lnx.c

I've created a patch file that does this, but since I'm new to this forum I can't find the upload file button, so instead I've hosted it on my own server, at http://m25.mooo.com/devinitFix.patch
you can apply it by going into the main crystalhd source directory and doing

wget http://m25.mooo.com/devinitFix.patch
patch -p0 < devinitFix.patch

then build as normal.  Let me know if you have any trouble, it's working great for me now smile

Offline

#3 2013-04-03 20:58:23

yodaz
Member
Registered: 2011-03-08
Posts: 41

Re: [SOLVED] Crystalhd driver compilation

Hi M25, and thanks a lot !

Your patch seems better than the one Openelec provided (https://github.com/OpenELEC/OpenELEC.tv … -3.8.patch) because they just have dropped __devinit macro.

I will test it, then I'll update the packages as soon as I can.

Offline

#4 2013-04-03 21:14:29

yodaz
Member
Registered: 2011-03-08
Posts: 41

Re: [SOLVED] Crystalhd driver compilation

Seems to be fine. Aur packages updated.
Thanks again for this helpful patch !

Offline

#5 2013-04-29 14:54:00

M25
Member
Registered: 2013-04-03
Posts: 2

Re: [SOLVED] Crystalhd driver compilation

So, here's the thing.  That m25.mooo.com address is my personal server, and it goes offline on a regular basis for repairs and whenever my house loses power or internet.  I looked at the AUR script for the drivers, and it does a wget directly from there.  As flattered as I am to be part of the build process, I don't intend on updating that file on a regular basis, and that server can't be relied upon to make this thing build.  I don't actually use Arch, and so don't have an AUR account or access to change the build script, can someone copy the content of that file into the build script instead of linking it?

Offline

#6 2013-04-29 18:58:58

yodaz
Member
Registered: 2011-03-08
Posts: 41

Re: [SOLVED] Crystalhd driver compilation

Hi,

No problem, it's my fault, I should have asked you before directly linking the file from the build script.
I will host the file on another server, thanks again for your precious help.

Offline

Board footer

Powered by FluxBB