====== Compiling Linux kernel ======
===== Used versions =====
* Ubuntu 10.04 i386 (VMware Virtual Machine)
* ELDK 4.2
===== Preparation =====
Install the git source code management system.
user@ubuntu:~$ sudo apt-get install git-core stgit uboot-mkimage
Create a directory for the Linux source code:
tq@ubuntu:~$ mkdir ~/src
tq@ubuntu:~$ cd ~/src
==== Get source code ====
The current BSP (October 2011) is based on the 2.6.39 kernel of Denx software engineering. The base version of this source code you get from the Git server http://git.denx.de.
tq@ubuntu:~/src$ git clone http://git.denx.de/linux-denx.git
tq@ubuntu:~/src$ cd linux-denx
Create local branch named p2020 with the source code of version DENX-v2.6.39:
tq@ubuntu:~/src/linux-denx$ git checkout -b p2020 DENX-v2.6.39
==== Patch sources ====
Unpack the archive with the patches into a local folder e.g. to ''~/src/BSP/Linux/patches''.
The directory containing the patches is on the included DVD, and on the [[http://www.tq-group.com/tqmp2020#product-downloads|TQ product page]].
The patches are now applied to the kernel sources:
tq@ubuntu:~/src/linux-denx$ stg init
tq@ubuntu:~/src/linux-denx$ stg import -t -s ~/src/BSP/Linux/patches/series
===== Build kernel =====
If the ELDK has been
[[en:tqmp2020:installation_eldk_toolchain#eldk_cross_compiler_configuration|configured]]
according to the instructions the cross compilation toolchain is ready to compile the kernel.
Configure and build:
tq@ubuntu:~/src/linux-denx$ make 85xx/tqmp2020_defconfig
tq@ubuntu:~/src/linux-denx$ make uImage
If the following error occurs when configuring the kernel source code:
*** Can't find default configuration "arch/x86/configs/85xx/tqmp2020_defconfig"!
then the environment is not configured correctly. For more information see section
[[en:tqmp2020:installation_eldk_toolchain|Installation of the ELDK Toolchain]].
==== Download kernel via TFTP ====
To load the kernel ''uImage'' in the directory ''arch/powerpc/boot'', it has to be copied to the [[en:tftp|TFTP]] root directory. Depending on the configuration of the [[en:tftp|TFTP]] server it is e.g. ''/tftpboot''. Starting from the source directory the ''uImage'' is copied to the ''/tftpboot'' directory with the following command.
tq@ubuntu:~/src/linux-denx$ cp arch/powerpc/boot/uImage /tftpboot