summaryrefslogtreecommitdiff
path: root/schulung_tools/notes
diff options
context:
space:
mode:
Diffstat (limited to 'schulung_tools/notes')
-rw-r--r--schulung_tools/notes/linux-build-targets.txt75
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