diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2013-06-24 08:48:37 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2013-06-24 09:26:14 -0400 |
commit | c398ff00f55d56bec8eb116e9ad3d226998230fa (patch) | |
tree | 73752c6ec9b6eaee37f9b61eb0c90744504e26c8 /Makefile | |
parent | cdf2bc632ebc9ef512345fe8e6015edfd367e256 (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>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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: | |||
1310 | endif #ifeq ($(config-targets),1) | 1311 | endif #ifeq ($(config-targets),1) |
1311 | endif #ifeq ($(mixed-targets),1) | 1312 | endif #ifeq ($(mixed-targets),1) |
1312 | 1313 | ||
1313 | PHONY += checkstack kernelrelease kernelversion | 1314 | PHONY += 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: | |||
1331 | kernelversion: | 1332 | kernelversion: |
1332 | @echo $(KERNELVERSION) | 1333 | @echo $(KERNELVERSION) |
1333 | 1334 | ||
1335 | image_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 |
1335 | tools/: FORCE | 1339 | tools/: FORCE |
1336 | $(Q)mkdir -p $(objtree)/tools | 1340 | $(Q)mkdir -p $(objtree)/tools |