summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2015-09-07 13:05:42 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-12 22:48:42 +0100
commitd7508fee3037e050417d7f3d575f1a40bd96cb2c (patch)
tree81a2396ada081ceec414f9717b55676e72b23af2 /meta/recipes-core/initrdscripts
parentf9d230201e2cfc5b9a7c625a511e4775f6cc11b5 (diff)
downloadpoky-d7508fee3037e050417d7f3d575f1a40bd96cb2c.tar.gz
initramfs-framework: support rootflags and rootfstype boot parameter
These two parameters are supported by the kernel (https://www.kernel.org/doc/Documentation/kernel-parameters.txt). When an initramfs is used, the kernel does not mount the rootfs and the initramfs needs to react to them. The boot parameters can be set both by the image creator and by users. Supporting these two parameters is useful: - rootflags is needed to ensure that the rootfs is already mounted as intended in the time between starting init and init remounting it (as systemd does); this is critical for IMA where iversion must be active already when system starts writing files. - setting it correctly up-front avoids messages from the kernel ("cannot mount ... as ext2 because ...") when trying to guess the desired type. For example, assuming that only one of ext4/ext3/ext2 is set, rootfstype could be set in an image recipe with: APPEND_append = "${@''.join([' rootfstype=' + i for i in ['ext4', 'ext3', 'ext2'] if i in d.getVar('IMAGE_FSTYPES', True).split()])}" (From OE-Core rev: b8ea1c61b4b8071edf70f5d42119c54ea84de330) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
-rwxr-xr-xmeta/recipes-core/initrdscripts/initramfs-framework/finish9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish
index 325f47be40..006aef202f 100755
--- a/meta/recipes-core/initrdscripts/initramfs-framework/finish
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -22,7 +22,14 @@ finish_run() {
22 fi 22 fi
23 23
24 if [ -e "$bootparam_root" ]; then 24 if [ -e "$bootparam_root" ]; then
25 mount $bootparam_root $ROOTFS_DIR 25 flags=""
26 if [ -n "$bootparam_rootflags" ]; then
27 flags="$flags -o$bootparam_rootflags"
28 fi
29 if [ -n "$bootparam_rootfstype" ]; then
30 flags="$flags -t$bootparam_rootfstype"
31 fi
32 mount $flags $bootparam_root $ROOTFS_DIR
26 else 33 else
27 debug "root '$bootparam_root' doesn't exist." 34 debug "root '$bootparam_root' doesn't exist."
28 fi 35 fi