BRN:Software:Build and Distribution:Linux: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→Build) |
||
(14 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
= Patch = |
= Patch = |
||
⚫ | |||
'''<span style="color:red">TODO</span>''' |
|||
$ svn co |
$ svn co $BRN_SVN_REPOS/BerlinRoofNet/trunk/platform/wgt634u/kernel-patches |
||
⚫ | |||
$ cd linux-2.6.16.13 |
$ cd linux-2.6.16.13 |
||
$ for p in ../patches/{generic,mips,brn}/*.patch |
$ 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 = |
= Build = |
||
If your toolchain is installed in different place than "/sde-wgt-toolchain/..." (see [[BRN:Software:Build_and_Distribution:SDE|SDE]]) -- please set $CROSS_PATH to your toolchain location: |
|||
'''<span style="color:red">TODO</span>''' |
|||
$ # /sde-wgt-toolchain/... is the default toolchain location (SO YOU DO _NOT_ NEED TO SET $CROSS_PATH!) |
|||
$ svn cat svn://sarsvn.informatik.hu-berlin.de/....../build.sh > build.sh |
|||
$ #export CROSS_PATH=/sde-wgt-toolchain/openwgt-dev/buildroot/build_mipsel/staging_dir/bin/ |
|||
$ sh build.sh # or "sh build.sh -j4" for SMP machines |
$ 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. |
|||
<span style="color:red">Do not delete your '''System.map''' file! You will need later for building click kernel module.</span> |
|||
= 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 .. |
|||
Latest revision as of 14:43, 9 November 2006
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/..." (see SDE) -- please set $CROSS_PATH to your toolchain location:
$ # /sde-wgt-toolchain/... is the default toolchain location (SO YOU DO _NOT_ NEED TO SET $CROSS_PATH!) $ #export CROSS_PATH=/sde-wgt-toolchain/openwgt-dev/buildroot/build_mipsel/staging_dir/bin/ $ 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 ..