BRN:Software:Build and Distribution:Linux

From
Revision as of 14:38, 9 November 2006 by Jeschke (talk | contribs) (→‎Build)
Jump to navigation Jump to search

Vanilla Kernel Sources

$ KERNEL_MIRROR=ftp://ftp.kernel.org/pub/linux/kernel    # or ftp://ftp.informatik.hu-berlin.de/pub/Linux/Kernel/kernel
$ wget $KERNEL_MIRROR/v2.6/linux-2.6.16.13.tar.bz2
$ tar xjf linux-2.6.16.13.tar.bz2

Patch

$ BRN_SVN_REPOS=svn://sarsvn.informatik.hu-berlin.de
$ svn co $BRN_SVN_REPOS/BerlinRoofNet/trunk/platform/wgt634u/kernel-patches
$ cd linux-2.6.16.13
$ for p in ../kernel-patches/{generic,mips,brn}/*.patch
>   do if [ -r $p ]
>     then patch -p1 -i $p || { echo "Apply of patch \"$p\" failed! Exiting..."; break; }
>     fi
> done

Build

If your toolchain is installed in different place than "/sde-wgt-toolchain", please set $CROSS_PATH to your toolchain location:

$ # /sde-wgt-toolchain is the default toolchain location
$ #export CROSS_PATH=/sde-wgt-toolchain
$ sh build.sh  # or "sh build.sh -j4" for SMP machines

Click kernel patch

If this process led to a positive result, you can try to patch your kernel source tree with the click linux kernel patch:

$ cd ..
$ cvs -d :pserver:anoncvs@cvs.pdos.csail.mit.edu:/cvs co -d click-cvs click/release/one
$ # now obsolete by fixed "linux-2.6.16.13-patch"
$ #svn co $BRN_SVN_REPOS/BerlinRoofNet/trunk/click/patches click-patches
$ #cd click-cvs
$ #patch -p1 -i ../click-patches/click-linux-2.6.16.13-patch.patch  # fix some broken stuff
$ cd linux-2.6.16.13
$ patch -p1 -i ../click-cvs/etc/linux-2.6.16.13-patch

If patch was successfully applied, build the modified parts again:

$ sh build.sh  # or "sh build.sh -j4" for SMP machines

Now you should have a linux kernel (vmlinux), which is able to load the click router as a linux kernel module, also called linuxmodule later.

Do not delete your System.map file! You will need later for building click kernel module.

Install Kernel Modules

Prepare to create the rootfs of your later used Linux system, by copying linux kernel modules to the "right" location:

$ make modules_install INSTALL_MOD_PATH=$(pwd)/../root
$ cd ..



Prev | Contents | Next