summaryrefslogtreecommitdiff
path: root/scripts/package-build/linux-kernel/build-kernel.sh
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-02-21 08:14:56 +0100
committerGitHub <noreply@github.com>2026-02-21 08:14:56 +0100
commitdd3079b4e0a57ffa162c411493097a80b4e29bc0 (patch)
treec75cff90017ecfee80c8bc640fc916862e1a197d /scripts/package-build/linux-kernel/build-kernel.sh
parent3061c79be208cd57f973673c0184d26fe9da0d07 (diff)
parent2d0c394feea707431db39f450a19cb93564c1168 (diff)
downloadvyos-build-dd3079b4e0a57ffa162c411493097a80b4e29bc0.tar.gz
vyos-build-dd3079b4e0a57ffa162c411493097a80b4e29bc0.zip
Merge pull request #1121 from c-po/kernel
Kernel: T8134: consolidate common Kernel features for ARM64 and X86
Diffstat (limited to 'scripts/package-build/linux-kernel/build-kernel.sh')
-rwxr-xr-xscripts/package-build/linux-kernel/build-kernel.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/package-build/linux-kernel/build-kernel.sh b/scripts/package-build/linux-kernel/build-kernel.sh
index 82028244..cae3d8db 100755
--- a/scripts/package-build/linux-kernel/build-kernel.sh
+++ b/scripts/package-build/linux-kernel/build-kernel.sh
@@ -1,7 +1,6 @@
#!/bin/bash
CWD=$(pwd)
KERNEL_SRC=linux
-ARCH=$(dpkg --print-architecture)
set -e
@@ -18,19 +17,31 @@ if [ -d .git ]; then
git clean --force -d -x
fi
-echo "I: Copy Kernel config (x86_64_vyos_defconfig) to Kernel Source"
-cp -rv ${CWD}/arch/ .
+if [ -d /usr/lib/ccache/ ]; then
+ export PATH=/usr/lib/ccache:$PATH
+fi
KERNEL_VERSION=$(make kernelversion)
KERNEL_SUFFIX=-$(awk -F "= " '/kernel_flavor/ {print $2}' ../../../../data/defaults.toml | tr -d \")
+echo "I: Generate Kernel config"
+ARCH=$(dpkg --print-architecture)
if [ "${ARCH}" = "arm64" ]; then
KERNEL_CONFIG=arch/arm64/configs/vyos_defconfig
-else
+ cp ${CWD}/config/arm64/vyos_defconfig ${KERNEL_CONFIG}
+elif [ "${ARCH}" = "amd64" ]; then
KERNEL_CONFIG=arch/x86/configs/vyos_defconfig
+ cp ${CWD}/config/x86/vyos_defconfig ${KERNEL_CONFIG}
+else
+ echo "E: unsupported architecture"
+ exit 1
fi
-echo "KERNEL_CONFIG: ${KERNEL_CONFIG}"
+for KRN_CONF_SNIPPET in $(ls ${CWD}/config/*.config)
+do
+ echo "I: adding configuration snippet ${KRN_CONF_SNIPPET}"
+ cat ${KRN_CONF_SNIPPET} >> ${KERNEL_CONFIG}
+done
# VyOS requires some small Kernel Patches - apply them here
# It's easier to habe them here and make use of the upstream