Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] Check if /etc/fstab exists
@ 2017-04-27 16:56 Panagiotis Tamtamis
  2017-04-27 17:31 ` ✗ patchtest: failure for " Patchwork
  2017-04-27 18:55 ` [PATCH] " Andre McCurdy
  0 siblings, 2 replies; 4+ messages in thread
From: Panagiotis Tamtamis @ 2017-04-27 16:56 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/classes/rootfs-postcommands.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 0c7ceea..4709369 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -64,7 +64,8 @@ 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
 
 	# 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
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-28  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-27 16:56 [PATCH] Check if /etc/fstab exists Panagiotis Tamtamis
2017-04-27 17:31 ` ✗ patchtest: failure for " Patchwork
2017-04-27 18:55 ` [PATCH] " Andre McCurdy
2017-04-28  9:32   ` Tamtamis, Panagiotis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox