aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2013-06-24 08:48:37 -0400
committerMichal Marek <mmarek@suse.cz>2013-06-24 09:26:14 -0400
commitc398ff00f55d56bec8eb116e9ad3d226998230fa (patch)
tree73752c6ec9b6eaee37f9b61eb0c90744504e26c8
parentcdf2bc632ebc9ef512345fe8e6015edfd367e256 (diff)
kbuild: fix error when building from src rpm
The following issue can be reproduced with Linus' tree on an x86_64 server. >+ cp /home/user/rpmbuild-test/BUILDROOT/kernel-3.9.2.x86_64/boot/vmlinuz-3.9.2 >cp: missing destination file operand after >/home/user/rpmbuild-test/BUILDROOT/kernel-3.9.2-1.x86_64/boot/vmlinuz-3.9.2' >Try `cp --help' for more information. >error: Bad exit status from /var/tmp/rpm-tmp.R4o0iI (%install) Here are the commands to reproduce: make defconfig make rpm-pkg Use the resulting src rpm to build as follows: mkdir ~/rpmbuild-test cd ~/rpmbuild-test rpmbuild --rebuild --define "_topdir `pwd`" -vv ~/rpmbuild/SRPMS/kernel-3.10.0_rc1+-1.src.rpm The issue is because the %install script uses $KBUILD_IMAGE and it hasn't been set since it is only available in the kbuild system and not in the %install script. This patch adds a Makefile target to emit the image_name that can be used and modifies the mkspec to use the dynamic name in %install. Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r--Makefile6
-rwxr-xr-xscripts/package/mkspec1
2 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index cd11e8857604..6280aa192c36 100644
--- a/Makefile
+++ b/Makefile
@@ -1116,6 +1116,7 @@ help:
1116 @echo ' gtags - Generate GNU GLOBAL index' 1116 @echo ' gtags - Generate GNU GLOBAL index'
1117 @echo ' kernelrelease - Output the release version string' 1117 @echo ' kernelrelease - Output the release version string'
1118 @echo ' kernelversion - Output the version stored in Makefile' 1118 @echo ' kernelversion - Output the version stored in Makefile'
1119 @echo ' image_name - Output the image name'
1119 @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ 1120 @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
1120 echo ' (default: $(INSTALL_HDR_PATH))'; \ 1121 echo ' (default: $(INSTALL_HDR_PATH))'; \
1121 echo '' 1122 echo ''
@@ -1310,7 +1311,7 @@ export_report:
1310endif #ifeq ($(config-targets),1) 1311endif #ifeq ($(config-targets),1)
1311endif #ifeq ($(mixed-targets),1) 1312endif #ifeq ($(mixed-targets),1)
1312 1313
1313PHONY += checkstack kernelrelease kernelversion 1314PHONY += checkstack kernelrelease kernelversion image_name
1314 1315
1315# UML needs a little special treatment here. It wants to use the host 1316# UML needs a little special treatment here. It wants to use the host
1316# toolchain, so needs $(SUBARCH) passed to checkstack.pl. Everyone 1317# toolchain, so needs $(SUBARCH) passed to checkstack.pl. Everyone
@@ -1331,6 +1332,9 @@ kernelrelease:
1331kernelversion: 1332kernelversion:
1332 @echo $(KERNELVERSION) 1333 @echo $(KERNELVERSION)
1333 1334
1335image_name:
1336 @echo $(KBUILD_IMAGE)
1337
1334# Clear a bunch of variables before executing the submake 1338# Clear a bunch of variables before executing the submake
1335tools/: FORCE 1339tools/: FORCE
1336 $(Q)mkdir -p $(objtree)/tools 1340 $(Q)mkdir -p $(objtree)/tools
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fbbfd08853d3..fdd3fbf4d4a4 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -74,6 +74,7 @@ echo ""
74fi 74fi
75 75
76echo "%install" 76echo "%install"
77echo 'KBUILD_IMAGE=$(make image_name)'
77echo "%ifarch ia64" 78echo "%ifarch ia64"
78echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' 79echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules'
79echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' 80echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'