[OE-core] [oe-core][rocko][sumo][master][PATCH 2/2] base-files: respect PERSISTENT_LOG_DIR

Ankur Tyagi ankur.tyagi85 at gmail.com
Sat Aug 18 00:59:24 UTC 2018


Respect PERSISTENT_LOG_DIR variable. In this way, if the user overrides
this variable to be e.g "/home/root/log", /var/log on the final image would
be a link pointing to /home/root/log on persistent storage.

Signed-off-by: Ankur Tyagi <ankur.tyagi85 at gmail.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 1c0863b..597fdaa 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
            ${localstatedir}/backups ${localstatedir}/lib \
            /sys ${localstatedir}/lib/misc ${localstatedir}/spool \
            ${localstatedir}/volatile \
-           ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \
+           ${@'${localstatedir}/volatile/log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else '${PERSISTENT_LOG_DIR}' if d.getVar('PERSISTENT_LOG_DIR') else '${localstatedir}/log' } \
            /home ${prefix}/src ${localstatedir}/local \
            /media"
 
@@ -106,6 +106,10 @@ do_install () {
 		ln -sf volatile/$d ${D}${localstatedir}/$d
 	done
 
+	if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False -a ! -z ${PERSISTENT_LOG_DIR} ]; then
+		ln -sf ${PERSISTENT_LOG_DIR} ${D}/${localstatedir}/log
+	fi
+
 	ln -snf ../run ${D}${localstatedir}/run
 	ln -snf ../run/lock ${D}${localstatedir}/lock
 
-- 
2.7.4




More information about the Openembedded-core mailing list