From 1d6ec630d636067d802de522638396132989923a Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 7 Nov 2026 07:50:06 +0000 Subject: Kernel: T9591: add VyOS internal revision to the kernel release string Rebuilding the same upstream kernel with additional patches, e.g. urgent security fixes, produced the exact same release string and package name as the previous build. A patched image could not be told apart from an unpatched one. A new kernel_revision default is now placed between the upstream version and the flavor, so 6.18.60-vyos becomes 6.18.60-1-vyos. It ends up in uname -r, the module directory, the linux-image package name and its Debian version; out-of-tree modules follow automatically. Bump it on every patched rebuild of the same upstream version and reset it to 1 on an upstream bump. The kernel and all module packages must be rebuilt and published along with this change, otherwise the image build cannot find the new linux-image package. --- scripts/package-build/linux-kernel/build-kernel.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts/package-build/linux-kernel/build-kernel.sh') diff --git a/scripts/package-build/linux-kernel/build-kernel.sh b/scripts/package-build/linux-kernel/build-kernel.sh index dea71aa9..14817b06 100755 --- a/scripts/package-build/linux-kernel/build-kernel.sh +++ b/scripts/package-build/linux-kernel/build-kernel.sh @@ -27,8 +27,15 @@ if [ -z "${KERNEL_FLAVOR}" ]; then exit 1 fi +if [ -z "${KERNEL_REVISION}" ]; then + echo "E: KERNEL_REVISION is not set, run via ./build.py so it can be passed from data/defaults.toml" + exit 1 +fi + KERNEL_VERSION=$(make kernelversion) -KERNEL_SUFFIX=-${KERNEL_FLAVOR} +# VyOS internal revision, e.g. 6.18.60-1-vyos - bumped when rebuilding the same +# upstream version with additional patches +KERNEL_SUFFIX=-${KERNEL_REVISION}-${KERNEL_FLAVOR} echo "I: Generate Kernel config" ARCH=$(dpkg --print-architecture) @@ -131,7 +138,7 @@ EOF echo "I: Build Debian Kernel package" touch .scmversion -make bindeb-pkg BUILD_TOOLS=1 LOCALVERSION=${KERNEL_SUFFIX} KDEB_PKGVERSION=${KERNEL_VERSION}-1 -j $(getconf _NPROCESSORS_ONLN) +make bindeb-pkg BUILD_TOOLS=1 LOCALVERSION=${KERNEL_SUFFIX} KDEB_PKGVERSION=${KERNEL_VERSION}-${KERNEL_REVISION} -j $(getconf _NPROCESSORS_ONLN) # Back to the old Kernel build-scripts directory cd $CWD -- cgit v1.2.3