Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4424363rwb; Sun, 13 Nov 2022 05:59:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf6fPgbsH0drPX/OqbWbt+Jrfnolr0ysItLEkbVKrxV05V2cMofjS0KpiM/m/ikgkqgGAWo1 X-Received: by 2002:a63:fd41:0:b0:42b:68a1:4207 with SMTP id m1-20020a63fd41000000b0042b68a14207mr8483394pgj.326.1668347947516; Sun, 13 Nov 2022 05:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668347947; cv=none; d=google.com; s=arc-20160816; b=vDH3YrhcIz/TFx9MNJfnIZ6kXQLrb0kLsxaXbUOCazXqsm+pDzu24mCs2eD10K5H+K v9ZnHQ7W8IFcg5PMVZtEIczAXSSJo6tOkYQuLz+z7CStAVyGr2lH3iOb+VohEHq0waCL mirtB4Vvds5pc8HPmP2DUKGaQ4VMp9tWEqwKaxpJTXvIT17S4vmbQ26Uv2npjn23B41p 52PvYsQW2/eutBXiyiHjKlIX0faIcfnVPswy9sf2LBGuUKybEyilPTroNPFX1XxbKEeV DEo6fK2v10OxR92Ucy1ZGA9zR4HyBoEf83KiSgiSdgnJhPo6VLTe+Ur+tVQrbdfrTew1 lfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=sLV0JxP70ugmDXDDr3ma22c15gfH+4uTlg/CM2GS6x8=; b=xCr4q3dSH7LCmNiO7Vb3AOnKBshUN+QOPwoMB5SNhwm2o7h0JnJMe8kEv4siwLL+go iCqVArEKGsIMBTrcVlDTye51FnTOL5RMzCBY/HCUKYXVpmLzSQT/k283Fuu7p90tp5oc vKyStBV/OyqANlBM9tY9+44e5w7xuwgapF2qi1uheVWEjn3pEBCwh5q1iJr6nhpmeTOn C5rpQ1WIEB+IJdjqKG1zppBGqPmpy84v7vDhol51vg8AJTrdePToYaP4vdMVVwEYi3Fs 9dAaUJjCZrNOhZJe+oxUByAG6I7SHaV2wpCVtafebZb10JyoaENADyBNYSVhqXUVJDH4 gdNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=C60KnePx; 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 v17-20020a056a00149100b00563a0453c55si7850847pfu.268.2022.11.13.05.58.55; Sun, 13 Nov 2022 05:59:07 -0800 (PST) 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=@nifty.com header.s=dec2015msa header.b=C60KnePx; 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 S235251AbiKMNec (ORCPT + 90 others); Sun, 13 Nov 2022 08:34:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235270AbiKMNea (ORCPT ); Sun, 13 Nov 2022 08:34:30 -0500 Received: from conssluserg-02.nifty.com (conssluserg-02.nifty.com [210.131.2.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4899FCF3; Sun, 13 Nov 2022 05:34:29 -0800 (PST) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 2ADDXrKE031534; Sun, 13 Nov 2022 22:33:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 2ADDXrKE031534 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1668346434; bh=sLV0JxP70ugmDXDDr3ma22c15gfH+4uTlg/CM2GS6x8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=C60KnePxTYXwgiPk9GuLg6rKsWtFaH4bKciY+kRBWENYisS0Clx9Um9WhWY0IGSC1 cRRpAjVjCYPRAW3LubugRmjfSahjZ06J8FyiJeqfdGZu4h7CTePZSmnT1zzeikhn9P 5XTo0vE58IPivwFiXrQjW4esOqkNKOVWFe6k0sDDUBQT52txoBizJwIFgrk5lksrhf WTOjzXC3dZaWRqQmL0DqGc7tMEa7KUQQVMGVkdO7daXIdFBF7OQ2JA94ZynxfcZIxh LnK2s70FMZfLNPLB6jae+xkmlLGDhAtZCk/o5mGoVrM6HVIPpstQ4/5PCFgUXoQjzL Ow1/v4IR5zEWQ== X-Nifty-SrcIP: [209.85.167.175] Received: by mail-oi1-f175.google.com with SMTP id m204so9100959oib.6; Sun, 13 Nov 2022 05:33:53 -0800 (PST) X-Gm-Message-State: ANoB5pmj5MomKsgFr9h3K/lbQ0nzvMS6FxK6QR6RMmKSC+TIppf4WHZS 6YZSWinCcD52dzFVpCGPndyx0yYohJB9eHM+6rw= X-Received: by 2002:a05:6808:208c:b0:354:94a6:a721 with SMTP id s12-20020a056808208c00b0035494a6a721mr4122333oiw.194.1668346432541; Sun, 13 Nov 2022 05:33:52 -0800 (PST) MIME-Version: 1.0 References: <5b59fdb7db34f5292b1d138939c6b70b2b2039dd.1666703850.git.jtoppins@redhat.com> In-Reply-To: <5b59fdb7db34f5292b1d138939c6b70b2b2039dd.1666703850.git.jtoppins@redhat.com> From: Masahiro Yamada Date: Sun, 13 Nov 2022 22:33:16 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH next] kbuild: add ability to make source rpm buildable using koji To: Jonathan Toppins Cc: linux-kbuild@vger.kernel.org, dzickus@redhat.com, kheib@redhat.com, jtornosm@redhat.com, ihuguet@redhat.com, Ivan Vecera , Michal Marek , Nick Desaulniers , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 Tue, Oct 25, 2022 at 10:17 PM Jonathan Toppins wrote: > > From: Ivan Vecera > > Changes: > - added new target 'srcrpm-pkg' to generate source rpm > - added required build tools to spec file > - removed locally compiled host tools to force their re-compile > > Signed-off-by: Ivan Vecera > Signed-off-by: Jonathan Toppins I am fine with this patch. Just minor comments. I noticed an inconsistency between "--target $(UTS_MACHINE)-linux" in the rpm-pkg target and "--target $(UTS_MACHINE)" in the srcrpm-pkg target. I applied 6105e4f6511d6b383738be89efb99c607e158a29 just a few months ago. Is it better to make it consistent here? Actually, I do not know koji, also not sure if it is important to mention it in the commit subject. I just tested this patch by using 'rpmbuild' command on my local machine. > --- > scripts/Makefile.package | 10 ++++++++++ > scripts/package/mkspec | 7 +++++++ > 2 files changed, 17 insertions(+) > > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > index 8bbcced67c22..e0830a870394 100644 > --- a/scripts/Makefile.package > +++ b/scripts/Makefile.package > @@ -62,6 +62,16 @@ rpm-pkg: > +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ > --define='_smp_mflags %{nil}' > > +# srcrpm-pkg > +# --------------------------------------------------------------------------- > +PHONY += srcrpm-pkg > +srcrpm-pkg: > + $(MAKE) clean > + $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec > + $(call cmd,src_tar,$(KERNELPATH),kernel.spec) > + +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ts $(KERNELPATH).tar.gz \ > + --define='_smp_mflags %{nil}' --define='_srcrpmdir $(srctree)' > + > # binrpm-pkg > # --------------------------------------------------------------------------- > PHONY += binrpm-pkg > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > index 70392fd2fd29..dda00a948a01 100755 > --- a/scripts/package/mkspec > +++ b/scripts/package/mkspec > @@ -33,6 +33,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ > --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ > --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" > > +test -n "$LOCALVERSION" && MAKE="$MAKE LOCALVERSION=$LOCALVERSION" > + > # We can label the here-doc lines for conditional output to the spec file > # > # Labels: > @@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' < URL: https://www.kernel.org > $S Source: kernel-$__KERNELRELEASE.tar.gz > Provides: $PROVIDES > +$S BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex > +$S BuildRequires: gcc make openssl openssl-devel perl python3 rsync > + > # $UTS_MACHINE as a fallback of _arch in case > # /usr/lib/rpm/platform/*/macros was not included. > %define _arch %{?_arch:$UTS_MACHINE} > @@ -80,6 +85,8 @@ $S$M against the $__KERNELRELEASE kernel package. > $S$M > $S %prep > $S %setup -q > +$S rm -f scripts/basic/fixdep scripts/kconfig/conf > +$S rm -f tools/objtool/{fixdep,objtool} > $S > $S %build > $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} > -- > 2.31.1 > -- Best Regards Masahiro Yamada