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.

the choices saved in the .config file. If there is no such file, it behaves like make config, a text<br />

interface that asks all questions (hundreds of them) one a time. If the .config file already exists<br />

but doesn't mention all the existing options, then this method will only ask questions for which<br />

the file has no saved answer.<br />

TIP<br />

make-kpkg --config<br />

make-kpkg can be told to use configuration methods other than make oldco<br />

nfig, by indicating the target (menuconfig, xconfig or gconfig) in the makekpkg<br />

invocation with the --config option.<br />

8.10.4. Compiling and Building the Package<br />

NOTE<br />

Clean up before rebuilding<br />

If you have already compiled once in the directory and wish to recompile with<br />

new sources, you must run fakeroot make-kpkg clean. Additionally, this<br />

allows generating a package with a new name (different --append-to-version<br />

seing).<br />

TIP<br />

Kernel package headers<br />

make-kpkg uses information contained in the /etc/kernel-pkg.conf file to<br />

generate headers for the Debian kernel package. It is recommended to edit<br />

this file with correct information if you wish to publish your kernel package.<br />

Once the kernel configuration is ready, the make-kpkg command provided by Debian compiles<br />

the kernel, then generates the corresponding Debian package (or packages). Just like make,<br />

make-kpkg takes the name of a target to execute as an argument: kernel-image generates a compiled<br />

kernel package, kernel-doc a package containing the documentation included with the<br />

kernel, kernel-headers a package of kernel header files (.h files for the kernel in the include/<br />

directory, which is useful for compilation of some external modules), and kernel-source creates<br />

a package containing the kernel sources.<br />

make-kpkg also accepts several parameters: --append-to-version suffix appends suffix to the<br />

name of the kernel; the suffix is also included in the package name. --revision revision defines<br />

the version number of the package generated. Debian uses certain suffixes to identify standard<br />

kernels, compiled specifically for a given processor, or with certain options (-486, -686, -686-<br />

bigmem, -amd64, -vserver-686, -vserver-686-bigmem, -openvz-686, -xen-686). These suffixes<br />

are best avoided for local packages, so that they can be easily recognized from official packages<br />

issued by the Debian project.<br />

The make-kpkg program performs actions normally restricted to the root user when creating<br />

the Debian package; however, it can be tricked into working under a normal user's identity,<br />

with fakeroot (see sidebar “fakeroot” (page 414)).<br />

$ fakeroot make-kpkg --append-to-version -falcot --revision 1 --initrd kernel-image<br />

[...]<br />

$ ls ../*.deb<br />

../linux-image-2.6.32-falcot_1_i386.deb<br />

176 The Debian Administrator's Handbook

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

Saved successfully!

Ooh no, something went wrong!