Homepage Wiki Forum Buy

Kernel compile + Module installation

From GNUBLIN

difficulty level Prerequisites Gnublin Family
Gnublin logo advanced.png C/C++ Development Environment installation All

Contents

The Kernel

This article explains how to compile and install the Gnublin kernel (2.6.33)

For beginners

With GNUBLIN distribution

For compiling the kernel and its modules you have to be in possession of a cross toolchain for the arm architecture. The Gnublin Distribution makes this automatically! First you should install the Gnublin Distribution like it is described in this article.

You can configure your kernel and add some additional modules during the setup process of the distribution.

If you want to add some configurations or modules after you have started the setup once, you first have to delete the hidden file .stamp_kernel in the root directory gnublin/lpc3131 and restart the build_GNUBLIN_support_package script. After this you must manually copy the zImage and the modules from the directory output to the root directory of your SD-Card.

For experts

Directly from source code

Download the Kernel

git clone https://github.com/embeddedprojects/gnublin-lpc3131-2.6.33.git
cd gnublin-lpc3131-2.6.33/linux-2.6.33-lpc313x

Configure the Kernel

Before you can configure your kernel, you must be sure that you have sourced your toolchain-Path. You can do this with the following script:

    P1=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi/
    P2=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/bin/armv5te-linux-gnueabi/

    export ARCH=arm 
    export CROSS_COMPILE=arm-linux-gnueabi-
    export PATH=$P1:$P2:$PATH

Just create a file called set.sh and enter the text above. Make sure that you mark the file as executable.

After this you have to source this file with the following command:

. ./set.sh

(Dot Space Dot/set.sh !!)

Attention: If you source this file, it is only sourced for the terminal in which you sourced it. After you close the terminal you have to source the file again! So you have to source the script each time you restart your PC/Laptop!

If you are sure that you have sourced your toolchain-path you can configure the kernel with the following commands:

make gnublin_defconfig
make menuconfig

The first command must be executed only once. It only copies the preconfigured .config file into your kernel directory. The second command starts the menuconfig gui.

Compile the kernel

After the configuration, you can compile the kernel with the command below:

make zImage

With the following command you can copy the zImage to your (mounted) SD-Card.

sudo cp arch/arm/boot/zImage /media/label_of_your_SD-CARD/

Compile the modules

Of course you have to copy the modules onto your SD-Card, too.

Just compile the modules, install them and copy them to the SD-Card.

make modules
make modules_install


Copy files to your SD card

To update the modules and your kernel on the sd card, you have to replace the file zImage and folder "/lib/".

You can do this with these commands (Change the mount point of you sd card):

Copy zImage

sudo cp arch/arm/boot/zImage /media/Label_SD_Karte

Copy folder lib

sudo cp -r ${INSTALL_MOD_PATH}/lib /media/Label_SD_Karte


kernel.tar.gz fpr gnublin-installer

To install the new kernel with the installer you need a archiv file. You can create this like we described it here:

Compile the files:

make zImage
make modules

create an new folder to copy the files:

mkdir kernel_archiv
make modules_install INSTALL_MOD_PATH=kernel_archiv
cp arch/arm/boot/zImage kernel_archiv

and now you can create the archiv:

cd kernel_archiv
tar cfvz kernel.tar.gz zImage lib/

The kernel.tar.gz can now choose with the gnublin-installer.


Backport Kernel

A backport kernel is a variant in between the old 2.6 kernel and drivers of the 3.x kernel, an intermediate layer in the form of a library of kernel modules and is thus permits the operation of new hardware with the 2.6 kernel. http://backports.wiki.kernel.org provides for this purpose compat-drivers for the subsystems Ethernet, Wireless and Bluetooth. How this works ins detail is documented at the Backport Kernel article.


Good News, the Compat-Wireless-Drivers work also with the Debian Distribution! Same principle as in the Backport Kernel article!

In other languages