aboutsummaryrefslogtreecommitdiffstats
path: root/include/image-commands.mk
diff options
context:
space:
mode:
Diffstat (limited to 'include/image-commands.mk')
-rw-r--r--include/image-commands.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 63539bad08..4e93115963 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -56,6 +56,18 @@ define Build/cameo-factory
mv $@.new $@
endef
+# blow up binary to given size and put a given string at its end:
+# cameo-factory <size[k]> <string>
+define Build/cameo-factory
+ factory_stamp=$(word 2,$(1)); \
+ ((reduced_size=$(subst k,*1024,$(word 1,$(1)))-$${#factory_stamp})); \
+ ( \
+ dd if=$@ bs=$$reduced_size conv=sync; \
+ echo -n $$factory_stamp; \
+ ) > $@.new && \
+ mv $@.new $@
+endef
+
define Build/eva-image
$(STAGING_DIR_HOST)/bin/lzma2eva $(KERNEL_LOADADDR) $(KERNEL_LOADADDR) $@ $@.new
mv $@.new $@