From: Panagiotis Tamtamis Date: Fri, 28 Apr 2017 07:09:27 +0000 (+0300) Subject: rootfs-postcommands.bbclass: Check if "/etc/fstab" exists X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~21470 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43714514fb29a40830e6619552980d7f88d77fb7;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 Signed-off-by: Ross Burton --- diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 498174a664c..1d66a42953d 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