Simple steps to cross-build Debian Kernel package. The following steps were confirmed working under Stretch and buster (as of 2018-03-23).

Install Cross-Build Dependency

apt install fakeroot git kernel-wedge quilt ccache flex bison libssl-dev dh-exec rsync libelf-dev bc 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

Clone Git Repo of Debian Kernel

git clone -n debian-kernel
cd debian-kernel
# list all tags
git tag -l
# starting from a stable release is a good idea
git checkout stretch

Get DFSG tarball of Kernel

Simple way if it already reached archive:


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


# get whole git repo from internet, more than 1GB and may need hours to finish
git clone ../linux-stable
# generate DFSG compatible kernel source
debian/bin/ ../linux-stable

Cross Build

Take ARM/armel, flavour marvell as example.

# This triplet is defined in
# and its sub-directories.
# Here is just an example

export $(dpkg-architecture -a$ARCH)
export PATH=/usr/lib/ccache:$PATH
# Build profiles is from:
export DEB_BUILD_PROFILES="cross nopython nodoc pkg.linux.notools"
# Enable build in parallel
export MAKEFLAGS="-j$(($(nproc)*2))"
# Disable -dbg (debug) package is only possible when distribution="UNRELEASED" in debian/changelog
[ "$(dpkg-parsechangelog --show-field Distribution)" = "UNRELEASED" ] &&

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}

The last two lines can also be simplified, but with a "sed" hack to debian/rules.gen below. In this way, udeb packages will be also built.

fakeroot make -f debian/rules.gen setup_${ARCH}
sed -i "s/binary-arch_${ARCH}:: binary-arch_${ARCH}_extra binary-arch_${ARCH}_${FEATURESET} binary-arch_${ARCH}_real/binary-arch_${ARCH}:: binary-arch_${ARCH}_extra binary-arch_${ARCH}_${FEATURESET}/" debian/rules.gen
fakeroot make -f debian/rules.gen binary-arch_${ARCH}

Speed up the build

From d-kernel thread:

You should be able to save time and disk space by disabling debug info, as that won't make any difference to the eventual kernel size. You can do that by adding "debug-info: false" to the [build] section in debian/config/armel/defines.

ccache can also be useful, though it doesn't help if you change a config symbol that affects some widely used header file.