mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] Makefile: Add missing force for barebox-flash-image
@ 2012-10-12 16:40 Sascha Hauer
  2012-10-12 16:40 ` [PATCH 2/2] defaultenv: dependencies fixes Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2012-10-12 16:40 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3e2b81f..881680d 100644
--- a/Makefile
+++ b/Makefile
@@ -475,7 +475,7 @@ export KBUILD_BINARY ?= barebox.bin
 # Also any assignments in arch/$(ARCH)/Makefile take precedence over
 # the default value.
 
-barebox-flash-image: $(KBUILD_IMAGE)
+barebox-flash-image: $(KBUILD_IMAGE) FORCE
 	$(call if_changed,ln)
 
 all: barebox-flash-image
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/2] defaultenv: dependencies fixes
  2012-10-12 16:40 [PATCH 1/2] Makefile: Add missing force for barebox-flash-image Sascha Hauer
@ 2012-10-12 16:40 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-10-12 16:40 UTC (permalink / raw)
  To: barebox

When a build with a compressed default environment is done and then
environment compression is disabled, barebox_default_env.h is not
regenerated because its dependency (now barebox_default_env) is still
up to date. This results in a corrupt default environment.

This patch fixes this by adding a cmd_env_h and changing barebox_default_env.h
to FORCE. As a side effect barebox_default_env.h is no longer generated in
include/generated/ but in common/ as we have to add barebox_default_env.h to
$(targets) (extra-y).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/Makefile  |   21 ++++++++++++---------
 common/startup.c |    2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index b74c76b..132bd06 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -39,11 +39,11 @@ obj-$(CONFIG_PASSWORD) += password.o
 obj-$(CONFIG_MODULES) += module.o
 obj-$(CONFIG_FLEXIBLE_BOOTARGS) += bootargs.o
 extra-$(CONFIG_MODULES) += module.lds
-extra-y += barebox_default_env
+extra-y += barebox_default_env barebox_default_env.h
 
 ifdef CONFIG_DEFAULT_ENVIRONMENT
-$(obj)/startup.o: include/generated/barebox_default_env.h
-$(obj)/env.o: include/generated/barebox_default_env.h
+$(obj)/startup.o: $(obj)/barebox_default_env.h
+$(obj)/env.o: $(obj)/barebox_default_env.h
 
 ifeq ($(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW),y)
 DEFAULT_ENVIRONMENT_PATH = "defaultenv-2/base"
@@ -89,18 +89,21 @@ ifeq ($(CONFIG_DEFAULT_ENVIRONMENT_COMPRESSED_LZO),y)
 barebox_default_env_comp = .lzo
 endif
 
-$(obj)/barebox_default_env.gz: $(obj)/barebox_default_env
+$(obj)/barebox_default_env.gz: $(obj)/barebox_default_env FORCE
 	$(call if_changed,gzip)
 
-$(obj)/barebox_default_env.bz2: $(obj)/barebox_default_env
+$(obj)/barebox_default_env.bz2: $(obj)/barebox_default_env FORCE
 	$(call if_changed,bzip2)
 
-$(obj)/barebox_default_env.lzo: $(obj)/barebox_default_env
+$(obj)/barebox_default_env.lzo: $(obj)/barebox_default_env FORCE
 	$(call if_changed,lzo)
 
-include/generated/barebox_default_env.h: $(obj)/barebox_default_env$(barebox_default_env_comp)
-	$(Q)cat $< | (cd $(obj) && $(objtree)/scripts/bin2c default_environment) > $@
-	$(Q)echo "const int default_environment_uncompress_size=`stat -c%s $(obj)/barebox_default_env`;" >> $@
+quiet_cmd_env_h = ENVH    $@
+cmd_env_h = cat $< | (cd $(obj) && $(objtree)/scripts/bin2c default_environment) > $@; \
+	echo "const int default_environment_uncompress_size=`stat -c%s $(obj)/barebox_default_env`;" >> $@
+
+$(obj)/barebox_default_env.h: $(obj)/barebox_default_env$(barebox_default_env_comp) FORCE
+	$(call if_changed,env_h)
 
 # dependencies on generated files need to be listed explicitly
 $(obj)/version.o: include/generated/compile.h
diff --git a/common/startup.c b/common/startup.c
index b53bbef..78926c9 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -39,7 +39,7 @@ extern initcall_t __barebox_initcalls_start[], __barebox_early_initcalls_end[],
 		  __barebox_initcalls_end[];
 
 #ifdef CONFIG_DEFAULT_ENVIRONMENT
-#include <generated/barebox_default_env.h>
+#include "barebox_default_env.h"
 
 #ifdef CONFIG_DEFAULT_ENVIRONMENT_COMPRESSED
 #include <uncompress.h>
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-10-12 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-12 16:40 [PATCH 1/2] Makefile: Add missing force for barebox-flash-image Sascha Hauer
2012-10-12 16:40 ` [PATCH 2/2] defaultenv: dependencies fixes Sascha Hauer

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