diff mbox

kbuild: clear KBUILD_SRC when calling 'make' in RPM spec

Message ID 1358003959-5533-1-git-send-email-drbild@umich.edu (mailing list archive)
State New, archived
Headers show

Commit Message

David R. Bild Jan. 12, 2013, 3:19 p.m. UTC
From: "David R. Bild" <drbild@umich.edu>

'make rpm-pkg' and 'make binrpm-pkg' fail when the kernel source is
read-only.  Specifically, when the RPM spec generated by
scripts/package/mkspec is run, KBUILD_SRC happens to be set to the
source location and thus the invocation of 'make headers_install'
fails when an internal call to 'filechk' tries to write a file into
the source tree.

The fix is to clear KBUILD_SRC for the 'make headers_install'
invocation in the spec file, as is already done for the 'make
modules_install' invocation.

Signed-off-by: David R. Bild <drbild@umich.edu>
---
 scripts/package/mkspec |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Marek Feb. 22, 2013, 9:57 a.m. UTC | #1
On Sat, Jan 12, 2013 at 10:19:19AM -0500, David R. Bild wrote:
> From: "David R. Bild" <drbild@umich.edu>
> 
> 'make rpm-pkg' and 'make binrpm-pkg' fail when the kernel source is
> read-only.  Specifically, when the RPM spec generated by
> scripts/package/mkspec is run, KBUILD_SRC happens to be set to the
> source location and thus the invocation of 'make headers_install'
> fails when an internal call to 'filechk' tries to write a file into
> the source tree.
> 
> The fix is to clear KBUILD_SRC for the 'make headers_install'
> invocation in the spec file, as is already done for the 'make
> modules_install' invocation.
> 
> Signed-off-by: David R. Bild <drbild@umich.edu>

Applied to kbuild.git#misc, thanks.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 4bf17dd..fbbfd08 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -95,7 +95,7 @@  echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
 echo "%endif"
 echo "%endif"
 
-echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install'
+echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr KBUILD_SRC= headers_install'
 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
 
 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"