-O linux -T kernel \
-C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION))' -d $@ $@.new
- @mv $@.new $@
+ mv $@.new $@
endef
define Build/buffalo-enc
mv $@.new $@
endef
+define Build/eva-image
+ $(STAGING_DIR_HOST)/bin/lzma2eva $(KERNEL_LOADADDR) $(KERNEL_LOADADDR) $@ $@.new
+ mv $@.new $@
+endef
+
define Build/netgear-chk
$(STAGING_DIR_HOST)/bin/mkchkimg \
-o $@.new \
-k $@ \
-b $(NETGEAR_BOARD_ID) \
- -r $(NETGEAR_REGION)
+ $(if $(NETGEAR_REGION),-r $(NETGEAR_REGION),)
mv $@.new $@
endef
mv $@.new $@
endef
+define Build/append-squashfs-fakeroot-be
+ rm -rf $@.fakefs $@.fakesquashfs
+ mkdir $@.fakefs
+ $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
+ $@.fakefs $@.fakesquashfs \
+ -noappend -root-owned -be -nopad -b 65536 \
+ $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
+ cat $@.fakesquashfs >> $@
+endef
+
+# append a fake/empty rootfs uImage header, to fool the bootloaders
+# rootfs integrity check
+define Build/append-uImage-fakeroot-hdr
+ rm -f $@.fakeroot
+ $(STAGING_DIR_HOST)/bin/mkimage \
+ -A $(LINUX_KARCH) -O linux -T filesystem -C none \
+ -n '$(call toupper,$(LINUX_KARCH)) LEDE fakeroot' \
+ -s \
+ $@.fakeroot
+ cat $@.fakeroot >> $@
+endef
+
define Build/tplink-safeloader
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
- -B $(TPLINK_BOARD_NAME) \
+ -B $(TPLINK_BOARD_ID) \
-V $(REVISION) \
-k $(IMAGE_KERNEL) \
-r $@ \
)
endef
+define Build/install-zImage
+ $(CP) $(KDIR)/zImage \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage
+endef
+
define Build/fit
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
dd if=$(IMAGE_ROOTFS) >> $@
endef
-define Build/append-file
- cat "$(1)" >> "$@"
-endef
-
define Build/append-ubi
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
$@
endef
+define Build/tplink-v1-header
+ $(STAGING_DIR_HOST)/bin/mktplinkfw \
+ -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
+ -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
+ -m $(TPLINK_HEADER_VERSION) -N "$(VERSION_DIST)" -V $(REVISION) \
+ -k $@ -o $@.new $(1)
+ @mv $@.new $@
+endef
+
+define Build/tplink-v2-header
+ $(STAGING_DIR_HOST)/bin/mktplinkfw2 \
+ -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
+ -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
+ -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
+ -T $(TPLINK_HVERSION) -V "ver. 2.0" \
+ -k $@ -o $@.new $(1)
+ @mv $@.new $@
+endef
+
+define Build/tplink-v2-image
+ $(STAGING_DIR_HOST)/bin/mktplinkfw2 \
+ -H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
+ -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
+ -T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \
+ -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1)
+ cat $@.new >> $@
+ rm -rf $@.new
+endef
+
json_quote=$(subst ','\'',$(subst ",\",$(1)))
#")')
metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))"))))