Italiano English
Modifica History Actions

Differenze per "debian_kernel_crosscompile"

Differenze tra le versioni 3 e 4
Versione 3 del 2017-02-09 11:19:13
Dimensione: 2068
Autore: 186-102rev
Commento:
Versione 4 del 2017-02-09 11:19:33
Dimensione: 2067
Autore: 186-102rev
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 4: Linea 4:
'''Target:''' OrangePi One, H3 (AllWinner) armhf, .deb only for a specific board '''Target:''' OrangePi One H3 (AllWinner) armhf, .deb only for a specific board

My conf: Debian 8 (Jessie) with Backports, 4 cores, 4Gb RAM.

Target: OrangePi One H3 (AllWinner) armhf, .deb only for a specific board

Install crossbuild packages for the target architecture.

dpkg --add-architecture armhf
apt-get update
apt-get install crossbuild-essential-armhf
apt-get install cross-gcc-dev gcc-arm-none-aebi binutils-arm-linux-gnueabihf 

Install kernel sources

apt-get install linux-source-X.X

Move to your working dir & copy kernel sources.

cd ~
cp /usr/src/linux.source-X.X.tar.xz .

Expand kernel sources

tar xavf linux-source-X.X.tar.xz

Move to sources dir

cd linux-source-X.X 

If you have patches to apply then copy them into linux-source-X.X folder and then for each patch do:

patch -p1 < MYPATCH 

Into arch/arm/ there are all supported boards, choose your board (mine is OrangePi One and it's a sunxi board)

Prepare for configuration, start with a minimum configurations

ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- make sunxi_defconfig

Now, we probably need more modules because that defconfig is a very minimal configuration

ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- make menuconfig

Choose your modules.

* In General Setup -> Stack Protector buffer overflow detection set it to None (or build will fail).

Build!

ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- DEB_BUILD_OPTIONS=nocheck make deb-pkg LOCALVERSION=-YOUR_TARGET_ARCH KDEB_PKGVERSION=$(make kernelversion) -j#num_of_cores

Don't forget to set the target LOCAL_VERSION=-YOUR_TARGET_ARCH (ie: -arm-antani-lpae ), otherwise dpkg will not install the kernel. This is what i did for my OrangePi One:

ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- DEB_BUILD_OPTIONS=nocheck make deb-pkg LOCALVERSION=-armmp-lpae KDEB_PKGVERSION=$(make kernelversion) -j4

Wait until build process completes; ready to use .debs are in the upper level folder.