From patchwork Mon Nov 5 07:51:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 150149 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2294930ljp; Sun, 4 Nov 2018 23:52:04 -0800 (PST) X-Google-Smtp-Source: AJdET5f57PbNiDvIGnapL+rXLXT5kjp+Et9DjM5n6s03fKtNr2X7IDJsAbWxdz2kACcOJ1gGNUzl X-Received: by 2002:a62:68c3:: with SMTP id d186-v6mr21766100pfc.195.1541404324157; Sun, 04 Nov 2018 23:52:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541404324; cv=none; d=google.com; s=arc-20160816; b=FbmbZMElxm2y0i7hSe/qF24WuhTKCg9X8gsOO2OjDl5HHH6QR3W3XPkvhkf43q9gYc q/nF0pvw0PTmn8kOisI1JKN2ZStWasQv6rsH4Zd+B68003iNxkg4ONYCuKm+YYqRn4pP Rm0VLu40V2spO52udZDY8eJEaS4rpv/GHPWoOSa/vagLh5TXSJI/ZIAi/9axW1Tm2kyB qOJXu46IKV+aUdn4p+wLwOgPP02Bq1+cWFtDsBxuzbz9GZnWYUWqJEFJRUc/C1gbSkWN hTkoRbNiF6YkGf19+u367TMR6LLV6jyKKbmmDA9z/vPlb1x+gRgFMviCKtQ7BrueqTLy SS3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=Ky64pjkITSG1WadKggZwWDNiCTTYsg8LtsnvMFTT3xc=; b=x71g3UmuffB8EDvlCTSMm3V6hR0nWbVajgFWwP9Zm3JLwYxEJEFkHp3U8CwHUVXij/ +stdPfCv8wI+AvbowNJ+P6PIOOy+z3gbmFYvkwbuvS24/OCfd3eS9dvw7rnDPdpSGgVJ ZM0WxXnMnZtU/IWo/2S4jjQ/0YwQQMxFzmIbp8RQVEWiPFId7p+eBzuae9FdMymQDDfY aV+TK2UT7W23JZFPoPqE0m/e/+VR/4okocB8qMzbDe1OBPbKcmfeMzZxnCzxXtXzuo6M pgoHschCse5qkpkxnFTK8GFvDIt5826A+89TJNK4HC66N++SXyJS89y/5PkXWUgtdImI iQaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=fu1jrOVw; 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 f2-v6si20323776plm.306.2018.11.04.23.52.03; Sun, 04 Nov 2018 23:52:04 -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=fu1jrOVw; 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 S1726444AbeKERKZ (ORCPT + 32 others); Mon, 5 Nov 2018 12:10:25 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:62528 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725745AbeKERKZ (ORCPT ); Mon, 5 Nov 2018 12:10:25 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wA57prBd021536; Mon, 5 Nov 2018 16:51:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wA57prBd021536 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541404313; bh=Ky64pjkITSG1WadKggZwWDNiCTTYsg8LtsnvMFTT3xc=; h=From:To:Cc:Subject:Date:From; b=fu1jrOVw4dkKdpNF7o8XtLFeEA+FhKXg0ASr6J5//Q26SPMMMm1KTrPw5X7L5JzQ1 uyYJXaLgs/CFTqXQshdjpnnqlZEDrJ8ykoWFxODu5bkQwz5NO1lur2iepB/NRO4z9p 4dPAJy1D5pMHHljkSOsDDw7H6NC71S0w3F7wkru9zMigXCYJePOPEsr4mDz8vyoi7i QjRiaUHWlmcEukdxfcrQMVquaYi2+5OFHBc2NgLLruUWgerAqj800eefMf2oLd/wF+ gTMxp3wYEQ9NIINu+16to+FJs7yVthpTz82MfWArv9k7KsQWiYF5CmEIalgygr2nuq /GuZBV7c9LWCQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Zhenzhong Duan , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: rpm-pkg: fix binrpm-pkg breakage when O= is used Date: Mon, 5 Nov 2018 16:51:49 +0900 Message-Id: <1541404309-30210-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Zhenzhong Duan reported that running 'make O=/build/kernel binrpm-pkg' failed with the following errors: 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. Prior to commit 80463f1b7bf9 ("kbuild: add --include-dir flag only for out-of-tree build"), both objtree and srctree were added to --include-dir, and the wrong code 'make image_name' was working relying on that. Now, the potential issue that had previously been hidden just showed up. 'make image_name' recurses to the generated $(objtree)/Makefile and ends up with running in srctree, which is incorrect. It should be invoked with '-f $srctree/Makefile' (or KBUILD_SRC=) to be executed in objtree. Fixes: 80463f1b7bf9 ("kbuild: add --include-dir flag only for out-of-tree build") Reported-by: Zhenzhong Duan Signed-off-by: Masahiro Yamada --- scripts/package/mkspec | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/scripts/package/mkspec b/scripts/package/mkspec index e05646d..009147d 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -12,6 +12,7 @@ # how we were called determines which rpms we build and how we build them if [ "$1" = prebuilt ]; then S=DEL + MAKE="$MAKE -f $srctree/Makefile" else S= fi @@ -78,19 +79,19 @@ $S %prep $S %setup -q $S $S %build -$S make %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} +$S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} $S %install mkdir -p %{buildroot}/boot %ifarch ia64 mkdir -p %{buildroot}/boot/efi - cp \$(make image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE + cp \$($MAKE 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 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 +$M $MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install + $MAKE %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE cp .config %{buildroot}/boot/config-$KERNELRELEASE bzip2 -9 --keep vmlinux