rm $@.salted
endef
+UBI_NAND_SIZE_LIMIT = $(IMAGE_SIZE) - ($(NAND_SIZE)*20/1024 + 4*$(BLOCKSIZE))
+
define Build/append-ubi
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
$(UBINIZE_OPTS)
cat $@.tmp >> $@
rm $@.tmp
+ $(if $(and $(IMAGE_SIZE),$(NAND_SIZE)),\
+ $(call Build/check-size,$(UBI_NAND_SIZE_LIMIT)))
endef
define Build/ubinize-kernel
define Build/check-size
@imagesize="$$(stat -c%s $@)"; \
- limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \
+ limitsize="$$(($(call exp_units,$(if $(1),$(1),$(IMAGE_SIZE)))))"; \
[ $$limitsize -ge $$imagesize ] || { \
$(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \
rm -f $@; \
cat "$(1)" > "$@"
endef
+define Build/dlink-sge-image
+ $(STAGING_DIR_HOST)/bin/dlink-sge-image $(1) $@ $@.enc
+ mv $@.enc $@
+endef
+
define Build/edimax-header
$(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new $(1)
@mv $@.new $@
endef
define Build/linksys-image
- $(TOPDIR)/scripts/linksys-image.sh \
+ let \
+ size="$$(stat -c%s $@)" \
+ pad="$(call exp_units,$(PAGESIZE))" \
+ offset="256" \
+ pad="(pad - ((size + offset) % pad)) % pad"; \
+ dd if=/dev/zero bs=$$pad count=1 | tr '\000' '\377' >> $@
+ printf ".LINKSYS.01000409%-15s%08X%-8s%-16s" \
"$(call param_get_default,type,$(1),$(DEVICE_NAME))" \
- $@ $@.new
- mv $@.new $@
+ "$$(cksum $@ | cut -d ' ' -f1)" \
+ "0" "K0000000F0246434" >> $@
+ dd if=/dev/zero bs=192 count=1 >> $@
endef
define Build/lzma
--output-file $@ \
--model $(NETGEAR_ENC_MODEL) \
--region $(NETGEAR_ENC_REGION) \
+ $(if $(NETGEAR_ENC_HW_ID_LIST),--hw-id-list "$(NETGEAR_ENC_HW_ID_LIST)") \
+ $(if $(NETGEAR_ENC_MODEL_LIST),--model-list "$(NETGEAR_ENC_MODEL_LIST)") \
--version V1.0.0.0.$(shell cat $(VERSION_DIST)| sed -e 's/[[:space:]]/-/g').$(firstword $(subst -, ,$(REVISION))) \
--encryption-block-size 0x20000 \
--openssl-bin "$(STAGING_DIR_HOST)/bin/openssl" \
define Build/pad-offset
let \
size="$$(stat -c%s $@)" \
- pad="$(subst k,* 1024,$(word 1, $(1)))" \
- offset="$(subst k,* 1024,$(word 2, $(1)))" \
+ pad="$(call exp_units,$(word 1, $(1)))" \
+ offset="$(call exp_units,$(word 2, $(1)))" \
pad="(pad - ((size + offset) % pad)) % pad" \
newsize='size + pad'; \
dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync
define Build/zyxel-ras-image
let \
- newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
+ newsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \
$(STAGING_DIR_HOST)/bin/mkrasimage \
-b $(RAS_BOARD) \
-v $(RAS_VERSION) \