[oe-commits] [openembedded-core] 26/62: rootfs-postcommands.bbclass: ensure that rootfs gets mounted ro
git at git.openembedded.org
git at git.openembedded.org
Sat Jan 6 10:15:01 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch rocko
in repository openembedded-core.
commit 2b9a670fabf3aefa93dc12be8b2fd3d6226be12a
Author: Patrick Ohly <patrick.ohly at intel.com>
AuthorDate: Mon Nov 27 16:56:42 2017 +0100
rootfs-postcommands.bbclass: ensure that rootfs gets mounted ro
When read-only-rootfs is active, we need to ensure that the rootfs
does not get mounted read/write by the kernel or initramfs. Adding
"ro" to the boot parameters achieves that.
Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
(cherry picked from commit cfc09de06ecc12bb42181004689e881c75072665)
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
meta/classes/rootfs-postcommands.bbclass | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 5391e7a..a4e627f 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -14,6 +14,14 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
+# We also need to do the same for the kernel boot parameters,
+# otherwise kernel or initramfs end up mounting the rootfs read/write
+# (the default) if supported by the underlying storage.
+#
+# We do this with _append because the default value might get set later with ?=
+# and we don't want to disable such a default that by setting a value here.
+APPEND_append = '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", " ro", "", d)}'
+
# Generates test data file with data store variables expanded in json format
ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; "
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list