In the following guide, you are supposed to have installed the Mandriva 2010.1 Spring Power Pack (
http://www2.mandriva.com) on ASRock ION330HT's hard disk. If considering to use XBMC media center, do not forget to install also the latest nvidia driver (
http://us.download.nvidia.com/XFree86/Li...256.53.run) and XBMC (
http://xbmc.org/download, or
xbmc-9.11-1.svn32705.dharma.pvr_testing2.0.2mdv2010.1.rpm package from Mandriva repository).
Driver compilation
1. Make sure you have Mandriva Power Pack distro as this HOWTO fails on Mandriva One Live CD instalations !! Next check you have the following mandriva packages installed. I recommend to use urpmi or 'Install/Remove Software' GUI tool because it solves dependencies and installs also all packages these packages depend on. I can not bear out that all these packages are necessary; this is just list of packages I
suppose to be necessary:
kernel-server-2.6.33.7-2mnb-1-1mnb2
kernel-server-devel-2.6.33.7-2mnb-1-1mnb2
kernel-firmware-20100217-1mnb2
kernel-firmware-extra-20100429-2mnb2
dkms-2.0.19-20mdv2010.1
lirc-0.8.7-0.20100505.1mdv2010.1
curl-7.20.1-2mdv2010.1
dkms-lirc-0.8.7-0.20100505.1mdv2010.1
2. Download the
IR(10.04).zip archive from the URL
http://europe.asrock.com/downloadsite/dr...10.04).zip and rename the archive to
IR-10.04.zip (shell does not like parentheses in the file names). Open the
IR-10.04.zip archive (double click opens it in the Archive manager); open the source package
lirc-nct677x-src-1.0.4-ubuntu10.04.deb using Archive Manager (double click opens it in the new window) and extract the
data.tar.gz archive (right click to DEB package, open it with Archive manager, then drag
data.tar.gz icon to desktop).
3. Extract the
usr/src/lirc-nct677x-src-1.0.4-ubuntu9.10 directory to the
/usr/src directory (double click to
data.tar.gz and then repeat double clicking to icons (., usr, src) until you see the directory name; then drag directory icon to
/usr/src); finally rename the directory to
lirc-nct6775-1.0.4. Check there are also
linux-2.6.33.7-2mnb and
lirc-0.8.7-0.20100505.1mdv2010.1 directories in the
/usr/src (they should be already here).
4. Open and edit the
/usr/src/lirc-nct6775-1.0.4/dkms.conf file; it should look as follows:
Code:
[font=Courier New]
PACKAGE_NAME="lirc-nct6775"
PACKAGE_VERSION="1.0.4"
CLEAN="rm -f *.*o"
MAKE[0]="make -C lirc_wb677 KSRC=$kernel_source_dir KVER=$kernelver modules"
AUTOINSTALL="yes"
BUILT_MODULE_NAME[0]="lirc_wb677"
BUILT_MODULE_LOCATION[0]="lirc_wb677"
DEST_MODULE_LOCATION[0]="/updates"
[/font]
5. Open and edit the
/usr/src/lirc-nct6775-1.0.4/lirc_wb677/Makefile. Best way to edit it is replace file contents by the following:
Code:
[font=Courier New]
#!/bin/bash
KSRC ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
LIRC := $(shell ls -d /usr/src/lirc-[0-9]*)
obj-m += lirc_wb677.o
lirc_wb677-objs := lirc_wb677_main.o lirc_wb677_mouse_kbd.o
modules:
cp -a $(LIRC)/drivers .
grep -v "drivers/lirc.h" $(LIRC)/drivers/lirc_dev/lirc_dev.h > drivers/lirc_dev/lirc_dev.h
mv lirc_wb677_common_extern.h TMP-file
sed s!/usr/src/lirc-0.8.6/drivers!drivers!g TMP-file > lirc_wb677_common_extern.h
rm TMP-file
$(MAKE) -C $(KSRC) M=$(PWD) modules
[/font]
6. Now you can use the following dkms commands to compile and install the driver:
To add source to the dkms tree
Code:
[font=Courier New]> dkms add -m lirc-nct6775 -v 1.0.4
[/font]
To build module
Code:
[font=Courier New]> dkms build -m lirc-nct6775 -v 1.0.4
[/font]
To install module binary
Code:
[font=Courier New]> dkms install -m lirc-nct6775 -v 1.0.4
[/font]
Now module is loaded and device exists:
Code:
[font=Courier New]> lsmod | grep lirc
lirc_wb677 25431 0
lirc_dev 9334 1 lirc_wb677
> ls -l /dev/lirc/0
crw-rw---- 1 root root 61, 0 2010-09-10 23:52 /dev/lirc/0
[/font]
The
lirc_wb677.ko.gz compressed binary file resides in the
/lib/modules/2.6.33.7-desktop586-1mnb/dkms/updates directory.
Now you can completely remove driver sources from the dkms tree using:
Code:
[font=Courier New]> dkms remove -m lirc-nct6775 -v 1.0.4 --all
[/font]
Note this command deletes sources just from dkms tree (
/var/lib/dkms), not from the
/usr/src directory, so after you have done 'dkms remove', you can repeat the compilation process from scratch with another 'dkms add', 'dkms build', and 'dkms install' sequence.
7. Stop the lircd and check the driver is working:
Code:
[font=Courier New]
>/etc/init.d/lircd stop
> modprobe lirc_wb677
> mode2 -d/dev/lirc/0
[/font]
If you press some key on remote (OK, for example) you should get something like:
Code:
[font=Courier New]space 60000
pulse 2700
space 850
pulse 450
space 400
pulse 450
.....
[/font]
This is timing of received mark/space sequence and confirms the driver talks with the CIR hardware.
To stop mode2, press CTRL+C.