aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2023-04-01 23:22:09 -0400
committerTheodore Ts'o <tytso@mit.edu>2023-04-01 23:35:37 -0400
commite3309f769882397e605f956755dfec30f1f3f196 (patch)
tree2cec9b763266b35f5a07919d71a8dd536aea78fa
parent8672804daa67855739592070e1732991179c2ba9 (diff)
downloadxfstests-bld-e3309f769882397e605f956755dfec30f1f3f196.tar.gz
kernel-build: work around backwards incompatible change in "make bindeb-pkg"
Starting in v6.3-rc3, "make bindeb-pkg" made an incompatible change in how the debian package version is constructed, by dropping CONFIG_LOCALVERSION from the package version. This might make sense given that Debian and Ubuntu try to adhere to Stable ABI nonsense with their Distribution kernels, but the default version chosen by "make bindeb-pkg" isn't compatible with the stable ABI nonsense versioning scheme in any case, so the change just breaks upstream developers for no good reason. Fix this by overriding the package version using KDEB_PKGVERSION, which is not documented, but hopefully it won't also incompatibly change in the future. :-( Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rwxr-xr-xkernel-build/kbuild20
1 files changed, 19 insertions, 1 deletions
diff --git a/kernel-build/kbuild b/kernel-build/kbuild
index 16dfb7cd..4ab9ea28 100755
--- a/kernel-build/kbuild
+++ b/kernel-build/kbuild
@@ -153,7 +153,25 @@ rm -f "$BLD_DIR/linux-image.deb" "$BLD_DIR/linux-image-dbg.deb" \
if test -n "$DO_DPKG" ; then
$NO_ACTION make "${MAKE_ARGS[@]}" prepare
REL=$(make "${MAKE_ARGS[@]}" kernelrelease | grep -v ^make)
- $NO_ACTION time nice make "KDEB_SOURCENAME=linux-${REL}" "${MAKE_ARGS[@]}" \
+ MAJOR=$(echo $REL | awk -F. '{print $1}')
+ MINOR=$(echo $REL | awk -F. '{print $2}')
+ if test -f "$BLD_DIR/.version" ; then
+ NUM=$(cat "$BLD_DIR/.version")
+ # Starting in 6.1, how "make bindeb-pkg" handled the
+ # .version numbering randomly changed; accomodate that
+ # here. Things are broken starting in 6.1-rc1 until 6.1-rc6
+ # but we won't worry about that here. See commit
+ # 5db8face97f8 ("kbuild: Restore .version auto-increment behaviour
+ # for Debian packages") which fixed the problem but in a way
+ # which was different compared to how 6.0 and earlier kernels
+ # handled things.
+ if test "$MAJOR" -ge 6 -a "$MINOR" -ge 1 ; then
+ NUM=$(( $NUM + 1 ))
+ fi
+ else
+ NUM=1
+ fi
+ $NO_ACTION time nice make "KDEB_PKGVERSION=$REL-$NUM" "KDEB_SOURCENAME=linux-${REL}" "${MAKE_ARGS[@]}" \
bindeb-pkg "$@"
err=$?
d="$BLD_DIR/.."