Kenneth's Custom Kernel for Velleman K8000 on Fedora Core 4
Update for Fedora 7. It now seems there is no need to compile your own kernel. The device is there per defailt. So now you can jump to
Edit the modules.conf file.
How to get Velleman K8000 working in Fedora Core 4.
You can also use this guide for other distributions but then you have to find an alternative source of information for downloading and installing the kernel sources.
Velleman requires a kernel module which is not enabled per default in the Fedora kernels.
Solution is to rebuild Fedora FC4 kernel sources.
Download source RPM
The kernel source RPM for Fedora Core 4 can be found here
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/SRPMS/
Look for the kernel-VERSION_FC4.src.rpm file.
I will use the filename kernel-2.6.13-1.1526_FC4.src.rpm in the following.
And save them anywhere (in your home dir for example)
Create source tree
Now we need to get from RPM to kernel source tree and located at the good old /usr/src tree.
rpm -Uvh kernel-2.6.13-1.1526_FC4.src.rpm
This writes the RPM contents into
/usr/src/redhat/SOURCES
and
/usr/src/redhat/SPECS
.
Prepare the kernel sources using the commands:
cd /usr/src/redhat/SPECS
rpmbuild -bp --target $(arch) kernel-2.6.spec
Move source tree to /usr/src
Now we move it to the
/usr/src
tree and make a link called linux pointing to it
cd /usr/src/redhat/BUILD/kernel-2.6.13
mv linux-2.6.13/ /usr/src/
cd /usr/src
ln -s linux-2.6.13 linux
cd /usr/src/linux
Get right config file
Next step is to get the right config file.
The .config which is already there is for i686 standard single CPU. If you need something else copy the desired config file from the /usr/src/linux/configs directory.
I needed the smp version.
cp configs/kernel-2.6.13-i686-smp.config .config
Start up your kernel configurator
make menuconfig
(text mode for text terminal access)
For activating the modules needed for Velleman K8000 navigate to
Device Drivers ->
I2C Support ->
I2C Hardware Bus Support and activate Parallel Port Adapter and Parallel Port Adapter (light)
The one that is known to work with kernel 2.6.10 is Parallel Port Adapter (i2c-parport module). Activate both as Module so that you can choose one or the other.
Finally save and exit
(optional)
Open the Makefile in an editor.
Find the line
EXTRAVERSION = -prep
and change it to a name that describes the special kernel version you are building. For example
EXTRAVERSION = -velleman
Build Kernel
Now we build the kernel the standard way.
make bzImage
make modules
make modules_install
make install
It is nice to keep the config we used for some other time.
cp /usr/src/linux/.config /boot/config-2.6.13-velleman
Edit the Grub config file
Edit
/boot/grub/grub.conf
To activate the new kernel as default set default=0.
Reboot the machine
You should now get the new kernel activated.
Edit the modules.conf file
We add an option to modules.conf so that the i2c_parport module is loaded with the option type=2
Open
/etc/modules.conf
in an editor.
Add this line
options i2c-parport type=2
Now we want to load our new kernel module
Run these two commands
modprobe i2c-parport
modprove i2c-dev
Try and run
lsmod
to check that the module is loaded.
Identify the device name assigned.
Go to the directory
/sys/class/i2c-dev
You should normally see two devices: i2c-0 and i2c-1. However you may see more. If you have a TV card or a video capture card you will see a device for each BT878 chip. Each device is a directory. If you change directory you will see 3 files: dev, device, and name. If you look at the name the Velleman device is the one called "Parallel port adapter".
cd i2c-1
cat name
In this example the device was i2c-1
Setup udev for the velleman device
Now we create a device alias called velleman instead of the silly i2c-1 and change access rights to it so that all users can access it.
Go to this directory
cd /etc/udev/rules.d
create a new text file called 05-local.rules
I use nano (I hate vi).
nano 05-local.rules
Make just this one line.
KERNEL="i2c-1", SYMLINK="velleman", MODE="0666"
Save it cntl-O and quit cntl-X
Load Velleman driver when booting
The Velleman driver needs a little help to get loaded.
In
/etc/rc.d/rc.local
add these lines.
# Load i2c driver modules for velleman
modprobe i2c-parport
modprobe i2c-dev
Reboot and hope for the best
Velleman Library - libk8000
The library you need is libk8000. You can find it both as sources and RPM here
http://struyve.mine.nu:8080/index.php?block=k8000
The rpm is not very new but it loads fine on Fedora Core 4. Install it with
rpm -ivh libk8000-2.1.2-1.i386.rpm
You can also download it from sources and build it with
make && make install
--
KennethLavrsen - 16 Oct 2005