Currently, the device-tree partition is marked as read-only.
Hence, userspace tools like mtd can't write into the partition.
This however will be necessary in case the DTB needs to be
updated.
This patch also adds the kernel.dtb image, so the compiled
DTB is exported as a file and available in the binary
directory along the firmware images.
Note: the u-boot does expects the dtb to be a uimage.
To update the dtb manually:
1. copy the generated dtb to the router.
2. mtd erase /dev/mtd2
3. mtd write wndr4700.dtb /dev/mtd2
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
partition0,2@0x00180000 {
label = "device-tree";
reg = <0x00180000 0x00020000>;
partition0,2@0x00180000 {
label = "device-tree";
reg = <0x00180000 0x00020000>;
};
partition0,3@0x001a0000 {
};
partition0,3@0x001a0000 {
$(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE))
endef
$(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE))
endef
+define Build/export-dtb
+ cp $(IMAGE_KERNEL).dtb $@
+endef
+
ifeq ($(SUBTARGET),nand)
define Image/cpiogz
ifeq ($(SUBTARGET),nand)
define Image/cpiogz
BLOCKSIZE := 128k
DTB_SIZE := 131008
IMAGE_SIZE := 24960k
BLOCKSIZE := 128k
DTB_SIZE := 131008
IMAGE_SIZE := 24960k
- IMAGES := factory.img sysupgrade.tar
+ IMAGES := factory.img sysupgrade.tar kernel.dtb
KERNEL_SIZE := 1920k
KERNEL := dtb | kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | append-fakerootfs
KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip
IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \
netgear-dni | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.tar := sysupgrade-tar
KERNEL_SIZE := 1920k
KERNEL := dtb | kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | append-fakerootfs
KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip
IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \
netgear-dni | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.tar := sysupgrade-tar
+ IMAGE/kernel.dtb := export-dtb | uImage none
NETGEAR_BOARD_ID := WNDR4700
NETGEAR_HW_ID := 29763875+128+256
UBINIZE_OPTS := -E 5
NETGEAR_BOARD_ID := WNDR4700
NETGEAR_HW_ID := 29763875+128+256
UBINIZE_OPTS := -E 5
$(if $(CONFIG_TARGET_IMAGES_GZIP),gzip -9n -c $@ > $(BIN_DIR)/$(notdir $@).gz)
endef
$(if $(CONFIG_TARGET_IMAGES_GZIP),gzip -9n -c $@ > $(BIN_DIR)/$(notdir $@).gz)
endef
-define Build/export-dtb
- cp $(IMAGE_KERNEL).dtb $@
-endef
-
define Device/MyBookLiveDefault
IMAGE_SIZE := 48m
BLOCKSIZE := 1k
define Device/MyBookLiveDefault
IMAGE_SIZE := 48m
BLOCKSIZE := 1k