summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image.bbclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index cd1783770b..03cbbf7a91 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -181,6 +181,8 @@ POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
181SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}' 181SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
182ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}' 182ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}'
183 183
184ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
185
184# some default locales 186# some default locales
185IMAGE_LINGUAS ?= "de-de fr-fr en-gb" 187IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
186 188
@@ -377,6 +379,22 @@ set_systemd_default_target () {
377 fi 379 fi
378} 380}
379 381
382# If /var/volatile is not empty, we have seen problems where programs such as the
383# journal make assumptions based on the contents of /var/volatile. The journal
384# would then write to /var/volatile before it was mounted, thus hiding the
385# items previously written.
386#
387# This change is to attempt to fix those types of issues in a way that doesn't
388# affect users that may not be using /var/volatile.
389empty_var_volatile () {
390 if [ -e ${IMAGE_ROOTFS}/etc/fstab ]; then
391 match=`awk '$1 !~ "#" && $2 ~ /\/var\/volatile/{print $2}' ${IMAGE_ROOTFS}/etc/fstab 2> /dev/null`
392 if [ -n "$match" ]; then
393 find ${IMAGE_ROOTFS}/var/volatile -mindepth 1 -delete
394 fi
395 fi
396}
397
380# Turn any symbolic /sbin/init link into a file 398# Turn any symbolic /sbin/init link into a file
381remove_init_link () { 399remove_init_link () {
382 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then 400 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then