public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6] kbuild: fix error when building from src rpm
@ 2013-06-07 16:25 Mike Marciniszyn
  2013-06-07 16:27 ` Marciniszyn, Mike
  2013-06-23 20:29 ` Michal Marek
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Marciniszyn @ 2013-06-07 16:25 UTC (permalink / raw)
  To: mmarek; +Cc: linux-kbuild, mmarcini

The following issue can be reproduced with Linus' tree on
and 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>
---
 Makefile               |    6 ++++++
 scripts/package/mkspec |    1 +
 2 files changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index cd11e88..5b2217c 100644
--- a/Makefile
+++ b/Makefile
@@ -1275,6 +1275,12 @@ clean: $(clean-dirs)
 		-o -name modules.builtin -o -name '.tmp_*.o.*' \
 		-o -name '*.gcno' \) -type f -print | xargs rm -f
 
+# For probing for image name
+# ---------------------------------------------------------------------------
+.PHONY += image_name
+image_name: FORCE
+	@echo $(KBUILD_IMAGE)
+
 # Generate tags for editors
 # ---------------------------------------------------------------------------
 quiet_cmd_tags = GEN     $@
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fbbfd08..fdd3fbf 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -74,6 +74,7 @@ echo ""
 fi
 
 echo "%install"
+echo 'KBUILD_IMAGE=$(make image_name)'
 echo "%ifarch ia64"
 echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules'
 echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH v6] kbuild: fix error when building from src rpm
  2013-06-07 16:25 [PATCH v6] kbuild: fix error when building from src rpm Mike Marciniszyn
@ 2013-06-07 16:27 ` Marciniszyn, Mike
  2013-06-23 20:29 ` Michal Marek
  1 sibling, 0 replies; 4+ messages in thread
From: Marciniszyn, Mike @ 2013-06-07 16:27 UTC (permalink / raw)
  To: Marciniszyn, Mike, mmarek@suse.cz
  Cc: linux-kbuild@vger.kernel.org, mmarcini@yahoo.com

> Subject: [PATCH v6] kbuild: fix error when building from src rpm
> 
This version fixes a spelling error in the Makefile patch.

Mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v6] kbuild: fix error when building from src rpm
  2013-06-07 16:25 [PATCH v6] kbuild: fix error when building from src rpm Mike Marciniszyn
  2013-06-07 16:27 ` Marciniszyn, Mike
@ 2013-06-23 20:29 ` Michal Marek
  2013-06-24 12:54   ` Marciniszyn, Mike
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Marek @ 2013-06-23 20:29 UTC (permalink / raw)
  To: Mike Marciniszyn; +Cc: linux-kbuild, mmarcini

Hi Mike, sorry for the late feedback.

Dne 7.6.2013 18:25, Mike Marciniszyn napsal(a):
> The following issue can be reproduced with Linus' tree on
> and 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>
> ---
>  Makefile               |    6 ++++++
>  scripts/package/mkspec |    1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index cd11e88..5b2217c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1275,6 +1275,12 @@ clean: $(clean-dirs)
>  		-o -name modules.builtin -o -name '.tmp_*.o.*' \
>  		-o -name '*.gcno' \) -type f -print | xargs rm -f
>  
> +# For probing for image name
> +# ---------------------------------------------------------------------------
> +.PHONY += image_name

The variable name is without the leading dot.


> +image_name: FORCE
> +	@echo $(KBUILD_IMAGE)

There is no need for FORCE, after you properly mark the target as phony.
Also, please move it next to the similar 'kernelrelease' and
'kernelversion' targets.

Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v6] kbuild: fix error when building from src rpm
  2013-06-23 20:29 ` Michal Marek
@ 2013-06-24 12:54   ` Marciniszyn, Mike
  0 siblings, 0 replies; 4+ messages in thread
From: Marciniszyn, Mike @ 2013-06-24 12:54 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild@vger.kernel.org, mmarcini@yahoo.com

> There is no need for FORCE, after you properly mark the target as phony.
> Also, please move it next to the similar 'kernelrelease' and 'kernelversion'
> targets.
> 
> Michal There is a v7 patch that I think addresses all the issues:

http://marc.info/?l=linux-kbuild&m=137207812307394&w=2

Mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-24 12:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-07 16:25 [PATCH v6] kbuild: fix error when building from src rpm Mike Marciniszyn
2013-06-07 16:27 ` Marciniszyn, Mike
2013-06-23 20:29 ` Michal Marek
2013-06-24 12:54   ` Marciniszyn, Mike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox