Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC/PATCH] linux: remove the zImage before rebuild
@ 2014-09-26 23:22 Guido Martínez
  2014-10-22 14:40 ` Guido Martínez
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Guido Martínez @ 2014-09-26 23:22 UTC (permalink / raw)
  To: buildroot

Currently, if we run "make linux-rebuild", the device tree blob gets
appended twice to the kernel image, rendering the latter append useless.

Fix this by removing the zImage before building, so the DTB append runs
on a fresh kernel image. This is not optimal as the final Linux linking
step is run again, but at least we get sensible results.

Signed-off-by: Guido Mart?nez <guido@vanguardiasur.com.ar>
---
Hi guys,

Has anyone ran into the above problem? It was a small headache for me,
so I wrote this small patch.

It's not great, the right thing to do would be copying the zImage out
of the kernel tree and appending the DTB there, but my attempt at doing
that broke some other builds. This should work every time.


 linux/linux.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index 2fb7437..14c2b8e 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -263,6 +263,10 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
+	# Remove the previous image, if it exists, to prevent appending
+	# multiple DTBs
+	rm -f $(KERNEL_ARCH_PATH)/boot/zImage
+
 	$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
 		cp $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
 	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
-- 
2.1.0

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

end of thread, other threads:[~2015-07-17 21:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-26 23:22 [Buildroot] [RFC/PATCH] linux: remove the zImage before rebuild Guido Martínez
2014-10-22 14:40 ` Guido Martínez
2015-03-08 17:47 ` Thomas Petazzoni
2015-03-08 18:53   ` Guido Martínez
2015-07-17 16:01 ` Hollis Blanchard
2015-07-17 16:34   ` Guido Martínez
2015-07-17 17:41     ` Thomas Petazzoni
2015-07-17 18:49       ` Hollis Blanchard
2015-07-17 21:16         ` Thomas Petazzoni
2015-07-17 21:24           ` Hollis Blanchard

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