From nobody Wed Dec 17 13:43:37 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99A3DC6FD18 for ; Wed, 19 Apr 2023 17:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233469AbjDSREu (ORCPT ); Wed, 19 Apr 2023 13:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233528AbjDSREo (ORCPT ); Wed, 19 Apr 2023 13:04:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD0187AB7; Wed, 19 Apr 2023 10:04:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 635D364108; Wed, 19 Apr 2023 17:04:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52B50C433EF; Wed, 19 Apr 2023 17:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681923870; bh=X+Eye6x1gsVpcrLllmf9tIi7ZkWaLRf+7UxNgxrfenE=; h=From:To:Cc:Subject:Date:From; b=nGR83k9mmtu3T/+XoMr4NXQcI6+b/SjEQK32KUj3U+aIsmuueKOuxD1uOyz3dVlta rs7jbsv3lH56Ccytu4Frqp+Sj6wTBUaf4t/6x/i5TvlIeQOxD2fc9IB4aaN8E976N0 xukd7gwoFiHbhoKzQ00AiIGROQl2Hdjh7gzxFsU9ffLVnHngYn1jsw7MjQm0+VhWeB 0KYxwOeieRRGprpyDYcl9qDp5tiXChd0ESwTm3370PdpvzQFK6zuU4CTo8cckVSaRU EOtmdiDErw1w8gF5uQZwZrdYIy9SRscWBjY11obQm8UPOHOvqEnL7jbNrmdN/pwQCu 2Dv8nLn8Q2WEQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Jiwei Sun , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH] kbuild: use proper prefix for tarballs to fix rpm-pkg build error Date: Thu, 20 Apr 2023 02:04:24 +0900 Message-Id: <20230419170424.78688-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since commit f8d94c4e403c ("kbuild: do not create intermediate *.tar for source tarballs"), 'make rpm-pkg' fails because the prefix of the source tarball is 'linux.tar/' instead of 'linux/'. $(basename $@) strips only '.gz' from the filename linux.tar.gz. You need to strip two suffixes from compressed tarballs and one suffix from uncompressed tarballs (for example 'perf-6.3.0.tar' generated by 'make perf-tar-src-pkg'). One tricky fix might be --prefix=3D$(firstword $(subst .tar, ,$@))/ but I think it is better to hard-code the prefix. Fixes: f8d94c4e403c ("kbuild: do not create intermediate *.tar for source t= arballs") Reported-by: Jiwei Sun Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/Makefile.package | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 4d90691505b1..4000ad04c122 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -49,7 +49,7 @@ git-config-tar.zst =3D -c tar.tar.zst.command=3D"$(ZSTD)" =20 quiet_cmd_archive =3D ARCHIVE $@ cmd_archive =3D git -C $(srctree) $(git-config-tar$(suffix $@)) arch= ive \ - --output=3D$$(realpath $@) --prefix=3D$(basename $@)/ = $(archive-args) + --output=3D$$(realpath $@) $(archive-args) =20 # Linux source tarball # ------------------------------------------------------------------------= --- @@ -57,7 +57,7 @@ quiet_cmd_archive =3D ARCHIVE $@ linux-tarballs :=3D $(addprefix linux, .tar.gz) =20 targets +=3D $(linux-tarballs) -$(linux-tarballs): archive-args =3D $$(cat $<) +$(linux-tarballs): archive-args =3D --prefix=3Dlinux/ $$(cat $<) $(linux-tarballs): .tmp_HEAD FORCE $(call if_changed,archive) =20 @@ -189,7 +189,7 @@ perf-archive-args =3D --add-file=3D$$(realpath $(word 2= , $^)) \ perf-tarballs :=3D $(addprefix perf-$(KERNELVERSION), .tar .tar.gz .tar.bz= 2 .tar.xz .tar.zst) =20 targets +=3D $(perf-tarballs) -$(perf-tarballs): archive-args =3D $(perf-archive-args) +$(perf-tarballs): archive-args =3D --prefix=3Dperf-$(KERNELVERSION)/ $(per= f-archive-args) $(perf-tarballs): tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSIO= N-FILE FORCE $(call if_changed,archive) =20 --=20 2.37.2