Kernel - Guide-Maemo-4 1 X
Kernel - Guide-Maemo-4 1 X
Kernel Guide
1 Kernel Guide 2
1.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Getting Kernel Sources . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Configuring Source Tree and Compiling Kernel . . . . . . . . . . 3
1.4 Changing Default Kernel Configuration . . . . . . . . . . . . . . 4
1.5 Configuring and Compiling Kernel Modules . . . . . . . . . . . 4
1.6 Flashing Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1
Chapter 1
Kernel Guide
This chapter describes how to configure, compile and flash the Linux kernel
for the Internet Tablet device. The chapter is targeted at developers wishing to
compile their own custom kernels for the device.
1.1 Prerequisites
Before starting, the maemo environment should be set up. The required GCC
toolchain that is used to compile the kernel is included in the Scratchbox by
default.
It is not mandatory to set up a separate target for kernel compilation, but
this example does it in case the default armel target has been modified in some
special way.
• Start Scratchbox
$ scratchbox
N.B.
The username above refers to your login name in the
environment. If you have used the maemo installer,
the rootstraps are under your home directory. If you
have performed a manual installation, the rootstrap is
under /scratchbox/packages directory. This should be
paid attention to, when running the sb-conf command
above.
2
• Verify that the sources.list file inside the scratchbox environment is cor-
rect. If the below lines are not in the /etc/apt/sources.list file, add them
there.
deb http://repository.maemo.org/ diablo free non-free
deb-src http://repository.maemo.org/ diablo free non-free
• Compile the kernel image, and check the image file timestamp to ensure
that it is properly created.
[sbox-MaemoKernel: ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source] > make \
bzImage
# compilation output...
[sbox-MaemoKernel: ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source] > ls -l \
arch/arm/boot/zImage
-rwxrwxr-x 1 maemo maemo 1530180 Nov 2 13:40 arch/arm/boot/zImage
Now the device can be flashed with the new kernel image using the Flasher
tool. This should be performed outside Scratchbox. See section 1.6 for short
flashing instructions.
3
1.4 Changing Default Kernel Configuration
The following steps describe how to change the default kernel configuration.
• Restore the original default configuration, just in case it has been changed.
[sbox-MaemoKernel: ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source] > make \
nokia_2420_defconfig
• Edit the configuration file with your editor of choice. It is all right to edit
the file, even though there is a warning against changing it included.
[sbox-MaemoKernel: ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source] > vi \
.config
• Edit the configuration file and define that the NFS will be a kernel module.
[sbox-MaemoKernel: ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source] > vi \
.config
4
• Check with the find command to see what kernel object files (extension
.ko) there now are.
[sbox-MaemoKernel: ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source] > find \
. -name "*.ko" -ls
1219535 20 -rw-rw-r-- 1 maemo maemo 19452 Nov 2 13:48
./arch/arm/mach-omap2/observability.ko
1219539 12 -rw-rw-r-- 1 maemo maemo 8304 Nov 2 13:48
./arch/arm/mach-omap2/peeknpoke.ko
1219543 8 -rw-rw-r-- 1 maemo maemo 5928 Nov 2 13:48
./arch/arm/mach-omap2/snapshot.ko
2967668 168 -rw-rw-r-- 1 maemo maemo 167603 Nov 2 13:48
./net/sunrpc/sunrpc.ko
2710063 32 -rw-rw-r-- 1 maemo maemo 31503 Nov 2 13:48
./drivers/usb/gadget/g_ether.ko
2710071 24 -rw-rw-r-- 1 maemo maemo 22481 Nov 2 13:48
./drivers/usb/gadget/gadgetfs.ko
2710067 36 -rw-rw-r-- 1 maemo maemo 36142 Nov 2 13:48
./drivers/usb/gadget/g_file_storage.ko
2890706 128 -rw-rw-r-- 1 maemo maemo 124939 Nov 2 13:48 ./fs/ext3/ext3.ko
1219547 12 -rw-rw-r-- 1 maemo maemo 9159 Nov 2 13:48 ./fs/mbcache.ko
2890698 8 -rw-rw-r-- 1 maemo maemo 5922 Nov 2 13:48
./fs/exportfs/exportfs.ko
2890702 64 -rw-rw-r-- 1 maemo maemo 60734 Nov 2 13:48 ./fs/ext2/ext2.ko
2890710 68 -rw-rw-r-- 1 maemo maemo 61687 Nov 2 13:48 ./fs/jbd/jbd.ko
2890718 144 -rw-rw-r-- 1 maemo maemo 142363 Nov 2 13:48 ./fs/nfs/nfs.ko
2890722 112 -rw-rw-r-- 1 maemo maemo 109711 Nov 2 13:48 ./fs/nfsd/nfsd.ko
2890714 80 -rw-rw-r-- 1 maemo maemo 75526 Nov 2 13:48
./fs/lockd/lockd.ko
The list of .ko files might differ from the list above, depending on whether
some additional changes were made to the .config file. The important files
are sunrpc.ko, nfs.ko and lockd.ko. Check that you have those.
5
6