diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-11-07 07:50:06 +0000 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-11-07 08:27:06 +0000 |
| commit | 1d6ec630d636067d802de522638396132989923a (patch) | |
| tree | f093c672542240f6cd76818f98d6f219a3a3b002 /scripts/package-build/linux-kernel/build-kernel.sh | |
| parent | d167fb685d62f29c8c9a5596c8d8689238f10a1b (diff) | |
| download | vyos-build-1d6ec630d636067d802de522638396132989923a.tar.gz vyos-build-1d6ec630d636067d802de522638396132989923a.zip | |
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.
Diffstat (limited to 'scripts/package-build/linux-kernel/build-kernel.sh')
| -rwxr-xr-x | scripts/package-build/linux-kernel/build-kernel.sh | 11 |
1 files changed, 9 insertions, 2 deletions
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 |
