summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/images/ubifs.config16
-rw-r--r--platforms/image-root-ubifs.in64
-rw-r--r--rules/image-root-ubifs.make44
3 files changed, 124 insertions, 0 deletions
diff --git a/config/images/ubifs.config b/config/images/ubifs.config
new file mode 100644
index 000000000..730bc4254
--- /dev/null
+++ b/config/images/ubifs.config
@@ -0,0 +1,16 @@
+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@ {
+ ubifs {
+ extraargs = "-v"
+ max-size = @MAX_SIZE@
+ }
+ flashtype = "flash"
+ name = "root"
+}
diff --git a/platforms/image-root-ubifs.in b/platforms/image-root-ubifs.in
new file mode 100644
index 000000000..e5820e4b2
--- /dev/null
+++ b/platforms/image-root-ubifs.in
@@ -0,0 +1,64 @@
+## SECTION=image2
+
+menuconfig IMAGE_ROOT_UBIFS
+ tristate
+ select HOST_GENIMAGE
+ select HOST_MTD_UTILS
+ select IMAGE_ROOT_TGZ
+ prompt "Generate images/root.ubifs "
+ help
+ Build ubifs images of the root filesystem.
+
+if IMAGE_ROOT_UBIFS
+
+config IMAGE_ROOT_UBIFS_MAX_SIZE
+ string
+ default "20M"
+ prompt "maximum filesystem size"
+ help
+ The maximum filesystem size in bytes or with unit, e.g. 42M, 23G, etc.
+ The filesystem will never grow larger than this regardless of the
+ available space in the underlying UBI container.
+
+menu "Flash Properties "
+
+config IMAGE_ROOT_UBIFS_PEB_SIZE
+ string
+ prompt "Eraseblock size"
+ help
+ Size of the physical eraseblock of the flash this UBI image is
+ created for in bytes.
+ Gain the correct value from 'mtdinfo -u' on your target.
+
+config IMAGE_ROOT_UBIFS_MINIMUM_IO_UNIT_SIZE
+ string
+ prompt "Minimum input/output unit size"
+ help
+ Minimum input/output unit size of the flash in bytes.
+ Gain the correct value from 'mtdinfo -u' on your target.
+
+config IMAGE_ROOT_UBIFS_SUB_PAGE_SIZE
+ string
+ prompt "Sub-page size"
+ help
+ Minimum input/output unit used for UBI headers,
+ e.g. sub-page size in case of NAND flash.
+ Gain the correct value from 'mtdinfo -u' on your target.
+
+config IMAGE_ROOT_UBIFS_VID_HEADER_OFFSET
+ string
+ prompt "UBI VID header offset"
+ help
+ Offset if the VID header from start of the physical eraseblock.
+ Gain the correct value from 'mtdinfo -u' on your target.
+
+config IMAGE_ROOT_UBIFS_LEB_SIZE
+ string
+ prompt "UBI LEB size"
+ help
+ Logical erase block size.
+ Gain the correct value from 'mtdinfo -u' on your target.
+
+endmenu
+
+endif
diff --git a/rules/image-root-ubifs.make b/rules/image-root-ubifs.make
new file mode 100644
index 000000000..258b0e261
--- /dev/null
+++ b/rules/image-root-ubifs.make
@@ -0,0 +1,44 @@
+# -*-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_UBIFS) += image-root-ubifs
+
+#
+# Paths and names
+#
+IMAGE_ROOT_UBIFS := image-root-ubifs
+IMAGE_ROOT_UBIFS_DIR := $(BUILDDIR)/$(IMAGE_ROOT_UBIFS)
+IMAGE_ROOT_UBIFS_IMAGE := $(IMAGEDIR)/root.ubifs
+IMAGE_ROOT_UBIFS_FILES := $(IMAGEDIR)/root.tgz
+IMAGE_ROOT_UBIFS_CONFIG := ubifs.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_IMAGE_ROOT_UBIFS
+IMAGE_ROOT_UBIFS_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) \
+ MAX_SIZE=$(PTXCONF_IMAGE_ROOT_UBIFS_MAX_SIZE)
+
+$(IMAGE_ROOT_UBIFS_IMAGE):
+ @$(call targetinfo)
+ @$(call image/genimage, IMAGE_ROOT_UBIFS)
+ @$(call finish)
+endif
+
+# vim: syntax=make