imx6: use ubinize-image.sh to fix build with per-device rootfs
[openwrt/openwrt.git] / target / linux / imx6 / image / Makefile
index 236cf7f3680e9291883b0aad8cc23d49e1300ef5..a7d68fbe977e3e3ab94f2786ccf163b6579ed7a0 100644 (file)
@@ -51,20 +51,10 @@ define Build/ubi-boot-overlay
                $(BIN_DIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-bootfs_$(word 1, $(1)).ubifs
 
        # ubi
-       rm -rf p $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))
-       mkdir -p $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))
-       $(CP) $(word 2, $^) \
-               $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))/
-       $(CP) $(KDIR)/boot-$(DEVICE_NAME)-bootfs_$(word 1, $(1)).ubifs \
-               $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))/boot.ubifs
-       $(CP) ./ubinize-$(DEVICE_NAME).cfg \
-               $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))/ubinize.cfg
-       ( cd $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1)); \
-               $(STAGING_DIR_HOST)/bin/ubinize \
-               -m $(word 2, $(1)) -p $(word 4, $(1)) -s $(word 2, $(1)) \
-               -o $@ \
-               ubinize.cfg \
-       )
+       sh $(TOPDIR)/scripts/ubinize-image.sh \
+               --part boot=$(KDIR)/boot-$(DEVICE_NAME)-bootfs_$(word 1, $(1)).ubifs=15 \
+               $(IMAGE_ROOTFS) $@ \
+               -m $(word 2, $(1)) -p $(word 4, $(1)) -s $(word 2, $(1))
 endef
 
 define Build/bootfs.tar.gz
@@ -102,7 +92,7 @@ endef
 KERNEL_LOADADDR=0x10008000
 
 define Device/Default
-  DEVICE_DTS :=
+  PROFILES := Generic
   FILESYSTEMS := squashfs ext4
   KERNEL_INSTALL := 1
   KERNEL_SUFFIX := -uImage
@@ -113,10 +103,7 @@ define Device/Default
   IMAGES :=
 endef
 
-DEVICE_VARS += DEVICE_DTS
-
 define Device/ventana
-  PROFILES := Generic VENTANA
   DEVICE_TITLE := Gateworks Ventana family
   DEVICE_DTS:= \
        imx6dl-gw51xx \
@@ -146,7 +133,6 @@ define Device/ventana
 endef
 
 define Device/wandboard
-  PROFILES := Generic IMX6DL_WANDBOARD
   DEVICE_TITLE := Wandboard Dual
   DEVICE_DTS := imx6dl-wandboard
   DEVICE_PACKAGES := kmod-thermal-imx kmod-usb-chipidea-imx kmod-usb-mxs-phy