summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/images/ubi.config18
-rw-r--r--platforms/image-root-ubi.in14
-rw-r--r--rules/image-root-ubi.make42
3 files changed, 74 insertions, 0 deletions
diff --git a/config/images/ubi.config b/config/images/ubi.config
new file mode 100644
index 000000000..793117108
--- /dev/null
+++ b/config/images/ubi.config
@@ -0,0 +1,18 @@
+flash flash {
+ pebsize = @PEB_SIZE@
+ minimum-io-unit-size = @MINIMUM_IO_UNIT_SIZE@
+ sub-page-size = @SUB_PAGE_SIZE@
+ vid-header-offset = @VID_HEADER_OFFSET@
+ lebsize = @LEB_SIZE@
+}
+
+image @IMAGE@ {
+ ubi {
+ extraargs = "-v"
+ }
+ flashtype = "flash"
+ partition root {
+ image = "root.ubifs"
+ autoresize = true
+ }
+}
diff --git a/platforms/image-root-ubi.in b/platforms/image-root-ubi.in
new file mode 100644
index 000000000..46a6cd2c2
--- /dev/null
+++ b/platforms/image-root-ubi.in
@@ -0,0 +1,14 @@
+## SECTION=image2
+
+config IMAGE_ROOT_UBI
+ tristate
+ select HOST_GENIMAGE
+ select HOST_MTD_UTILS
+ select IMAGE_ROOT_UBIFS
+ prompt "Generate images/root.ubi"
+ help
+ Build ubi formated image(s) for the root file system and an
+ optional data partition. UBI is faster and robuster than JFFS2,
+ we recommend strongly the usage of UBI if you want a file
+ system for raw flash devices. The image(s) can be directly
+ written to e.g. an mtd partition on a raw flash devices.
diff --git a/rules/image-root-ubi.make b/rules/image-root-ubi.make
new file mode 100644
index 000000000..b9468da96
--- /dev/null
+++ b/rules/image-root-ubi.make
@@ -0,0 +1,42 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_ROOT_UBI) += image-root-ubi
+
+#
+# Paths and names
+#
+IMAGE_ROOT_UBI := image-root-ubi
+IMAGE_ROOT_UBI_DIR := $(BUILDDIR)/$(IMAGE_ROOT_UBI)
+IMAGE_ROOT_UBI_IMAGE := $(IMAGEDIR)/root.ubi
+IMAGE_ROOT_UBI_CONFIG := ubi.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_IMAGE_ROOT_UBI
+IMAGE_ROOT_UBI_ENV := \
+ PEB_SIZE=$(PTXCONF_IMAGE_ROOT_UBIFS_PEB_SIZE) \
+ MINIMUM_IO_UNIT_SIZE=$(PTXCONF_IMAGE_ROOT_UBIFS_MINIMUM_IO_UNIT_SIZE) \
+ SUB_PAGE_SIZE=$(PTXCONF_IMAGE_ROOT_UBIFS_SUB_PAGE_SIZE) \
+ VID_HEADER_OFFSET=$(PTXCONF_IMAGE_ROOT_UBIFS_VID_HEADER_OFFSET) \
+ LEB_SIZE=$(PTXCONF_IMAGE_ROOT_UBIFS_LEB_SIZE)
+
+$(IMAGE_ROOT_UBI_IMAGE):
+ @$(call targetinfo)
+ @$(call image/genimage, IMAGE_ROOT_UBI)
+ @$(call finish)
+endif
+
+# vim: syntax=make