summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubi.mk
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/ubi.mk')
-rw-r--r--fs/ubifs/ubi.mk23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/ubifs/ubi.mk b/fs/ubifs/ubi.mk
new file mode 100644
index 000000000..c88e33639
--- /dev/null
+++ b/fs/ubifs/ubi.mk
@@ -0,0 +1,23 @@
+#############################################################
+#
+# Embed the ubifs image into an ubi one
+#
+#############################################################
+
+UBI_UBINIZE_OPTS := -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE)
+UBI_UBINIZE_OPTS += -p $(BR2_TARGET_ROOTFS_UBI_PEBSIZE)
+ifneq ($(BR2_TARGET_ROOTFS_UBI_SUBSIZE),0)
+UBI_UBINIZE_OPTS += -s $(BR2_TARGET_ROOTFS_UBI_SUBSIZE)
+endif
+
+ROOTFS_UBI_DEPENDENCIES = rootfs-ubifs
+
+define ROOTFS_UBI_CMD
+ cp fs/ubifs/ubinize.cfg . ;\
+ echo "image=$$@fs" \
+ >> ./ubinize.cfg ;\
+ $(HOST_DIR)/usr/sbin/ubinize -o $$@ $(UBI_UBINIZE_OPTS) ubinize.cfg ;\
+ rm ubinize.cfg
+endef
+
+$(eval $(call ROOTFS_TARGET,ubi))