Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp465521rwr; Wed, 19 Apr 2023 08:48:53 -0700 (PDT) X-Google-Smtp-Source: AKy350afVtOZsMlNyyS2Igc5EIbtpEwtp3U4M583ueKn1iSCQgCNWMMC2tWT1N0+PdV1eCNG3P6g X-Received: by 2002:a05:6a20:7d9e:b0:f0:e3ed:4699 with SMTP id v30-20020a056a207d9e00b000f0e3ed4699mr4547903pzj.54.1681919333540; Wed, 19 Apr 2023 08:48:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681919333; cv=none; d=google.com; s=arc-20160816; b=cAvFcdnytgDEqNj8JTqR9bQsDUJBDTjKV8T4h1VPF2OkAo8isFulSMo864cKrfVZlQ HF1W92QEwZDU0aLlE4l7omcMy0eVFzf3UMGf26n3NSqoR5KGNjWi1kzNqsywOm7/Lui9 wW90aUhqXuMUJUQScU29bEhZBMOg9gqzi+qN/yqRDreaxggIPtEUBXpRb7aPnpvqIPhK dYfVCQZKgw1lBELF4vVwJKzbE4exuPC54V5nGj7XCFGtG9slcZOOKhXvGL/591VrQvpj GHa26NNJv50onqzBGd5gPjnJbCP/3l2DLa+ZlQgH2CQmESJs70iD4RTs2uZPqOCa6jcZ zcHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Nd+koPI0j77r5KQKm4obUTxtkr0JULdHmmkj1GI35N4=; b=Cqjuq/XAmCt6trlfeTJe0Ovg1x74fX3K1inynNDFM2jRk0x+p0W+/qZpWh3DzJl+wR 8Ad6MPMQwmMlkbRVy9Bnny3AhDMhKSca60I13sJ8Q//pvms63BGqs9IdBByEgeOpADUJ j73zEBDlR1KKekJ4isavB5fh7dnO/Jw41LcwOsLFSsJVhGVsmiPjj2rQAZCtufgzPT2F fBRRXveXcqbNa3Dizx5aVxeW5hKNWRKlSl18hwI+PaEqzaWOIlMi5i35bpnUUP2fLrsR VUDZ492a7xcHoPm2ZBm+7ECPyo0oIbGf+I34H6yHumm9GQnJAQ1IUhYnH24e40/5LQtH +LaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s8uo2Zza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g62-20020a636b41000000b0051323bafb4bsi16124252pgc.841.2023.04.19.08.48.35; Wed, 19 Apr 2023 08:48:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s8uo2Zza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233650AbjDSPp1 (ORCPT + 99 others); Wed, 19 Apr 2023 11:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233661AbjDSPpN (ORCPT ); Wed, 19 Apr 2023 11:45:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6CBA5D5; Wed, 19 Apr 2023 08:45:08 -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 20BB963CB5; Wed, 19 Apr 2023 15:45:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81BA0C433A0; Wed, 19 Apr 2023 15:45:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681919107; bh=90/tbLhV1ayXAjshEn/Ria2dF5WRQsSyCH03+eREOJc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=s8uo2ZzagsbAOEk23kn6eQh/sW+2gj9qRvXTVv7AyUQMn7PH9TO3+WnO09ss9M1yq 7PRwnTdQnwonVvkv2Wu30dwc42VxhDcCvlxDLC4n+c402I+KV0pkkC4QRwcXKldqEq AiUU9UFgx7Jxx7INXCmH/PZ1La+SDfbLXNQ17I8Jrg4XQUDypid/gdbW5lBnU8xk43 UUlTQV85ThCyImKOPGWrHDBim9HgyjnZzppFdZYOkeVpzs+5OQVcARqOBxRBYkfNKT As2gJoXlPx8NxE9IjrHKvS8wuUloziFo4NiNwi9rEGvsJxOSWjT2T1W0nyb24Otjlx w55wiXN+Ure8w== Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6a5e7482961so895663a34.3; Wed, 19 Apr 2023 08:45:07 -0700 (PDT) X-Gm-Message-State: AAQBX9fU/S7GZNPkyBh2FQQK/gkPE50K6lE/ipRGOlAOEGBbqKnUdgNX bdOShRySdxlYbiLd2tMRzpofGpqFa0uXXZ/k/OM= X-Received: by 2002:a05:6870:1687:b0:184:af3:910d with SMTP id j7-20020a056870168700b001840af3910dmr80817oae.32.1681919106743; Wed, 19 Apr 2023 08:45:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Thu, 20 Apr 2023 00:44:30 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: rpm-pkg: fix rpm-pkg build error To: 29581992@qq.com Cc: nathan@kernel.org, ndesaulniers@google.com, nicolas@fjasle.eu, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, sunjw10@lenovo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2023 at 12:18=E2=80=AFPM <29581992@qq.com> wrote: > > From: Jiwei Sun > > The following error will trigger when building rpm-pkg > $ make rpm-pkg > SYNC include/config/auto.conf.cmd > HOSTLD scripts/kconfig/conf > UPD include/config/kernel.release > UPD .tmp_HEAD > ARCHIVE linux.tar.gz > sh ./scripts/package/mkspec >./kernel.spec > rpmbuild --target x86_64-linux -bs kernel.spec \ > --define=3D'_smp_mflags %{nil}' --define=3D'_sourcedir rpmbuild/SOURCES' = --define=3D'_srcrpmdir .' > Building target platforms: x86_64-linux > Building for target x86_64-linux > Wrote: ./kernel-6.3.0_rc7-47.src.rpm > rpmbuild --target x86_64-linux -rb kernel-6.3.0_rc7-47.src.rpm \ > --define=3D'_smp_mflags %{nil}' > Installing kernel-6.3.0_rc7-47.src.rpm > Building target platforms: x86_64-linux > Building for target x86_64-linux > Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.QtGSXP > + umask 022 > + cd /mnt/datapart/rpmbuild/BUILD > + cd /mnt/datapart/rpmbuild/BUILD > + rm -rf linux > + /usr/bin/gzip -dc /mnt/datapart/rpmbuild/SOURCES/linux.tar.gz > + /usr/bin/tar -xof - > + STATUS=3D0 > + '[' 0 -ne 0 ']' > + cd linux > /var/tmp/rpm-tmp.QtGSXP: line 40: cd: linux: No such file or directory > error: Bad exit status from /var/tmp/rpm-tmp.QtGSXP (%prep) > > There is linux.tar, not linux, and the linux.tar.gz is create by the foll= owing > quiet_cmd_archive =3D ARCHIVE $@ > cmd_archive =3D git -C $(srctree) $(git-config-tar$(suffix $@)) ar= chive \ > --output=3D$$(realpath $@) --prefix=3D$(basename $@)= / $(archive-args) > Here the $@ is linux.tar.gz, and $(basename $@) will be linux.tar, > The above fact is the cause, so use $(basename $(basename $@)) to get the= right directory name. > > Signed-off-by: Jiwei Sun > --- > scripts/Makefile.package | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > index 4d90691505b1..3718ecdf9edf 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= )" > > quiet_cmd_archive =3D ARCHIVE $@ > cmd_archive =3D git -C $(srctree) $(git-config-tar$(suffix $@)) ar= chive \ > - --output=3D$$(realpath $@) --prefix=3D$(basename $@)= / $(archive-args) > + --output=3D$$(realpath $@) --prefix=3D$(basename $(b= asename $@))/ $(archive-args) Thanks for the report and patch, but this would introduce another regression for 'make perf-tar-src-pkg'. If you run it on the mainline the file name will be "perf-6.3.0-rc7.tar" The inner $(basename ...) will strip ".tar", then the outer $(basename ...) will strip ".0-rc7". The resulting prefix will become "perf-6.3/" while the expected prefix is "pref-6.3.0-rc7/". > > # Linux source tarball > # ----------------------------------------------------------------------= ----- > -- > 2.27.0 > --=20 Best Regards Masahiro Yamada