cat $@.fakesquashfs >> $@
endef
-# append a fake/empty rootfs uImage header, to fool the bootloaders
-# rootfs integrity check
-define Build/append-uImage-fakeroot-hdr
- touch $@.fakeroot
+# append a fake/empty uImage header, to fool bootloaders rootfs integrity check
+# for example
+define Build/append-uImage-fakehdr
+ touch $@.fakehdr
$(STAGING_DIR_HOST)/bin/mkimage \
- -A $(LINUX_KARCH) -O linux -T filesystem -C none \
- -n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) fakeroot' \
- -d $@.fakeroot \
+ -A $(LINUX_KARCH) -O linux -T $(1) -C none \
+ -n '$(VERSION_DIST) fake $(1)' \
+ -d $@.fakehdr \
-s \
- $@.fakeroot
- cat $@.fakeroot >> $@
+ $@.fakehdr
+ cat $@.fakehdr >> $@
endef
define Build/tplink-safeloader
# append a fake/empty rootfs to fool netgear's uboot
# CHECK_DNI_FIRMWARE_ROOTFS_INTEGRITY in do_chk_dniimg()
KERNEL := kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \
- append-uImage-fakeroot-hdr | dtb | create-uImage-dtb | prepend-dtb
+ append-uImage-fakehdr filesystem | dtb | create-uImage-dtb | prepend-dtb
KERNEL_INITRAMFS := kernel-bin | gzip | dtb | MuImage-initramfs gzip
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
netgear-dni | check-size $$$$(IMAGE_SIZE)
NETGEAR_BOARD_ID :=
NETGEAR_HW_ID :=
IMAGES := factory.img sysupgrade.bin
- IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakeroot-hdr | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | netgear-dni
- IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakeroot-hdr | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
+ IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | netgear-dni
+ IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
endef
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
NETGEAR_HW_ID :=
UBINIZE_OPTS := -E 5
IMAGES := factory.img sysupgrade.bin
- IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakeroot-hdr | pad-to $$$$(KERNEL_SIZE) | append-ubi | netgear-dni
- IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakeroot-hdr | sysupgrade-tar kernel=$$$$@ | append-metadata
+ IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | netgear-dni
+ IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | sysupgrade-tar kernel=$$$$@ | append-metadata
endef
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
PAGESIZE := 2048
BLOCKSIZE := 128k
KERNEL_SIZE := 3072k
- KERNEL = kernel-bin | append-dtb | uImage none | append-uImage-fakeroot-hdr
+ KERNEL = kernel-bin | append-dtb | uImage none | append-uImage-fakehdr filesystem
BOARD_NAME := ea8500
SUPPORTED_DEVICES += ea8500
UBINIZE_OPTS := -E 5
DEVICE_DTS := DM200
IMAGES := sysupgrade.bin factory.img
IMAGE/sysupgrade.bin := append-kernel | \
- pad-offset 64k 64 | append-uImage-fakeroot-hdr | \
- pad-offset 64k 64 | append-uImage-fakeroot-hdr | \
+ pad-offset 64k 64 | append-uImage-fakehdr filesystem | \
+ pad-offset 64k 64 | append-uImage-fakehdr filesystem | \
append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
IMAGE/factory.img := $$(IMAGE/sysupgrade.bin) | netgear-dni
IMAGE_SIZE := 7872k
KERNEL := kernel-bin
endef
-define Build/append-uImage-fakeramdisk-hdr
- rm -f $@.fakeramdisk
- $(STAGING_DIR_HOST)/bin/mkimage \
- -A $(LINUX_KARCH) -O linux -T ramdisk -C none \
- -n 'fakeramdisk' \
- -s \
- $@.fakeramdisk
- cat $@.fakeramdisk >> $@
-endef
-
define Build/tplink-v1-image
$(STAGING_DIR_HOST)/bin/mktplinkfw \
-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) \
IMAGES := fdt.bin sysupgrade.bin
IMAGE/fdt.bin := append-dtb
IMAGE/sysupgrade.bin := append-dtb | pad-to 256k | check-size 256k | \
- append-uImage-fakeramdisk-hdr | pad-to 256k | check-size 512k | \
+ append-uImage-fakehdr ramdisk | pad-to 256k | check-size 512k | \
append-rootfs | pad-rootfs $$(BLOCKSIZE) | pad-to 41216k | check-size 41216k | \
append-kernel | append-metadata
endef
BLOCKSIZE := 4k
IMAGE_SIZE := $(ralink_default_fw_size_4M)
IMAGES += factory.bin
- KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakeroot-hdr
+ KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakehdr filesystem
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
netgear-dni
DEVICE_PACKAGES := -kmod-mt76
DTS := WN3000RPV3
BLOCKSIZE := 4k
IMAGES += factory.bin
- KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakeroot-hdr
+ KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakehdr filesystem
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
netgear-dni
DEVICE_TITLE := Netgear WN3000RPv3