diff --git a/README b/README index 31f106c..2877e9e 100644 --- a/README +++ b/README @@ -33,6 +33,17 @@ Additionally this layer checks the following variable in local.conf: Set MORTSGNA_ARMV7_TUNE="1" * If you are intersted in best optimization for your machine and/or you have a fast build host with lots of disk-space: don't! + see conf/distro/include/mortsgna-armv7-tune.inc for more information + +------------------------------------------------------------------------------- +The following image specific variables are handled: + +* MORTSGNA_IMAGE_VOLATILE_LOG_DIR + * If set to "1", journal goes to volatile /run/log and /var/log is linked to + /run/log which is volatile + * Otherwise all log goes to /var/log which is persistent + see conf/distro/include/mortsgna-image-logfile-volatile.inc for more + information ------------------------------------------------------------------------------- This layer contains the following folders: @@ -43,7 +54,7 @@ appends: for the layer is ignored (see conf/layer.conf). classes: - Currently instant-remote.bbclass and user-with-full-skel.bbclass. + Our classes to tailor build. conf: layer.conf / and distro configurations diff --git a/conf/distro/include/mortsgna-image-logfile-volatile.inc b/conf/distro/include/mortsgna-image-logfile-volatile.inc new file mode 100644 index 0000000..2f65805 --- /dev/null +++ b/conf/distro/include/mortsgna-image-logfile-volatile.inc @@ -0,0 +1,22 @@ +# override bitbake.conf default +VOLATILE_LOG_DIR = "false" + +# Do alignment on journal and /var/log +ROOTFS_POSTPROCESS_COMMAND += "postinst_volatile_log; " + +postinst_volatile_log () { + if [ "${MORTSGNA_IMAGE_VOLATILE_LOG_DIR}" = "1" ]; then + # systemd journal + if [ -f "${IMAGE_ROOTFS}${sysconfdir}/systemd/journald.conf" ]; then + sed -i \ + -e 's:.*Storage=.*:Storage=volatile:g' \ + ${IMAGE_ROOTFS}${sysconfdir}/systemd/journald.conf + fi + # link /var/log -> /run/log + if [ -e ${IMAGE_ROOTFS}${localstatedir}/log ]; then + rm -rf ${IMAGE_ROOTFS}${localstatedir}/log + fi + ln -sf ../run/log ${IMAGE_ROOTFS}${localstatedir}/log + fi +} + diff --git a/conf/distro/include/mortsgna.inc b/conf/distro/include/mortsgna.inc index 047d02c..f7e4397 100644 --- a/conf/distro/include/mortsgna.inc +++ b/conf/distro/include/mortsgna.inc @@ -116,5 +116,8 @@ DISTRO_FEATURES += "${DISTRO_WAYLAND}" # Inherit the default LIBC features superset from OE-core DISTRO_FEATURES += "${DISTRO_FEATURES_LIBC}" +# image specific volatile logfile handlding with MORTSGNA_IMAGE_VOLATILE_LOG_DIR +require conf/distro/include/mortsgna-image-logfile-volatile.inc + # Yocto tweaks require conf/distro/include/mortsgna-core-tweaks.inc diff --git a/conf/distro/mortsgna.conf b/conf/distro/mortsgna.conf index ad8ee95..6f3cc02 100644 --- a/conf/distro/mortsgna.conf +++ b/conf/distro/mortsgna.conf @@ -115,8 +115,9 @@ EXTRA_IMAGE_FEATURES += " \ allow-empty-password \ post-install-logging \ " -# Ensure postinst.log non volatile -POSTINST_LOGFILE = "${localstatedir}/postinstall.log" + +# default: persistent log +MORTSGNA_IMAGE_VOLATILE_LOG_DIR ?= "0" # make x11-base a valid IMAGE_FEATURES IMAGE_FEATURES[validitems] += "x11-base"