HowTo: Install chroot and cross compile kernel/packages for armel March 15, 2016 04:27PM |
Registered: 8 years ago Posts: 17 |
# download packages: debootstrap --arch amd64 --foreign --variant=minbase jessie /the/chroot/directory http://ftp.us.debian.org/debian/ # enter chroot: chroot /the/chroot/directory /bin/bash -l # install packages: DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C /debootstrap/debootstrap --second-stage # some packages need following directory: mkdir /root/tmp # leave chroot: exit
cd /the/chroot/directory for DIR in dev dev/pts proc sys do mount -o bind /$DIR $DIR done
apt-get update dpkg --add-architecture armel
echo deb http://emdebian.org/tools/debian/ jessie main >> /etc/apt/sources.list apt-get install curl curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add - apt-get update
apt-get install gcc-arm-linux-gnueabi dpkg-dev libc6:armel libncurses5-dev libssl-dev bc debhelper
cd /usr/src wget -O - https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.0.tar.xz | tar xJvSome source packages expect to find kernel sources in the directory /usr/src/linux, create a link
ln -s linux-4.4.0 linuxYou probably compile for Marvell-kirkwood. Thus, you should apply bodhi patch. Download linux-4.4.0-kirkwood-tld-1-bodhi.tar.bz2. This requires a web browser. You have to do it outside of the chroot and then move it inside to /usr/src directory. Return to chroot, unpack and patch the kernel source.
tar xjvf linux-4.4.0-kirkwood-tld-1-bodhi.tar.bz2 cd linux patch -p1 <../linux-4.4.0-kirkwood-tld-1.patchThe bodhi kernel config is a good point to start:
cp ../config-4.4.0-kirkwood-tld-1 .configKernel sources contain Makefile. It is used by the make command to automate all tasks related to configuration and building. To cross compile you should always use it in the following way:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make <target>Actually, this is the only difference between native and cross compilation. Useful targets are:
Re: HowTo: Install chroot and cross compile kernel/packages for armel March 16, 2016 03:49PM |
Registered: 9 years ago Posts: 1,037 |
Re: HowTo: Install chroot and cross compile kernel/packages for armel March 25, 2016 01:05PM |
Registered: 8 years ago Posts: 298 |
Re: HowTo: Install chroot and cross compile kernel/packages for armel March 25, 2016 10:06PM |
Registered: 10 years ago Posts: 162 |
Re: HowTo: Install chroot and cross compile kernel/packages for armel March 31, 2016 07:42AM |
Registered: 9 years ago Posts: 1,037 |
Re: HowTo: Install chroot and cross compile kernel/packages for armel April 06, 2016 03:32PM |
Registered: 11 years ago Posts: 149 |
time make deb-pkg -j`nproc` LOCALVERSION=-$(date "+%Y%m%d") KDEB_PKGVERSION=$(date "+%H%M%S")The time it took:
real 361m19.714s user 471m57.180s sys 35m3.150s
time ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make deb-pkg -j`nproc` LOCALVERSION=-$(date "+%Y%m%d") KDEB_PKGVERSION=$(date "+%H%M%S")The time it took:
real 11m47.630s user 27m12.674s sys 2m23.189s
Re: HowTo: Install chroot and cross compile kernel/packages for armel April 07, 2016 12:20AM |
Admin Registered: 13 years ago Posts: 18,495 |
Re: HowTo: Install chroot and cross compile kernel/packages for armel April 07, 2016 11:36PM |
Registered: 11 years ago Posts: 149 |
Re: HowTo: Install chroot and cross compile kernel/packages for armel April 08, 2016 03:51AM |
Admin Registered: 13 years ago Posts: 18,495 |