mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: <linux-kernel@vger.kernel.org>, <linux-kbuild@vger.kernel.org>
Cc: Srinivas REDDY Eeda <srinivas.eeda@oracle.com>,
	<yamada.masahiro@socionext.com>, <michal.lkml@markovi.net>
Subject: [PATCH] kbuild: rpm-pkg: fix two build breaks when O= is used
Date: Fri, 2 Nov 2018 04:25:54 -0700 (PDT)	[thread overview]
Message-ID: <3e40ec15-3a8c-444d-8d32-35ef587f3980@default> (raw)

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 <zhenzhong.duan@oracle.com>
---
 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

             reply	other threads:[~2018-11-02 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 11:25 Zhenzhong Duan [this message]
2018-11-05  7:55 ` Masahiro Yamada
2018-11-05  9:25   ` Zhenzhong Duan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e40ec15-3a8c-444d-8d32-35ef587f3980@default \
    --to=zhenzhong.duan@oracle.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=srinivas.eeda@oracle.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®