openflow: Create /var/log/openflow in runtime

/var/log is normally a link to /var/volatile/log and /var/volatile is a
tmpfs mount. So anything created in /var/log will not be available when
the tmpfs is mounted.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Peter Kjellerstedt
2021-11-02 19:51:41 +01:00
committed by Khem Raj
parent 5c1cea8f8e
commit c386e5ab79
@@ -34,4 +34,22 @@ do_configure:prepend() {
do_install:append() {
# Remove /var/run as it is created on startup
rm -rf ${D}${localstatedir}/run
# /var/log/openflow needs to be created in runtime. Use rmdir to catch if
# upstream stops creating /var/log/openflow, or adds something else in
# /var/log.
rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log
rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
# Create /var/log/openflow in runtime.
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
install -d ${D}${nonarch_libdir}/tmpfiles.d
echo "d ${localstatedir}/log/${BPN} - - - -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
fi
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
install -d ${D}${sysconfdir}/default/volatiles
echo "d root root 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
fi
}
FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"