Patchwork [V6,5/6] core-image-minimal: support read-only rootfs

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Jan. 6, 2013, 9:44 a.m.
Message ID <0e35cab1d0fb535e60519a11a2b95955845d4bfd.1357465230.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/42091/
State New
Headers show

Comments

Qi.Chen@windriver.com - Jan. 6, 2013, 9:44 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

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

[YOCTO #3406]

Signed-off-by: Chen Qi <Qi.Chen@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

Patch

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