brcm2708: add support for device tree overlays
[openwrt.git] / target / linux / brcm2708 / image / Makefile
index 7a68c50..3744cac 100644 (file)
@@ -21,6 +21,12 @@ else
   endef
 endif
 
   endef
 endif
 
+define Image/Prepare
+       rm -rf $(KDIR)/overlays
+       mkdir -p $(KDIR)/overlays
+       $(CP) $(DTS_DIR)/overlays/*.dtb $(KDIR)/overlays/
+endef
+
 ### Image scripts ###
 define Build/gen-cfg
        cat config.txt > $@.config
 ### Image scripts ###
 define Build/gen-cfg
        cat config.txt > $@.config
@@ -41,6 +47,7 @@ define Build/boot-img
        mcopy -i $@.boot $@.config ::config.txt
        mcopy -i $@.boot $(word 1,$^) ::kernel.img
        mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::$(DEVICE_DTS).dtb
        mcopy -i $@.boot $@.config ::config.txt
        mcopy -i $@.boot $(word 1,$^) ::kernel.img
        mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::$(DEVICE_DTS).dtb
+       mcopy -s -i $@.boot $(KDIR)/overlays ::
 endef
 
 define Build/sdcard-img
 endef
 
 define Build/sdcard-img