rootfs-postcommands: check /etc/gconf exists before working on it

Message ID 20190918121640.31682-1-ross.burton@intel.com
State Accepted
Commit 70a77b91031388ea29eff6b8885fd25cc35b1dae
Headers show
Series
  • rootfs-postcommands: check /etc/gconf exists before working on it
Related show

Commit Message

Ross Burton Sept. 18, 2019, 12:16 p.m.
Check that /etc/gconf exists before trying to find files under it, to avoid
writing find error messages to the rootfs log.

Also use ${sysconfdir}/gconf instead of hardcoding /etc/gconf.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/classes/rootfs-postcommands.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.20.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index fc338161c4d..88f75d0f442 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -361,7 +361,9 @@  rootfs_reproducible () {
 		echo $sformatted > ${IMAGE_ROOTFS}/etc/version
 		bbnote "rootfs_reproducible: set /etc/version to $sformatted"
 
-		find ${IMAGE_ROOTFS}/etc/gconf -name '%gconf.xml' -print0 | xargs -0r \
-		sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
+		if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then
+			find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \
+			sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
+		fi
 	fi
 }