build: centralize fakeroot code
[openwrt/staging/wigyori.git] / include / image-commands.mk
index 7d124ece19baa2a4f47ac7b650e9b975ce806363..49e438954a804f487652603d7e6682716b533c2b 100644 (file)
@@ -62,6 +62,18 @@ define Build/netgear-dni
        mv $@.new $@
 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) \
@@ -143,10 +155,6 @@ define Build/append-rootfs
        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) \