From patchwork Fri Mar 14 13:10:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 14020012 Received: from us-smtp-delivery-162.mimecast.com (us-smtp-delivery-162.mimecast.com [170.10.133.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C9051F63F0 for ; Mon, 17 Mar 2025 22:42:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.162 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742251339; cv=none; b=BE0L4H07ECgEZ+Bnm4SN+RW5kdATGIc/enEBd/25kVwLTj+KRtDkQwW6Gg6XTX+N1vwWSE/dLKVZOeeT6p7xvywJG5dXabAB+I65A1mVpfaJibvGHAfJFJCuP69iHJgUNyB9hlIfBmF3puIsn2wU3oQE/wC2aYAeqYfhNeHekZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742251339; c=relaxed/simple; bh=o6y+XyffX9wmjk0Np+rMurFlpcoCW1araA3fSvob6fY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:content-type; b=H+rozy7TOuXcuLeVp4NpfcaCz2haigL29rzpoc4NDscHvIEEq3gG+uQ9GOkOdfF3UC9+mWeJXQ2VE3Ol4F/vqUeEiqMjEYKYqmKh8mUDpwpqeyZfZsqPYE4elVFWtZeXfbd4z5enXsHza7WgjxpVDsFJqZ6ySkTmOwXfjcVp538= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hp.com; spf=pass smtp.mailfrom=hp.com; dkim=pass (1024-bit key) header.d=hp.com header.i=@hp.com header.b=f4+s6LOG; arc=none smtp.client-ip=170.10.133.162 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hp.com header.i=@hp.com header.b="f4+s6LOG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hp.com; s=mimecast20180716; t=1742251335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KXBti98LcS5GzDZjVFDN2KRvwCsazYpAUZPSb/VmakA=; b=f4+s6LOGi3PFbiPFmjv9qXQ+8S7WErahm2cIoroAi6Ig1IKldfPyd6AsIuS4Xo/hU5szea mB/lbd0nMHAPJexzHaMmyLnmAcjDNynH0WI4kuT+51nXT5SontYfE/GigNLBOLQ+e7WY2u vopuM0/kadgDTKURDDZnHr8AKNNqd4Q= Received: from g7t16454g.inc.hp.com (hpifallback.mail.core.hp.com [15.73.128.143]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-GE-CncSxPaS36qHP86rU4w-1; Mon, 17 Mar 2025 18:42:13 -0400 X-MC-Unique: GE-CncSxPaS36qHP86rU4w-1 X-Mimecast-MFC-AGG-ID: GE-CncSxPaS36qHP86rU4w_1742251332 Received: from g8t13021g.inc.hpicorp.net (g8t13021g.inc.hpicorp.net [15.60.27.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by g7t16454g.inc.hp.com (Postfix) with ESMTPS id 2815060001E3; Mon, 17 Mar 2025 22:42:11 +0000 (UTC) Received: from localhost.localdomain (unknown [15.53.255.151]) by g8t13021g.inc.hpicorp.net (Postfix) with ESMTP id E2BD56000E9D; Mon, 17 Mar 2025 22:42:02 +0000 (UTC) From: Alexandru Gagniuc To: masahiroy@kernel.org, nathan@kernel.org, linux-kbuild@vger.kernel.org Cc: nicolas@fjasle.eu, linux-kernel@vger.kernel.org, Alexandru Gagniuc , stable@vger.kernel.org Subject: [PATCH v2] kbuild: deb-pkg: don't set KBUILD_BUILD_VERSION unconditionally Date: Fri, 14 Mar 2025 13:10:53 +0000 Message-ID: <20250314131053.23360-1-alexandru.gagniuc@hp.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: AcJvXP5ds0quVNHi_XUetwHV32LpSMQ9M0I0zkTtFmU_1742251332 X-Mimecast-Originator: hp.com content-type: text/plain; charset=WINDOWS-1252; x-default=true In ThinPro, we use the convention +hp 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 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 7d4f07d5cb71 ("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. Cc: Fixes: 7d4f07d5cb71 ("kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rules") Signed-off-by: Alexandru Gagniuc Reviewed-by: Nicolas Schier --- Changes since v1: * Rework logic so that dpkg-parsechangelog is invoked just once * Adjust commit message to reflect review feedback scripts/package/debian/rules | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index ca07243bd5cd..d1f400685682 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -21,9 +21,11 @@ ifeq ($(origin KBUILD_VERBOSE),undefined) endif endif -revision = $(lastword $(subst -, ,$(shell dpkg-parsechangelog -S Version))) +revision = $(shell dpkg-parsechangelog -S Version | sed -n 's/.*-//p') CROSS_COMPILE ?= $(filter-out $(DEB_BUILD_GNU_TYPE)-, $(DEB_HOST_GNU_TYPE)-) -make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) KBUILD_BUILD_VERSION=$(revision) $(addprefix CROSS_COMPILE=,$(CROSS_COMPILE)) +make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) $(addprefix \ + KBUILD_BUILD_VERSION=,$(revision)) $(addprefix \ + CROSS_COMPILE=,$(CROSS_COMPILE)) binary-targets := $(addprefix binary-, image image-dbg headers libc-dev)