public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Change in kernel debian packages between -rc2 and -rc3
Date: Sat, 1 Apr 2023 23:37:29 -0400	[thread overview]
Message-ID: <20230402033729.GA619325@mit.edu> (raw)
In-Reply-To: <20230328040917.GC108653@mit.edu>

I've worked around this in xfstests-bld.

					- Ted

commit e3309f769882397e605f956755dfec30f1f3f196
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sat Apr 1 23:22:09 2023 -0400

    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>

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/.."

      reply	other threads:[~2023-04-02  3:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25 14:31 Change in kernel debian packages between -rc2 and -rc3 Theodore Ts'o
2023-03-26  3:39 ` Masahiro Yamada
2023-03-26 12:11   ` Theodore Ts'o
2023-03-27  7:34     ` Kalle Valo
2023-03-27 13:35     ` Masahiro Yamada
2023-03-28  4:09       ` Theodore Ts'o
2023-04-02  3:37         ` Theodore Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230402033729.GA619325@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox