diff options
author | Frans Pop <elendil@planet.nl> | 2009-08-25 16:15:39 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-10-11 17:21:24 -0400 |
commit | db9038c89d129383a9db2afcb72b504fe54f6edf (patch) | |
tree | 52717e88f15718bd30077e18a75ac38e87d908fa /scripts/package | |
parent | f144c78e525542c94e0dcb171b41cc5ef7b341b3 (diff) |
kbuild: fix the binrpm-pkg target to work with KBUILD_OUTPUT set
The binrpm-pkg target (binary RPM only) fails when called with
KBUILD_OUTPUT set. This patch makes it work.
For the rpm-pkg target (source + binary RPM), building with
KBUILD_OUTPUT set is not possible and also not needed as the
actual build is done in a temporary directory anyway, so check
that KBUILD_OUTPUT is not set in that case to avoid later errors.
Signed-off-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/package')
-rw-r--r-- | scripts/package/Makefile | 11 | ||||
-rwxr-xr-x | scripts/package/mkspec | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index fa4a0a17b7e0..f67cc885c807 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -18,6 +18,9 @@ | |||
18 | # e) generate the rpm files, based on kernel.spec | 18 | # e) generate the rpm files, based on kernel.spec |
19 | # - Use /. to avoid tar packing just the symlink | 19 | # - Use /. to avoid tar packing just the symlink |
20 | 20 | ||
21 | # Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT, | ||
22 | # but the binrpm-pkg target can; for some reason O= gets ignored. | ||
23 | |||
21 | # Do we have rpmbuild, otherwise fall back to the older rpm | 24 | # Do we have rpmbuild, otherwise fall back to the older rpm |
22 | RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ | 25 | RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ |
23 | else echo rpm; fi) | 26 | else echo rpm; fi) |
@@ -33,6 +36,12 @@ $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile | |||
33 | $(CONFIG_SHELL) $(MKSPEC) > $@ | 36 | $(CONFIG_SHELL) $(MKSPEC) > $@ |
34 | 37 | ||
35 | rpm-pkg rpm: $(objtree)/kernel.spec FORCE | 38 | rpm-pkg rpm: $(objtree)/kernel.spec FORCE |
39 | @if test -n "$(KBUILD_OUTPUT)"; then \ | ||
40 | echo "Building source + binary RPM is not possible outside the"; \ | ||
41 | echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ | ||
42 | echo "binrpm-pkg target instead."; \ | ||
43 | false; \ | ||
44 | fi | ||
36 | $(MAKE) clean | 45 | $(MAKE) clean |
37 | $(PREV) ln -sf $(srctree) $(KERNELPATH) | 46 | $(PREV) ln -sf $(srctree) $(KERNELPATH) |
38 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion | 47 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion |
@@ -61,7 +70,7 @@ binrpm-pkg: $(objtree)/binkernel.spec FORCE | |||
61 | set -e; \ | 70 | set -e; \ |
62 | mv -f $(objtree)/.tmp_version $(objtree)/.version | 71 | mv -f $(objtree)/.tmp_version $(objtree)/.version |
63 | 72 | ||
64 | $(RPM) $(RPMOPTS) --define "_builddir $(srctree)" --target \ | 73 | $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \ |
65 | $(UTS_MACHINE) -bb $< | 74 | $(UTS_MACHINE) -bb $< |
66 | 75 | ||
67 | clean-files += $(objtree)/binkernel.spec | 76 | clean-files += $(objtree)/binkernel.spec |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 3d93f8c81252..47bdd2f99b78 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -70,7 +70,7 @@ echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' | |||
70 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' | 70 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' |
71 | echo "%endif" | 71 | echo "%endif" |
72 | 72 | ||
73 | echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' | 73 | echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} KBUILD_SRC= modules_install' |
74 | echo "%ifarch ia64" | 74 | echo "%ifarch ia64" |
75 | echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE" | 75 | echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE" |
76 | echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/" | 76 | echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/" |