diff options
| author | Christian Poessinger <christian@poessinger.com> | 2020-06-26 10:13:00 +0200 |
|---|---|---|
| committer | Christian Poessinger <christian@poessinger.com> | 2020-06-26 11:21:42 +0200 |
| commit | 3afdd8ceb5a82a7fd9276fc343c5a8b99885fb11 (patch) | |
| tree | 55a2d325230c17a3ef7b7b75129460bd948b070c /packages/linux-kernel/build-kernel.sh | |
| parent | 698319c577e97bae141041530663e958639ff582 (diff) | |
| download | vyos-build-3afdd8ceb5a82a7fd9276fc343c5a8b99885fb11.tar.gz vyos-build-3afdd8ceb5a82a7fd9276fc343c5a8b99885fb11.zip | |
packages: linux-kernel: T2625: import pipeline
Imported Pipeline from https://github.com/vyos/vyos-build-kernel commit
c28976b38b7d98
Diffstat (limited to 'packages/linux-kernel/build-kernel.sh')
| -rwxr-xr-x | packages/linux-kernel/build-kernel.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/packages/linux-kernel/build-kernel.sh b/packages/linux-kernel/build-kernel.sh new file mode 100755 index 00000000..5e9dd88e --- /dev/null +++ b/packages/linux-kernel/build-kernel.sh @@ -0,0 +1,42 @@ +#!/bin/sh +CWD=$(pwd) +KERNEL_SRC=linux + +if [ ! -d ${KERNEL_SRC} ]; then + echo "Linux Kernel source directory does not exists, please 'git clone'" + exit 1 +fi + +echo "I: Copy Kernel config (x86_64_vyos_defconfig) to Kernel Source" +cp x86_64_vyos_defconfig ${KERNEL_SRC}/arch/x86/configs + +cd ${KERNEL_SRC} + +KERNEL_VERSION=$(make kernelversion) +KERNEL_SUFFIX=-$(dpkg --print-architecture)-vyos + +# VyOS requires some small Kernel Patches - apply them here +# It's easier to habe them here and make use of the upstream +# repository instead of maintaining a full Kernel Fork. +# Saving time/resources is essential :-) +PATCH_DIR=${CWD}/patches/kernel +for patch in $(ls ${PATCH_DIR}) +do + echo "I: Apply Kernel patch: ${PATCH_DIR}/${patch}" + patch -p1 < ${PATCH_DIR}/${patch} +done + +echo "I: make x86_64_vyos_defconfig" +# Select Kernel configuration - currently there is only one +make x86_64_vyos_defconfig + +echo "I: Build Debian Kernel package" +make bindeb-pkg LOCALVERSION=${KERNEL_SUFFIX} KDEB_PKGVERSION=${KERNEL_VERSION}-1 -j $(getconf _NPROCESSORS_ONLN) + +echo "I: Generate environment file containing Kernel variable" +cat << EOF >${CWD}/kernel-vars +#!/bin/sh +export KERNEL_VERSION=${KERNEL_VERSION} +export KERNEL_SUFFIX=${KERNEL_SUFFIX} +export KERNEL_DIR=${CWD}/${KERNEL_SRC} +EOF |
