summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2021-11-02 19:51:41 +0100
committerKhem Raj <raj.khem@gmail.com>2021-11-03 06:57:49 -0700
commitc386e5ab799ef1812a1b787b30c229fbded7db61 (patch)
tree6ef13166124f79cebfd0f4daa5e32f7173f9ddc3
parent5c1cea8f8e34134d12c8b17dde89b8ec5463eb58 (diff)
downloadmeta-openembedded-c386e5ab799ef1812a1b787b30c229fbded7db61.tar.gz
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>
-rw-r--r--meta-networking/recipes-protocols/openflow/openflow.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/openflow/openflow.inc b/meta-networking/recipes-protocols/openflow/openflow.inc
index 94d9553e1..c4e69b58e 100644
--- a/meta-networking/recipes-protocols/openflow/openflow.inc
+++ b/meta-networking/recipes-protocols/openflow/openflow.inc
@@ -34,4 +34,22 @@ do_configure:prepend() {
34do_install:append() { 34do_install:append() {
35 # Remove /var/run as it is created on startup 35 # Remove /var/run as it is created on startup
36 rm -rf ${D}${localstatedir}/run 36 rm -rf ${D}${localstatedir}/run
37
38 # /var/log/openflow needs to be created in runtime. Use rmdir to catch if
39 # upstream stops creating /var/log/openflow, or adds something else in
40 # /var/log.
41 rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log
42 rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
43
44 # Create /var/log/openflow in runtime.
45 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
46 install -d ${D}${nonarch_libdir}/tmpfiles.d
47 echo "d ${localstatedir}/log/${BPN} - - - -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
48 fi
49 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
50 install -d ${D}${sysconfdir}/default/volatiles
51 echo "d root root 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
52 fi
37} 53}
54
55FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"