diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-01-06 17:39:44 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-01-06 17:39:44 +0100 |
commit | 4327fe1f2fc03729b8ae3dc8c409a697d66c89ed (patch) | |
tree | 6301654ae4142a2e70eab0e0137fced5f23b0943 /scripts/build-kernel | |
parent | d0d363186d180f9d16d0d33983e088726214f25d (diff) | |
parent | 081bf77f86881b9c2438902595193c2a311b02cd (diff) | |
download | vyos-build-4327fe1f2fc03729b8ae3dc8c409a697d66c89ed.tar.gz vyos-build-4327fe1f2fc03729b8ae3dc8c409a697d66c89ed.zip |
Merge remote-tracking branch 'runborg/current' into current
* runborg/current:
Added build-kernel script and almost total rewrite of build-submodules
Diffstat (limited to 'scripts/build-kernel')
-rwxr-xr-x | scripts/build-kernel | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/build-kernel b/scripts/build-kernel new file mode 100755 index 00000000..80229d5d --- /dev/null +++ b/scripts/build-kernel @@ -0,0 +1,36 @@ +#!/bin/bash +if [ ! -f "Makefile" ]; then + echo "Makefile missing, This script needs to be executed inside the vyos-kernel package directory" + exit 1 +fi + +if grep -Fxq "KBUILD_OUTPUT" Makefile; then + echo "Wrong Makefile?, This script needs to be executed inside the vyos-kernel package directory" + exit 1 +fi + + +# newer Kernel versions come with a "# SPDX-License-Identifier: GPL-2.0" identifier +# as the first line in the file - use compatible approach with grep rather then sed +VERSION=$(grep "^VERSION" Makefile | grep -Eo '[0-9]{1,4}') +PATCHLEVEL=$(grep "^PATCHLEVEL" Makefile | grep -Eo '[0-9]{1,4}') +SUBLEVEL=$(grep "^SUBLEVEL" Makefile | grep -Eo '[0-9]{1,4}') +ARCH=$(dpkg --print-architecture) + +case "$ARCH" in + amd64) + make x86_64_vyos_defconfig + TARGETS="kernel_source kernel_debug kernel_headers kernel_image" + # the following targets are not supported for Linux Kernels > 4.14 as + # they have been removed from the Makefile (commits 18afab8c1d3c2 & + # 22cba31bae9dc). + if [ ${PATCHLEVEL} -lt 14 ]; then + TARGETS+=" kernel_manual kernel_doc" + fi + CONCURRENCY_LEVEL=4 LOCALVERSION="" make-kpkg --rootcmd fakeroot --initrd --append_to_version -amd64-vyos --revision=$VERSION.$PATCHLEVEL.$SUBLEVEL-1+vyos1+current1 -j4 ${TARGETS} + ;; + + armhf) + make armhf_vyos_defconfig + ;; +esac |