Differences between revisions 9 and 10
Revision 9 as of 2017-07-29 13:10:05
Size: 2533
Editor: RogerShimizu
Comment: remove the non required "binary-indep" target
Revision 10 as of 2017-07-29 13:18:03
Size: 2774
Editor: RogerShimizu
Comment: Make the ARCH triplet more flexible
Deletions are marked like this. Additions are marked like this.
Line 56: Line 56:
export $(dpkg-architecture -aarmel) # This triplet is defined in
# https://anonscm.debian.org/cgit/kernel/linux.git/tree/debian/config/<ARCH>/
# and its sub-directories.
# Here is just an example
ARCH=armel
FEATURESET=none
FLAVOUR=marvell

export $(dpkg-architecture -a$ARCH)
Line 60: Line 68:
# disable -dbg (debug) package is only possible when distribution="UNRELEASED" in debian/changelog
# export DEBIAN_KERNEL_DISABLE_DEBUG=yes
# Disable -dbg (debug) package is only possible when distribution="UNRELEASED" in debian/changelog
#export DEBIAN_KERNEL_DISABLE_DEBUG=yes
Line 66: Line 74:
fakeroot make -f debian/rules.gen setup_armel_none_marvell
fakeroot make -f debian/rules.gen binary-arch_armel_none_marvell
fakeroot make -f debian/rules.gen setup_${ARCH}_${FEATURESET}_${FLAVOUR}
fakeroot make -f debian/rules.gen binary-arch_${ARCH}_${FEATURESET}_${FLAVOUR}


Simple steps to cross-build Debian Kernel package. The following steps confirmed working under Stretch.

Install Cross-Build Dependency

apt install fakeroot git kernel-wedge quilt ccache crossbuild-essential-<ARCH>

BTW. The following ARCH support cross-build explained here.

# apt-cache search crossbuild-essential-
crossbuild-essential-arm64 - Informational list of cross-build-essential packages
crossbuild-essential-armel - Informational list of cross-build-essential packages
crossbuild-essential-armhf - Informational list of cross-build-essential packages
crossbuild-essential-mipsel - Informational list of cross-build-essential packages
crossbuild-essential-powerpc - Informational list of cross-build-essential packages
crossbuild-essential-ppc64el - Informational list of cross-build-essential packages

Get DFSG tarball of Kernel

Simple way if it already reached archive:

wget https://deb.debian.org/debian/pool/main/l/linux/linux_4.9.30.orig.tar.xz

Other a few ways to get the pristine tarball of upstream linux kernel:

Example:

# get whole git repo from internet, more than 1GB and may need hours to finish
git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable ../linux-stable
# generate DFSG compatible kernel source
debian/bin/genorig.py ../linux-stable

Clone Git Repo of Debian Kernel

git clone -n https://anonscm.debian.org/git/kernel/linux.git debian-kernel
cd debian-kernel
# list all tags
git tag -l
# starting from a release is a good idea
git checkout -b stretch debian/4.9.30-2+deb9u2

Cross Build

Take ARM/armel, flavour marvell as example.

# This triplet is defined in
#   https://anonscm.debian.org/cgit/kernel/linux.git/tree/debian/config/<ARCH>/
# and its sub-directories.
# Here is just an example
ARCH=armel
FEATURESET=none
FLAVOUR=marvell

export $(dpkg-architecture -a$ARCH)
export PATH=/usr/lib/ccache:$PATH
# Build profiles is from: https://anonscm.debian.org/cgit/kernel/linux.git/tree/debian/README.source
export DEB_BUILD_PROFILES="nopython nodoc pkg.linux.notools"
# Disable -dbg (debug) package is only possible when distribution="UNRELEASED" in debian/changelog
#export DEBIAN_KERNEL_DISABLE_DEBUG=yes

fakeroot make -f debian/rules clean
fakeroot make -f debian/rules orig
fakeroot make -f debian/rules source
fakeroot make -f debian/rules.gen setup_${ARCH}_${FEATURESET}_${FLAVOUR}
fakeroot make -f debian/rules.gen binary-arch_${ARCH}_${FEATURESET}_${FLAVOUR}


CategoryKernel