diff options
| author | John Ogness <john.ogness@linutronix.de> | 2018-09-13 17:24:53 +0206 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2018-09-13 17:24:53 +0206 |
| commit | 3bf64b47c46551cce7b757406f24277033293c2f (patch) | |
| tree | 317ffb96e8e463f17adfa51a6f4457527e5641af /schulung_tools/notes/linux-build-targets.txt | |
| parent | 4ef8e843176a5029c11e291fc09fb23590c17cad (diff) | |
notes: add linux-build-targets
Describes the main targets, files, and procedure dealing with building
kernels.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'schulung_tools/notes/linux-build-targets.txt')
| -rw-r--r-- | schulung_tools/notes/linux-build-targets.txt | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/schulung_tools/notes/linux-build-targets.txt b/schulung_tools/notes/linux-build-targets.txt new file mode 100644 index 0000000..dc6ecd7 --- /dev/null +++ b/schulung_tools/notes/linux-build-targets.txt @@ -0,0 +1,75 @@ +============================ + 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 |
