All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Nicolas Schier" <nicolas@fjasle.eu>
Subject: [PATCH 2/6] kbuild: deb-pkg: do not take KERNELRELEASE from the source version
Date: Mon, 13 Mar 2023 05:07:27 +0900	[thread overview]
Message-ID: <20230312200731.599706-3-masahiroy@kernel.org> (raw)
In-Reply-To: <20230312200731.599706-1-masahiroy@kernel.org>

KERNELRELEASE does not need to match the package version in changelog.
Rather, it conventially matches what is called 'ABINAME', which is a
part of the binary package names.

Both are the same by default, but the former might be overridden by
KDEB_PKGVERSION. In this case, the resulting package would not boot
because /lib/modules/$(uname -r) does not point the module directory.

Partially revert 3ab18a625ce4 ("kbuild: deb-pkg: improve the usability
of source package").

Reported-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fixes: 3ab18a625ce4 ("kbuild: deb-pkg: improve the usability of source package")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/package/deb-build-option | 9 ++++-----
 scripts/package/mkdebian         | 1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/package/deb-build-option b/scripts/package/deb-build-option
index b079b0d121d4..bd53624318f2 100755
--- a/scripts/package/deb-build-option
+++ b/scripts/package/deb-build-option
@@ -8,9 +8,8 @@ if [ -z "${CROSS_COMPILE}${cross_compiling}" -a "${DEB_HOST_ARCH}" != "${DEB_BUI
 fi
 
 version=$(dpkg-parsechangelog -S Version)
-version_upstream="${version%-*}"
-debian_revision="${version#${version_upstream}}"
-debian_revision="${debian_revision#*-}"
+debian_revision="${version##*-}"
 
-echo KERNELRELEASE=${version_upstream}
-echo KBUILD_BUILD_VERSION=${debian_revision}
+if [ "${version}" != "${debian_revision}" ]; then
+	echo KBUILD_BUILD_VERSION=${debian_revision}
+fi
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index c6fbfb9f74ba..31b050368cd0 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -244,6 +244,7 @@ KERNELRELEASE = ${KERNELRELEASE}
 build-indep:
 build-arch:
 	\$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \
+	KERNELRELEASE=\$(KERNELRELEASE) \
 	\$(shell \$(srctree)/scripts/package/deb-build-option) \
 	olddefconfig all
 
-- 
2.34.1


  parent reply	other threads:[~2023-03-12 20:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 20:07 [PATCH 0/6] kbuild: fix some packaging issues, and use git-archive for source package Masahiro Yamada
2023-03-12 20:07 ` [PATCH 1/6] kbuild: deb-pkg: make debian source package working again Masahiro Yamada
2023-03-12 20:07 ` Masahiro Yamada [this message]
2023-03-13 11:31   ` [PATCH 2/6] kbuild: deb-pkg: do not take KERNELRELEASE from the source version Péter Ujfalusi
2023-03-12 20:07 ` [PATCH 3/6] kbuild: deb-pkg: set CROSS_COMPILE only when undefined Masahiro Yamada
2023-03-12 20:07 ` [PATCH 4/6] kbuild: deb-pkg: split image and debug objects staging out into functions Masahiro Yamada
2023-03-12 20:07 ` [PATCH 5/6] kbuild: deb-pkg: use dh_listpackages to know enabled packages Masahiro Yamada
2023-03-12 20:07 ` [PATCH 6/6] kbuild: use git-archive for source package creation Masahiro Yamada
2023-04-06 15:25   ` youling257
2023-04-07 12:04     ` Masahiro Yamada
2023-03-12 23:26 ` [PATCH 0/6] kbuild: fix some packaging issues, and use git-archive for source package Linus Torvalds
2023-03-13  0:52   ` Masahiro Yamada
2023-03-13 17:33     ` Linus Torvalds
2023-03-16 10:22 ` Leon Romanovsky
2023-03-16 11:24   ` Nicolas Schier
2023-03-16 12:50     ` Leon Romanovsky
2023-03-19  1:12 ` Steev Klimaszewski
2023-03-19  2:19   ` Masahiro Yamada
2023-03-19  3:21     ` Steev Klimaszewski
2023-03-19  6:45       ` Steev Klimaszewski
2023-03-19  7:06       ` Masahiro Yamada
2023-03-19  7:57         ` Steev Klimaszewski
2023-03-19  7:02 ` Leon Romanovsky

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=20230312200731.599706-3-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.