Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp262388imu; Sun, 4 Nov 2018 23:56:33 -0800 (PST) X-Google-Smtp-Source: AJdET5dh20VJlbTgBwhUxd4sj8o0rEw/gAxtRPOLMZ8lzo7lW4O+BVb8yI9Y8I2QfBxDZ0xv/5tH X-Received: by 2002:a63:2744:: with SMTP id n65mr19091380pgn.65.1541404593912; Sun, 04 Nov 2018 23:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541404593; cv=none; d=google.com; s=arc-20160816; b=1BLmu8JycP3umdsrfIbDfZuFEGszL9OT3poG0cee7MEVTK0u/vBDwaU5nfW+9gOwXL 2oEkL9LTvRNHwNIjNRzjjhwlLh4mmt0/SSIqrClUX54FNz9JXiiHFtPABmgAE4X1wsui fNKdAnuLsRXfSeWvkM/jBiTczndYI3oKyXAe9FwB8aR5SxZGEplq4K+/PrLSKOupJ4Eo eVrleIeruZBlKrCAVNe1byRdnQQw0wFqWMiNSim7wxryEEtH65b0MX/GRWVxJ5hp8GYW ncAoSCvQERUoEZeDhGyG1y/QmSiQKLQIL5Btbi/WXLHyTHJ2ZOpmXvgzZBBKXBKt+FHw sN/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=31yB+vN8PrOktbIWxnLsgYSRr8TFZE6bmNDOYgeLUeY=; b=o7fLjeN4LbkfbRQXrCNfQuvDPwbeYSFaQi77vmk5winCaYOT53qbxNU6XKvilq+biu 8i1t/7L7cpuedWeAzwTNOfhnc9QFf16wTnyK/HfiM8/+8y2TpnhLDGFSMp8w/wIwOA4g KMTFftuaa4g4rSDSt40evK2hCYiW2a80OzubWnq5PlyToFutu4k+QA9lG/HL7JstzLcu xjhMknZOqpvJOVIa40WVB9U0fgYHAJZSC28Z9XR0iPStWYJ+isEG5QeO52UEvBxgE5UZ iHRmvXMuQElhaY1BRjW0r9vI4sZgozSMX82C9KieubXaK7dFrjd8GntybCgyfApOAz5x Y0Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=X3sPTIdL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si8535261pgo.23.2018.11.04.23.56.19; Sun, 04 Nov 2018 23:56:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=X3sPTIdL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbeKEROX (ORCPT + 99 others); Mon, 5 Nov 2018 12:14:23 -0500 Received: from conssluserg-04.nifty.com ([210.131.2.83]:65044 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725745AbeKEROX (ORCPT ); Mon, 5 Nov 2018 12:14:23 -0500 Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) (authenticated) by conssluserg-04.nifty.com with ESMTP id wA57tlBl025626; Mon, 5 Nov 2018 16:55:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com wA57tlBl025626 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541404547; bh=31yB+vN8PrOktbIWxnLsgYSRr8TFZE6bmNDOYgeLUeY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=X3sPTIdLo4OhmbzzMEVynVrxnRBDMhcrCHb/wABPyyanb/paKN+nzY1uxIHKInBqH eDqM/1eK77AI65hlz1ZRo03/+PrmZdJT3925gwkWxrZ8dCrc3ryMhAGfuTupmN1xMe Zo1N33iV60k+VkPsinCvKHQSktpFFjMgxuS1gxW1rqUGboojXRN+A+OkMZO3GnyVKU EaJV4NmO6s2B5W0SzhsaDblrWdhVtzBESTQ7CTxhes7ZRYQn4VA2x4gUhu1HrZsAZl 882pB+889uNpC5ube3l0MsPsYQhCDc3Ckv2qVwjmxBJ4AOkCzsGLPo8pCXqJxe4yuU 2EUTsF4RPaxTA== X-Nifty-SrcIP: [209.85.222.53] Received: by mail-ua1-f53.google.com with SMTP id n7so2829102uao.7; Sun, 04 Nov 2018 23:55:47 -0800 (PST) X-Gm-Message-State: AGRZ1gJgH0t7C5rIri/ArUgsJ6HQPZXdFQfH5wMLh+0SQsbNfuqcmrpK KXN3DHtkwZGJH1KEajmtknox1cbCqqWS0h5vhtQ= X-Received: by 2002:ab0:5444:: with SMTP id o4mr9626720uaa.55.1541404546589; Sun, 04 Nov 2018 23:55:46 -0800 (PST) MIME-Version: 1.0 References: <3e40ec15-3a8c-444d-8d32-35ef587f3980@default> In-Reply-To: <3e40ec15-3a8c-444d-8d32-35ef587f3980@default> From: Masahiro Yamada Date: Mon, 5 Nov 2018 16:55:10 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: rpm-pkg: fix two build breaks when O= is used To: zhenzhong.duan@oracle.com Cc: Linux Kernel Mailing List , Linux Kbuild mailing list , srinivas.eeda@oracle.com, Michal Marek Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Zhenzhong, On Fri, Nov 2, 2018 at 8:26 PM Zhenzhong Duan wrote: > > Running 'make O=/build/kernel binrpm-pkg' failed with below two errors. > > Makefile:600: include/config/auto.conf: No such file or directory > > + cp make -C /mnt/root/kernel O=/build/kernel image_name make -f > /mnt/root/kernel/Makefile ... > cp: invalid option -- 'C' > Try 'cp --help' for more information. > > Export KBUILD_OUTPUT when O= is used so that it could be used in locating > include/config/auto.conf > > Use $srctree to locate source dir when generating image name, no matter > if O= is used. > > Signed-off-by: Zhenzhong Duan Sorry for the breakage, and thanks for your report. I'd like to fix the issue in a cleaner way. See this: https://patchwork.kernel.org/patch/10667539/ Thanks. > --- > Makefile | 5 +++++ > scripts/package/mkspec | 4 ++-- > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 9aa352b..df316e5 100644 > --- a/Makefile > +++ b/Makefile > @@ -135,6 +135,7 @@ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ > $(if $(KBUILD_OUTPUT),, \ > $(error failed to create output directory "$(saved-output)")) > > +export KBUILD_OUTPUT > # Look for make include files relative to root of kernel src > # > # This does not become effective immediately because MAKEFLAGS is re-parsed > @@ -597,7 +598,11 @@ virt-y := virt/ > endif # KBUILD_EXTMOD > > ifeq ($(dot-config),1) > +ifeq ($(KBUILD_OUTPUT),) > include include/config/auto.conf > +else > +include $(KBUILD_OUTPUT)/include/config/auto.conf > +endif > endif > > # The all: target is the default when no target is given on the > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > index e05646d..3b4e5e4 100755 > --- a/scripts/package/mkspec > +++ b/scripts/package/mkspec > @@ -84,10 +84,10 @@ $S > mkdir -p %{buildroot}/boot > %ifarch ia64 > mkdir -p %{buildroot}/boot/efi > - cp \$(make image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE > + cp \$(make -C \$srctree image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE > ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/ > %else > - cp \$(make image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE > + cp \$(make -C \$srctree image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE > %endif > $M make %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} KBUILD_SRC= modules_install > make %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr KBUILD_SRC= headers_install > -- > 1.8.3.1 -- Best Regards Masahiro Yamada