Easily cross-compiling a kernel

To avoid having to export the CROSS_COMPILE variable every time you recompile your cross-compile kernel, a suggestion I found is to define the variable in the Makefile itself. Like so:
ARCH = arm
CROSS_COMPILE = armv5tel-softfloat-linux-gnueabi-

This is nice, but then I get conflicts when I pull in the new kernel updates with git. Or even worse, my kernel version gets tagged as "-dirty" to reflect the modified source tree, as opposed to a pristine git checkout. So, a workaround is to put these in a GNUmakefile (checked first by GNU make, and not managed in the kernel repo).
$ cat <<EOF >GNUmakefile
ARCH = arm
CROSS_COMPILE = armv5tel-softfloat-linux-gnueabi-
include Makefile
EOF

Comments

Popular posts from this blog

FreeIPA cluster with containers

ADSL Router Model CT-5367 user and pass (VIVACOM)

Installing Gentoo with full disk encryption