include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
-DEVICE_VARS += DTB_SIZE
-
define Build/boot-img
$(RM) -rf $@.bootdir
mkdir -p $@.bootdir/boot
$(CP) $@.scr $@.bootdir/boot/boot.scr
- $(CP) $(IMAGE_KERNEL).dtb $@.bootdir/boot/$(DEVICE_DTB)
+ $(CP) $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@.bootdir/boot/$(DEVICE_DTB)
$(CP) $(IMAGE_KERNEL) $@.bootdir/boot/uImage
genext2fs --block-size $(BLOCKSIZE:%k=%Ki) \
$@.scr
endef
-define Build/dtb
- $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE))
-endef
-
define Build/export-dtb
- cp $(IMAGE_KERNEL).dtb $@
+ cp $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@
endef
define Build/MuImage-initramfs
# part of the legacy multi image. Since we need to put the
# device tree stuff into part 3.
- -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \
- -C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \
- -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new
+ -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi -C $(1) \
+ -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) -n '$(BOARD_NAME) initramfs' \
+ -d $@:$@.fakerd:$(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@.new
mv $@.new $@
rm -rf $@.fakerd
endef
define Build/prepend-dtb
- cat "$@.dtb.uimage" "$@" > "$@.new"
+ cat "$(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb" "$@" > "$@.new"
mv "$@.new" "$@"
endef
-d "$@.dtb" "$@.dtb.uimage"
endef
-define Build/MerakiAdd-dtb
- $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
- ( \
- dd if=$@.dtb bs=$(DTB_SIZE) conv=sync; \
- cat $@ ; \
- ) > $@.new
- @mv $@.new $@
-endef
-
define Build/meraki-header
-$(STAGING_DIR_HOST)/bin/mkmerakifw \
-B $(BOARD_NAME) -s \
DEVICE_PACKAGES := kmod-spi-gpio -swconfig
BOARD_NAME := mr24
IMAGES := sysupgrade.bin
- DTB_SIZE := 64512
+ DEVICE_DTC_FLAGS := --space 64512
IMAGE_SIZE := 8191k
- KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | meraki-header
- KERNEL_INITRAMFS := kernel-bin | lzma | dtb | MuImage-initramfs lzma
+ KERNEL := kernel-bin | lzma | uImage lzma | prepend-dtb | meraki-header
+ KERNEL_INITRAMFS := kernel-bin | lzma | MuImage-initramfs lzma
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
UBINIZE_OPTS := -E 5
SUPPORTED_DEVICES += mr24
kmod-usb-storage block-mount
BLOCKSIZE := 128k
IMAGES := sysupgrade.bin
- DTB_SIZE := 20480
+ DEVICE_DTC_FLAGS := --space 20480
IMAGE_SIZE := 1021m
- KERNEL := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip
+ KERNEL := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
UBINIZE_OPTS := -E 5
DEVICE_COMPAT_VERSION := 2.0
SUBPAGESIZE := 256
PAGESIZE := 512
BLOCKSIZE := 16k
- DTB_SIZE := 32768
+ DEVICE_DTC_FLAGS := --space 32768
IMAGE_SIZE := 27392k
IMAGES := sysupgrade.bin factory.img
KERNEL_SIZE := 6080k
- KERNEL := dtb | kernel-bin | libdeflate-gzip | MuImage-initramfs gzip
+ KERNEL := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
UBINIZE_OPTS := -E 5
PAGESIZE := 2048
SUBPAGESIZE := 512
BLOCKSIZE := 128k
- DTB_SIZE := 131008
+ DEVICE_DTC_FLAGS := --space 131008
IMAGE_SIZE := 24960k
IMAGES := factory.img sysupgrade.bin
ARTIFACTS := device-tree.dtb
# append a fake/empty rootfs to fool netgear's uboot
# CHECK_DNI_FIRMWARE_ROOTFS_INTEGRITY in do_chk_dniimg()
KERNEL := kernel-bin | lzma -d16 | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \
- append-uImage-fakehdr filesystem | dtb | create-uImage-dtb | prepend-dtb
- KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip
+ append-uImage-fakehdr filesystem | create-uImage-dtb | prepend-dtb
+ KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
netgear-dni | check-size
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
kmod-usb-storage kmod-fs-vfat wpad-basic-mbedtls
SUPPORTED_DEVICES += mbl wd,mybooklive-duo
BLOCKSIZE := 1k
- DTB_SIZE := 16384
- KERNEL := kernel-bin | dtb | libdeflate-gzip | uImage gzip
- KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip
+ DEVICE_DTC_FLAGS := --pad 4096
+ KERNEL := kernel-bin | libdeflate-gzip | uImage gzip
+ KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip
IMAGES := factory.img.gz sysupgrade.img.gz
ARTIFACTS := apollo3g.dtb
DEVICE_DTB := apollo3g.dtb