[OE-core] [PATCH V6 5/6] core-image-minimal: support read-only rootfs

Qi.Chen at windriver.com Qi.Chen at windriver.com
Sun Jan 6 09:44:27 UTC 2013


From: Chen Qi <Qi.Chen at windriver.com>

Support read-only rootfs by providing a specific conf file for volatile storage.

[YOCTO #3406]

Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
---
 meta/recipes-core/images/core-image-minimal.bb     |   10 ++++++++++
 .../images/files/volatiles-readonly-minimal        |    8 ++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 meta/recipes-core/images/files/volatiles-readonly-minimal

diff --git a/meta/recipes-core/images/core-image-minimal.bb b/meta/recipes-core/images/core-image-minimal.bb
index 0d2613e..2e8d2ff 100644
--- a/meta/recipes-core/images/core-image-minimal.bb
+++ b/meta/recipes-core/images/core-image-minimal.bb
@@ -6,9 +6,19 @@ IMAGE_LINGUAS = " "
 
 LICENSE = "MIT"
 
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://volatiles-readonly-minimal"
+
 inherit core-image
 
 IMAGE_ROOTFS_SIZE = "8192"
 
 # remove not needed ipkg informations
 ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
+
+# install read-only rootfs specific conf file for minimal image
+choose_volatile_conf () {
+	cp ${WORKDIR}/volatiles-readonly-minimal \
+		${IMAGE_ROOTFS}/etc/default/volatiles/00_core_readonly
+}
diff --git a/meta/recipes-core/images/files/volatiles-readonly-minimal b/meta/recipes-core/images/files/volatiles-readonly-minimal
new file mode 100644
index 0000000..b7146a2
--- /dev/null
+++ b/meta/recipes-core/images/files/volatiles-readonly-minimal
@@ -0,0 +1,8 @@
+# This configuration file lists filesystem objects specific to minimal image
+# with read-only rootfs.
+# This configuration file will only be applied if the image is minimal and the
+# rootfs is read-only.
+# For the detailed format information, refer to /etc/default/volatiles/00_core.
+d root root 0755 /var/volatile/lib/ none
+d root root 0755 /var/volatile/lib/urandom/ none
+l root root 0755 /var/lib/urandom /var/volatile/lib/urandom
-- 
1.7.9.5





More information about the Openembedded-core mailing list