-# build a ubi for a specific flash geometry/layout which can contain
-# volumes with the following data from ubinize-$(DEVICE_NAME).cfg:
-# - 'boot.ubifs' volume: kernel+dtbs+bootscript
-# - 'root.squashfs' volume: rootfs
-# $(1): name (used for suffix)
-# $(2): PAGESIZE (-m param to mkfs.ubifs/ubinize)
-# $(3): ERASESIZE (logical eraseblock size: -e param to mkfs.ubifs)
-# $(4): BLOCKSIZE (-p param to ubinize)
-# $(5): MAXSIZE (maximum file-system size in LEB's -c param to mkfs.ubifs)
-#
-define Build/ubi-boot-overlay
- # ubi-boot-overlay $(DEVICE_NAME) $(word 1, $(1))
-
- # boot filesystem
- rm -rf $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))
- mkdir -p $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))
- $(CP) $< $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/$(IMG_PREFIX)-uImage
- ln -sf $(IMG_PREFIX)-uImage \
- $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/uImage
- $(foreach dts,$(shell echo $(DEVICE_DTS)), \
- $(CP) $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
- $(BIN_DIR)/$(IMG_PREFIX)-$(dts).dtb; \
- $(CP) $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
- $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/$(IMG_PREFIX)-$(dts).dtb; \
- ln -sf $(IMG_PREFIX)-$(dts).dtb \
- $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/$(dts).dtb; \
+DEVICE_VARS += MKUBIFS_OPTS
+
+define Build/boot-overlay
+ rm -rf $@.boot
+ mkdir -p $@.boot
+
+ $(CP) $@ $@.boot/$(IMG_PREFIX)-uImage
+ ln -sf $(IMG_PREFIX)-uImage $@.boot/uImage
+
+ $(foreach dts,$(DEVICE_DTS), \
+ $(CP) \
+ $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
+ $@.boot/$(IMG_PREFIX)-$(dts).dtb; \
+ ln -sf \
+ $(IMG_PREFIX)-$(dts).dtb \
+ $@.boot/$(dts).dtb; \