Compiling Kernel and/or modules using Crosstool
Posted: 18 Apr 2007, 07:03
NOTE: the following is a rough walkthrough, and might not be the best way of doing things. Crosstools could probably be set up much nicer than this. And it was a while back i did this myself, so i might missed some step, this particular "howto" is NOT verified to work by me. Use at your own risk.
If you find anything wrong, please let me know and i'll edit this post.
Read through the whole thing before starting.
Compile kernel modules for Bubba on a x86-linux workstation using crosstool:
Get, configure and install crosstool
wget http://kegel.com/crosstool/crosstool-0.43.tar.gz
tar zxvf crosstool-0.43.tar.gz
edit crosstool-0.43/demo-arm.sh
set path for where to store crosstool, example: /opt/crosstool
uncomment all "eval"-strings except:
eval `cat arm.dat gcc-4.0.2-glibc-2.3.2-tls.dat` sh all.sh --notest
run script demo-arm.sh
This could possibly take several hours, if you run into problems. Consult manuals at http://kegel.com/crosstool/
Read documentation on crosstool and verify that your crosscompiler is working for ARM-platform.
Get kernel source
wget http://ftp.sunet.se/pub/Linux/kernels/v ... 16.tar.bz2
Get at91patch
wget http://download.excito.net/kernel/2.6.1 ... 1.patch.gz
Get Excito patches and config
wget http://download.excito.net/kernel/2.6.1 ... .16.tar.gz
Create build directory
mkdir build
Move into that
cd build
Extract kernel source
tar jxvf ../linux-2.6.16.16.tar.bz2
Move into the kernel directory
cd linux-2.6.16.16/
Apply atmel patch
zcat ../../2.6.16-at91.patch.gz | patch -p1
Apply Excito patch
cat ../../linux26/excito.patch | patch -p1
Add excito config
cp ../../linux26/excito.config .config
NOTE: in the following you will need to change the "/opt/arm/bin/arm-linux-" path to whatever path you choose
to install crosstools in, for example: "/opt/crosstool/gcc-4.0.2-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-linux-"
Build initial config
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- oldconfig
Change config as needed
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- menuconfig
NOTE: This step is not necessary if you only want modules!
Build the kernel
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- zImage
Build modules
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- modules
Install modules locally
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- INSTALL_MOD_PATH=`pwd`/tmpinstall modules_install
Make archive of modules
cd tmpinstall
tar zcvf modules.tar.gz *
Copy modules.tar.gz over to Bubba
Log in to bubba and become root.
Install modules:
cd /
tar zxvf /"path/to/modules"/modules.tar.gz
depmod -a
load the modules you want, for example:
modprobe ip_tables
If you find anything wrong, please let me know and i'll edit this post.

Read through the whole thing before starting.
Compile kernel modules for Bubba on a x86-linux workstation using crosstool:
Get, configure and install crosstool
wget http://kegel.com/crosstool/crosstool-0.43.tar.gz
tar zxvf crosstool-0.43.tar.gz
edit crosstool-0.43/demo-arm.sh
set path for where to store crosstool, example: /opt/crosstool
uncomment all "eval"-strings except:
eval `cat arm.dat gcc-4.0.2-glibc-2.3.2-tls.dat` sh all.sh --notest
run script demo-arm.sh
This could possibly take several hours, if you run into problems. Consult manuals at http://kegel.com/crosstool/
Read documentation on crosstool and verify that your crosscompiler is working for ARM-platform.
Get kernel source
wget http://ftp.sunet.se/pub/Linux/kernels/v ... 16.tar.bz2
Get at91patch
wget http://download.excito.net/kernel/2.6.1 ... 1.patch.gz
Get Excito patches and config
wget http://download.excito.net/kernel/2.6.1 ... .16.tar.gz
Create build directory
mkdir build
Move into that
cd build
Extract kernel source
tar jxvf ../linux-2.6.16.16.tar.bz2
Move into the kernel directory
cd linux-2.6.16.16/
Apply atmel patch
zcat ../../2.6.16-at91.patch.gz | patch -p1
Apply Excito patch
cat ../../linux26/excito.patch | patch -p1
Add excito config
cp ../../linux26/excito.config .config
NOTE: in the following you will need to change the "/opt/arm/bin/arm-linux-" path to whatever path you choose
to install crosstools in, for example: "/opt/crosstool/gcc-4.0.2-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-linux-"
Build initial config
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- oldconfig
Change config as needed
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- menuconfig
NOTE: This step is not necessary if you only want modules!
Build the kernel
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- zImage
Build modules
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- modules
Install modules locally
make ARCH=arm CROSS_COMPILE=/opt/arm/bin/arm-linux- INSTALL_MOD_PATH=`pwd`/tmpinstall modules_install
Make archive of modules
cd tmpinstall
tar zcvf modules.tar.gz *
Copy modules.tar.gz over to Bubba
Log in to bubba and become root.
Install modules:
cd /
tar zxvf /"path/to/modules"/modules.tar.gz
depmod -a
load the modules you want, for example:
modprobe ip_tables