[oe-commits] [openembedded-core] 06/46: rootfs-postcommands.bbclass: Check if "/etc/fstab" exists
git at git.openembedded.org
git at git.openembedded.org
Tue May 16 13:09:08 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 43714514fb29a40830e6619552980d7f88d77fb7
Author: Panagiotis Tamtamis <panagiotis.tamtamis at unify.com>
AuthorDate: Fri Apr 28 10:09:27 2017 +0300
rootfs-postcommands.bbclass: Check if "/etc/fstab" exists
Using "read-only-rootfs" feature in minimal or special
purpose images (eg mounted images) makes build to fail
because ${IMAGE_ROOTFS}/etc/fstab file does not exist.
Signed-off-by: Panagiotis Tamtamis <panagiotis.tamtamis at unify.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta/classes/rootfs-postcommands.bbclass | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 498174a..1d66a42 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -84,7 +84,9 @@ systemd_create_users () {
#
read_only_rootfs_hook () {
# Tweak the mount option and fs_passno for rootfs in fstab
- sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab
+ if [ -f ${IMAGE_ROOTFS}/etc/fstab ]; then
+ sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab
+ fi
# If we're using openssh and the /etc/ssh directory has no pre-generated keys,
# we should configure openssh to use the configuration file /etc/ssh/sshd_config_readonly
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list