Kernel compilation HOWTO

By Trevor Batley <trevor AT batley.id.au>
March 2005.
Edited by Mike Eriksen

 

You want to recompile the thinstation kernel. Maybe to add other drivers or kernel options. Here is a quick guide.

First time you will need to setup your compile area.
This can be anywhere (eg. /home/<me>/compile), but please do it as a non-root user. In the following commands I
have used the version numbers for the TS-2.1rc2 release. Just use the appropriate numbers for yours.

Download thinstation_src-TS-2.1rc2.tar.bz2 from sourceforge
Download kernel-2.4.28-TS-2.1.tar.bz2 from sourceforge
# tar -jxvf thinstation_src-2.1.tar.bz2
# cd thinstation_src-2.1
# cd source
# tar -jxvf ../../kernel-2.4.28-TS-2.1.tar.bz2
# cd kernel-2.4.28/linux-2.4.28
(backup the kernel config file:)
# cp .config ../.config.orig
# make distclean
(run menuconfig - don't change anything, just save)
# make menuconfig
# cp ../.config.orig .config

Now, each time you want to do some changes and recompile:
cd to <your compile area>/thinstation_src-2.1
(enter chrooted build environment)
# ./RUNME
# cd source/kernel-2.4.28/linux-2.4.28
(Next select options and save)
# make menuconfig
(compile of the kernel & modules)
# cd ..
# ./setup.sh
# cd linux-2.4.28
# make modules_install
(exit from the chrooted environment)
# exit
cd to your thinstation build environment
# cd utils
edit the SOURCE_PATH file to point at your compile environment (pico is just an editor - use your own favorite)
# pico SOURCE_PATH
# cd scripts
(copy over your kernel, system map & modules:)
# ./update_kernel.sh

You should be able to build a Thinstation image that works OK (at least mine did).

Note:
If you want to do each step by hand, the setup.sh in the kernel
directory does the following:
make clean
make dep
make bzImage
make modules