============================ Common Linux Build Targets ============================ help (see almost all targets available) *_defconfig (kernel configuration) menuconfig (change kernel configuration) savedefconfig (convert the current configuration to a defconfig) zImage (build arm kernel) modules (build modules) modules_install (install modules) *.dtb (compile the device tree) clean (delete all object files) ================ Pre-Requisites ================ If you want to build and boot a kernel, you need the following: - kernel source - .config kernel configuration file (or defconfig) - device tree (arm/powerpc only) =============================== Create Wrapper mk.sh for make =============================== #!/bin/sh # define prefix to toolchain commands CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- # define the architecture to build for # (this is the directory-name in arch/ ) ARCH=arm export CROSS_COMPILE ARCH exec make $@ =========== Procedure =========== # unpack the kernel soruce tar xJf ~/Downloads/linux-4.18.5.tar.xz # change to kernel source directory cd linux-4.18.5 # configure the kernel for vexpress boards ../mk.sh vexpress_defconfig # perform custom changes to the configuration ../mk.sh menuconfig # save the custom changes as a defconfig ../mk.sh savedefconfig # copy the custom defconfig to the kernel sources # (so it is available as a make target) cp defconfig arch/arm/configs/myboard_defconfig # build the kernel ../mk.sh -j 4 zImage # build the device tree ../mk.sh vexpress-v2p-ca9.dtb # the built kernel is here: arch/arm/boot/zImage # the built device tree is here: arch/arm/boot/dts/vexpress-v2p-ca9.dtb