summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPanagiotis Tamtamis <panagiotis.tamtamis@unify.com>2017-04-28 10:09:27 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-16 14:08:28 +0100
commit6830a969f27814b76c2cbab56b8957c532b76487 (patch)
tree111704e9feb47869a38fefdbdecaaa21e275e857
parentbe0bac21257c4acc815ed7db1e9e8dc97e15dfbd (diff)
downloadpoky-6830a969f27814b76c2cbab56b8957c532b76487.tar.gz
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. (From OE-Core rev: 43714514fb29a40830e6619552980d7f88d77fb7) Signed-off-by: Panagiotis Tamtamis <panagiotis.tamtamis@unify.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/rootfs-postcommands.bbclass4
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 () {
84# 84#
85read_only_rootfs_hook () { 85read_only_rootfs_hook () {
86 # Tweak the mount option and fs_passno for rootfs in fstab 86 # Tweak the mount option and fs_passno for rootfs in fstab
87 sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab 87 if [ -f ${IMAGE_ROOTFS}/etc/fstab ]; then
88 sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab
89 fi
88 90
89 # If we're using openssh and the /etc/ssh directory has no pre-generated keys, 91 # If we're using openssh and the /etc/ssh directory has no pre-generated keys,
90 # we should configure openssh to use the configuration file /etc/ssh/sshd_config_readonly 92 # we should configure openssh to use the configuration file /etc/ssh/sshd_config_readonly