From patchwork Wed Apr 19 17:04:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13217170 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 0D9CCC6FD18 for ; Wed, 19 Apr 2023 17:04:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233293AbjDSREt (ORCPT ); Wed, 19 Apr 2023 13:04:49 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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=$(firstword $(subst .tar, ,$@))/ but I think it is better to hard-code the prefix. Fixes: f8d94c4e403c ("kbuild: do not create intermediate *.tar for source tarballs") 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 = -c tar.tar.zst.command="$(ZSTD)" quiet_cmd_archive = ARCHIVE $@ cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \ - --output=$$(realpath $@) --prefix=$(basename $@)/ $(archive-args) + --output=$$(realpath $@) $(archive-args) # Linux source tarball # --------------------------------------------------------------------------- @@ -57,7 +57,7 @@ quiet_cmd_archive = ARCHIVE $@ linux-tarballs := $(addprefix linux, .tar.gz) targets += $(linux-tarballs) -$(linux-tarballs): archive-args = $$(cat $<) +$(linux-tarballs): archive-args = --prefix=linux/ $$(cat $<) $(linux-tarballs): .tmp_HEAD FORCE $(call if_changed,archive) @@ -189,7 +189,7 @@ perf-archive-args = --add-file=$$(realpath $(word 2, $^)) \ perf-tarballs := $(addprefix perf-$(KERNELVERSION), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst) targets += $(perf-tarballs) -$(perf-tarballs): archive-args = $(perf-archive-args) +$(perf-tarballs): archive-args = --prefix=perf-$(KERNELVERSION)/ $(perf-archive-args) $(perf-tarballs): tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSION-FILE FORCE $(call if_changed,archive)