07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

As you can see, the package is created with the name “linux-image-2.6.32-falcot_1_i386.<br />

deb”.<br />

8.10.5. Compiling External Modules<br />

Some modules are maintained outside of the official Linux kernel. To use them, they must be<br />

compiled alongside the matching kernel. A number of common third party modules are provided<br />

by Debian in dedicated packages: lustre-source for the Lustre filesystem, qc-usb-source for<br />

the drivers for some USB webcams (Logitech QuickCam Express), etc.<br />

These external packages are many and varied and we won't list them all here; the apt-cache<br />

search source$ command can narrow down the search field. However, a complete list isn't<br />

particularly useful since there is no particular reason for compiling external modules except<br />

when you know you need it. In such cases, the device's documentation will typically detail the<br />

specific module(s) it needs to function under Linux.<br />

For example, let's look at the qc-usb-source package: after installation, a .tar.gz of the module's<br />

sources is stored in /usr/src/. These sources must then be extracted to the working directory:<br />

$ cd ~/kernel/<br />

$ tar xjf /usr/src/qc-usb.tar.bz2<br />

$ ls modules/<br />

qc-usb<br />

NOTE<br />

Save the seings<br />

When using the make-kpkg modules-image command, it is important to use<br />

the same --append-to-version seing used in the previous use of the command<br />

(probably make-kpkg kernel-image), since its value affects the name<br />

of the directory in which the modules are installed, which must correspond<br />

to the kernel version.<br />

Note that make-kpkg must still be invoked from the kernel sources directory,<br />

even when compiling external modules located in other directories.<br />

The module sources are now located in the ~/kernel/modules/qc-usb/ directory. To compile<br />

these modules and create a Debian package, we invoke make-kpkg with the modules-image target<br />

and indicate the location of the modules via the MODULE_LOC environment variable (without<br />

this variable, it uses /usr/src/modules/, which won't work in our case). By default, it tries<br />

to create the packages for all the external modules that you extracted at this location. The --<br />

added-modules option allows to explicitly choose the external modules to compile. To include<br />

more than one, separate them with a comma.<br />

$ export MODULE_LOC=~/kernel/modules<br />

$ cd ~/kernel/linux-source-2.6.32<br />

$ fakeroot make-kpkg --append-to-version -falcot modules-image<br />

[...]<br />

Module /home/roland/kernel/modules/qc-usb processed fine<br />

Chapter 8 — Basic Configuration: Network, Accounts, Printing…<br />

177

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!