Installing the FC3 kernel source for a manual LIRC compile
andymyth@gmail.com
tyrstag !at! gmail.com
Return to main site
For whatever reason, there may come a time when you need to do a compile of
LIRC on FC3. One example would be if you have 2 PVR-x50 cards in your system
and also want to use an IR Blaster (currently, the ATRPMS install of LIRC only
allows for 2 IR devices. The two cards each try to load an instance of lirc_i2c,
leaving your blaster high and dry with no driver). I have attempted this below on
a test FC3 box running kernel 2.6.10-1.760_FC3 and was able to successfully get it working.
As always, feel free to contact Pete or myself with any questions.
1.
Install the kernel you want (in my case it was 2.6.10-1.760_FC3). Reboot
to be sure you are now using the just-installed kernel.
2.
Obtain the source rpm for your kernel. Just google for it. If you want to be completely
sure of the kernel version you are running, type:
# uname -r
3.
Install the source kernel with the following command:
# rpm -i kernel-2.6.10-1.760_FC3.src.rpm
Just modify it to whatever your kernel version is
4.
The source is now installed in /usr/src/redhat. We need to set up
the source for your architecture. You will need to navigate to the SPECS
directory by typing:
# cd /usr/src/redhat/SPECS
5.
Before doing anything else, double check to make sure you know what your architecture is.
To find out your architecture, type:
# uname -m
This will spit out a command (maybe i586, i686, etc...). Just make note of
what it is, because you will need to know it for the next step.
6.
See what spec file is the /usr/src/redhat/SPECS directory. (Just do an "ls" to
see the directory contents). For me, it was kernel-2.6.spec. You will need to
do an rpmbuild on this kernel to set up the source tree. To do so, type:
# rpmbuild -bp --target=i686 kernel-2.6.spec
Replace "--target=i686" with whatever your architecture is (see previous step), and "kernel-2.6.spec"
with whatever your spec file is.
7.
You will now need to make a symbolic link pointing at the directory where
your source is. For some reason FC3 sticks it in a location that doesn't play
nice with anything. To do this, type:
# ln -s /usr/src/redhat/BUILD/kernel-2.6.10/linux-2.6.10/ /usr/src/linux-$(uname -r)
As always, the parts that say "kernel-2.6.10" and "linux-2.6.10" may differ for you.
The "linux-$(uname -r)" part will create a directory with the proper name for your
kernel.
8.
You should now have a blown up source tree, and a proper symbolic link to it.
You will need to navigate into the link you just set up to run the configure. Type:
# cd /usr/src/linux-2.6.10-1.760_FC3/
Again, the "linux-2.6.10-1.760_FC3 will vary depending on your kernel version.
9.
Run make oldconfig as follows:
# make oldconfig
10.
After the make oldconfig is done, run make prepare as follows:
# make prepare
====================================================
===The parts below are related to installing LIRC===
====================================================
1.
After you get a copy of LIRC, unzip and untar it (you have to be in the directory
that lirc was downloaded into):
# bzip2 -d *bz2; tar xf *tar
2.
Navigate into the untarred LIRC directory.
3.
You will need to change on of LIRC's files to allow for more than 2 devices. Within the untarred
LIRC directory, navigate to drivers/lirc_dev/ and open the lirc_dev.h file in vi for editing. About 15
lines down you'll see the following:
# define MAX_IRCTL_DEVICES 2
and change it to the following:
define MAX_IRCTL_DEVICES 4
Basically, make sure you uncomment it and change the devices to a number appropriate. So, in my
case with 2 PVR-x50 cards and an IR-Blaster, I would need at least 3 devices. I put in 4 so there's
room for growth. Also note that if you're using even one IR Receiver on a PVR-x50 card, LIRC will
try to load drivers for all of them, so a good rule of thumb is number of PVR-x50 cards + number of IR Blasters +
1 to see how many devices you need.
After you've made the change, save the file and close it. Back out until you are in the main untarred LIRC
directory (not in any subdirectory within it).
4.
Run the following commands to avoid the dreaded libtool error (something about tag=CC not
being present):
# libtoolize -f
After that's done, if it prompts you to run aclocal, then run it:
# aclocal
5.
You will now have to do the configure for LIRC. There are a LOT of different configuration options you can do.
I would reccomend doing it manually, as doing the little "blue screen" configure and setup won't allow you to
install all the drivers you need. So, to setup the configure with "any" driver, run the following for your configure:
# ./configure --with-x=yes --with-syslog --with-transmitter --with-driver=any
Note that the "--with-driver=any" switch will setup support with *almost* any driver. The
LIRC guide goes into this a bit. However,
if you're using Hauppauge cards with a serial IR Blaster, you'll be fine. To be honest probably almost any
setup that you'd be using under MythTV will work fine with this configure.
6.
After the configure is done, run make as follows:
# make
7.
After the make is done, run make install as follows:
# make install
8.
After you have done the make install for the main LIRC setup, you will need to create
kernel modules for any devices you will be using. In my case, I will need a module for
my Hauppauge PVR-250 cards (just one module will cover ANY Hauppage PVR-x50 card, so if you
have a 250 and 350 in the same system, just one module is needed), and another module for my
serial IR blaster. The basic configuration you will need to run is:
# ./configure --with-kerneldir=/usr/src/linux-2.6.10-1.760_FC3
--with-moduledir=/lib/modules/2.6.10-1.760_FC3/kernel/drivers/lirc
--with-x --with-syslog --with-transmitter --with-driver={driver}
Several things to note:
The "--with-kerneldir" directory may be different on your system. It will be based on your
kernel version. If you are unsure what it is, just look at Step 8 above in the part where you installed
the kernel source.
The "--with-moduledir" part may also be different. Again, this is based on your kernel version. I
also had to create the "lirc" directory within the "drivers" directory in that path too.
The "--with-driver" part is where you will put in each driver you need to make a module for. Possible
drivers for this are: lpt1 sir_com3 it87 flyvideo avermedia tekram_bt829
any udp avermedia98 com1 hauppauge atiusb mceusb
So, to create your Hauppauge kernel module for you PVR-x50, you'll run:
# ./configure --with-kerneldir=/usr/src/linux-2.6.10-1.760_FC3
--with-moduledir=/lib/modules/2.6.10-1.760_FC3/kernel/drivers/lirc
--with-x --with-syslog --with-transmitter --with-driver=hauppauge
Then run:
# make
And next run:
# make install
You now have a kernel module for your PVR-x50's IR Receiver to be run by LIRC. Now, do the ./configure again for
your serial IR Blaster:
# ./configure --with-kerneldir=/usr/src/linux-2.6.10-1.760_FC3
--with-moduledir=/lib/modules/2.6.10-1.760_FC3/kernel/drivers/lirc
--with-x --with-syslog --with-transmitter --with-driver=com1
The com1 driver module will work for either com1 or com2. Then run:
# make
And next run:
# make install
Do this for however many devices you need to setup drivers for (i.e. everything you need LIRC to run).
9.
Once the make install has finished for the main install and the kernel modules, you'll need to setup your /etc/modprobe.conf file and your
/etc/rc.d/rc.local files with the information necessary to setup LIRC to control your devices
and start at runtime. I have info on this in the main IR Blaster setup guide under
Step 3. More info can be found in
Jarod's guide. Basically you will need
to load the drivers for each device you want to run in your /etc/modprobe.conf, and then have
your /etc/rc.d/rc.local file initialize each one. This is all well explained in Step 3 of the blaster
guide, and take note of the "Brief discussion" at the bottom of Step 3. Also keep in mind the path for where
lircd is located will be a little different. So for your rc.local file, rather than "/usr/sbin/lircd", it
will be "/usr/local/sbin/lircd". See the next paragraph for more info.
Note that the files from your compile are installed to a couple of places. Your lircd daemon is installed
to /usr/local/sbin/ (along with the lircmd daemon). Your other lirc modules (such as irw and irrecord) are
installed into /usr/local/bin. This is different than the locations LIRC would be in if you downloaded the modules
via apt. Also, trying to load the lircd service will probably bomb out on you. When I run:
# /sbin/service /usr/local/bin/lircd start
or
# /sbin/service lircd start
it just bombs out, telling me that lircd is an unrecognized service. Don't worry about it. We are loading
all necessary LIRC stuff via /etc/rc.d/rc.local, so having it as a service is unnecessary.
10.
After you do this, reboot, and you're DONE!
Return to main site
Return to troubleshooting section
Updated 03/09/2005