summaryrefslogtreecommitdiffstats
path: root/include/image-commands.mk
diff options
context:
space:
mode:
Diffstat (limited to 'include/image-commands.mk')
-rw-r--r--include/image-commands.mk39
1 files changed, 33 insertions, 6 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 83ecf7c520..fed92a5793 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -231,6 +231,27 @@ define Build/buffalo-tag-dhp
mv $@.new $@
endef
+define Build/buffalo-trx
+ $(eval magic=$(word 1,$(1)))
+ $(eval kern_bin=$(if $(1),$(IMAGE_KERNEL),$@))
+ $(eval rtfs_bin=$(word 2,$(1)))
+ $(eval apnd_bin=$(word 3,$(1)))
+ $(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000))
+
+ $(if $(rtfs_bin),touch $(rtfs_bin))
+ $(STAGING_DIR_HOST)/bin/otrx create $@.new \
+ $(if $(magic),-M $(magic),) \
+ -f $(kern_bin) \
+ $(if $(rtfs_bin),\
+ -a 0x20000 \
+ -b $$(( $(call exp_units,$(kern_size)) )) \
+ -f $(rtfs_bin),) \
+ $(if $(apnd_bin),\
+ -A $(apnd_bin) \
+ -a 0x20000)
+ mv $@.new $@
+endef
+
define Build/check-size
@imagesize="$$(stat -c%s $@)"; \
limitsize="$$(($(call exp_units,$(if $(1),$(1),$(IMAGE_SIZE)))))"; \
@@ -430,12 +451,18 @@ define Build/jffs2
@mv $@.new $@
endef
-define Build/kernel2minor
- $(eval temp_file := $(shell mktemp))
- cp $@ $(temp_file)
- kernel2minor -k $(temp_file) -r $(temp_file).new $(1)
- mv $(temp_file).new $@
- rm -f $(temp_file)
+define Build/yaffs-filesystem
+ let \
+ kernel_size="$$(stat -c%s $@)" \
+ kernel_chunks="(kernel_size / 1024) + 1" \
+ filesystem_chunks="kernel_chunks + 3" \
+ filesystem_blocks="(filesystem_chunks / 63) + 1" \
+ filesystem_size="filesystem_blocks * 64 * 1024" \
+ filesystem_size_with_reserve="(filesystem_blocks + 2) * 64 * 1024"; \
+ head -c $$filesystem_size_with_reserve /dev/zero | tr "\000" "\377" > $@.img \
+ && yafut -d $@.img -w -i $@ -o kernel -C 1040 -B 64k -E -P -S $(1) \
+ && truncate -s $$filesystem_size $@.img \
+ && mv $@.img $@
endef
define Build/kernel-bin