Page 1 of 1

GUIDE: CrossCompiling for C series:recompiling kernel

Posted: Fri Aug 30, 2013 10:42 am
by Mkò
For cross compiling on C series you need:
  • A unix system or a virtual image of it.
  • Sources files UExxCxxx.zip example:ue40C8000.zip(I use this)
  • Toolchain that is arm_v7_vfp_le_20091117.tgz
  • native GCC for your linux version. (if you don't install it you get error 2 and error 127 gcc not found)
  • ncurseslib for your linux version. (is necessary for the command menuconfig for configuring kernel options)
So let's start
I use a vmvare image of last CentOS but it work on Ubuntu too.

Open terminal and get root access to avoid permissions problems

Code: Select all

su root 
and type root password
Install subversion (svn) that is needed for get the toolchain from samygo.
On CentOS

Code: Select all

yum install subversion

On Ubuntu

Code: Select all

sudo apt-get subversion

Install native GCC
On CentOS

Code: Select all

yum install gcc

On Ubuntu

Code: Select all

sudo apt-get install gcc build-essential

Instal ncurseslib
On CentOS

Code: Select all

yum install ncurses-devel ncurses

On Ubuntu

Code: Select all

sudo apt-get install libncurses5-dev
go to opt directory

Code: Select all

cd //opt
get cross-compilation toolchain from samygo svn

Code: Select all

svn checkout svn://svn.code.sf.net/p/samygo/code/develop/toolchains/T-VAL
You'll find the toolchain in //opt/T-VAL/arm_v7_vfp_le_20091117 directory

Code: Select all

cd opt/T-VAL/
rename the toolchain dir for simple usage

Code: Select all

mv arm_v7_vfp_le_20091117 arm_v7_vfp_le
add the path to bash.rc

Code: Select all

export PATH=$PATH:/opt/T-VAL/arm_v7_vfp_le/bin
verify that the path is export

Code: Select all

echo $PATH
--------------------------------------------------------------------------------------------------------------------------------------------------- At this point you have a fully working toolchain for C series with this you can compile what do you need if you have right sources.
---------------------------------------------------------------------------------------------------------------------------------------------------

The following instructions are for recompiling the kernel.

make src directory in opt

Code: Select all

mkdir src
copy kernel sources (file linux.tgz from UE40C8000.zip) to //opt/src/

Code: Select all

cp -r linux.tgz //opt/src/
extract kernel sources

Code: Select all

tar xzvf linux.tgz
download this config files (thanks to juuso) download/file.php?id=2029
unzip it and you get file .config.valdeuc

Code: Select all

unzip config_valdeuc.zip
copy .config.valdeuc downloaded to opt/src/linux/ (root of linux kernel sources)

Code: Select all

cp -r .config.valdeuc //opt/src/linux/ 
--> this file is hidden so to see it in terminal you have to use ls -a command, in nautilus you can see it with ctrl+h <--
rename this files .config.valdeuc to .config.old

Code: Select all

mv .config.valdeuc .config.old
Now we are ready to recompile the kernel so go to the root of kernel sources

Code: Select all

cd opt/src/linux

Code: Select all

make ARCH=arm CROSS_COMPILE=arm_v7_vfp_le- oldconfig
make ARCH=arm CROSS_COMPILE=arm_v7_vfp_le- prepare
make ARCH=arm CROSS_COMPILE=arm_v7_vfp_le- prepare scripts
Compile the kernel

Code: Select all

make ARCH=arm CROSS_COMPILE=arm_v7_vfp_le- Image
-->at this point before you proceed is mandatory that you have previously installed the ncurseslib for your linux version. <--

Code: Select all

make ARCH=arm CROSS_COMPILE=arm_v7_vfp_le- menuconfig
Done.
You'll find your recompiled kernel in //opt/src/linux/arch/arm/boot/ as Image.

Re: GUIDE: CrossCompiling for C series:recompiling kernel

Posted: Fri Aug 30, 2013 10:47 am
by juusso
maybe usefull
https://fedoraproject.org/wiki/Building_a_custom_kernel

config i got from arris69, btw.

oops, and you have to have big eggs if you try to install this kernel to your TV. Don`t forget to calculate proper hash for it though! and write it at once to proper partition!

Re: GUIDE: CrossCompiling for C series:recompiling kernel

Posted: Fri Aug 30, 2013 11:39 am
by greenhorn
Great job!