diff options
author | Panagiotis Tamtamis <panagiotis.tamtamis@unify.com> | 2017-04-28 10:09:27 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-05-16 14:08:15 +0100 |
commit | 43714514fb29a40830e6619552980d7f88d77fb7 (patch) | |
tree | 850ea2f4b62d1d38d4ff22bca9e523a6df12795c /meta/classes | |
parent | c5da7a3637b0eb8ec5b7368c7ac732d802a703f9 (diff) | |
download | openembedded-core-43714514fb29a40830e6619552980d7f88d77fb7.tar.gz openembedded-core-43714514fb29a40830e6619552980d7f88d77fb7.tar.bz2 openembedded-core-43714514fb29a40830e6619552980d7f88d77fb7.zip |
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@unify.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 498174a664..1d66a42953 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 |