]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
rootfs-postcommands.bbclass: Check if "/etc/fstab" exists
authorPanagiotis Tamtamis <panagiotis.tamtamis@unify.com>
Fri, 28 Apr 2017 07:09:27 +0000 (10:09 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 16 May 2017 13:08:15 +0000 (14:08 +0100)
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>
meta/classes/rootfs-postcommands.bbclass

index 498174a664c251feb8c3285a39748d46b7ce751f..1d66a42953d614d5ddcbb76b921947e85f203a55 100644 (file)
@@ -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