Skip to content

Commit 659b2e6

Browse files
Alexandru Gagniucjfvogel
Alexandru Gagniuc
authored andcommitted
kbuild: deb-pkg: don't set KBUILD_BUILD_VERSION unconditionally
[ Upstream commit 62604063621fb075c7966286bdddcb057d883fa8 ] In ThinPro, we use the convention <upstream_ver>+hp<patchlevel> for the kernel package. This does not have a dash in the name or version. This is built by editing ".version" before a build, and setting EXTRAVERSION="+hp" and KDEB_PKGVERSION make variables: echo 68 > .version make -j<n> EXTRAVERSION="+hp" bindeb-pkg KDEB_PKGVERSION=6.12.2+hp69 .deb name: linux-image-6.12.2+hp_6.12.2+hp69_amd64.deb Since commit 7d4f07d ("kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rules"), this no longer works. The deb build logic changed, even though, the commit message implies that the logic should be unmodified. Before, KBUILD_BUILD_VERSION was not set if the KDEB_PKGVERSION did not contain a dash. After the change KBUILD_BUILD_VERSION is always set to KDEB_PKGVERSION. Since this determines UTS_VERSION, the uname output to look off: (now) uname -a: version 6.12.2+hp ... #6.12.2+hp69 (expected) uname -a: version 6.12.2+hp ... #69 Update the debian/rules logic to restore the original behavior. Fixes: 7d4f07d ("kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rules") Signed-off-by: Alexandru Gagniuc <[email protected]> Reviewed-by: Nicolas Schier <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 528287815ee52a2f5ea68df83e712513a19f9c8a) Signed-off-by: Jack Vogel <[email protected]>
1 parent 31df01b commit 659b2e6

File tree

1 file changed

+4
-2
lines changed
  • scripts/package/debian

1 file changed

+4
-2
lines changed

scripts/package/debian/rules

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ ifeq ($(origin KBUILD_VERBOSE),undefined)
2121
endif
2222
endif
2323

24-
revision = $(lastword $(subst -, ,$(shell dpkg-parsechangelog -S Version)))
24+
revision = $(shell dpkg-parsechangelog -S Version | sed -n 's/.*-//p')
2525
CROSS_COMPILE ?= $(filter-out $(DEB_BUILD_GNU_TYPE)-, $(DEB_HOST_GNU_TYPE)-)
26-
make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) KBUILD_BUILD_VERSION=$(revision) $(addprefix CROSS_COMPILE=,$(CROSS_COMPILE))
26+
make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) \
27+
$(addprefix KBUILD_BUILD_VERSION=,$(revision)) \
28+
$(addprefix CROSS_COMPILE=,$(CROSS_COMPILE))
2729

2830
binary-targets := $(addprefix binary-, image image-dbg headers libc-dev)
2931

0 commit comments

Comments
 (0)