Versione 1 del 2017-02-08 17:46:21

Nascondi questo messaggio
Italiano English
Modifica History Actions

debian_kernel_crosscompile

My conf: Debian 8 (Jessie) with Backports. 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 woring 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

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=-arch there, otherwise dpkg will not install the kernel. For my orangePi: 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 folder.