From ba2cc701e017a817808f124cb6ac2619f5b7b4b3 Mon Sep 17 00:00:00 2001 From: Marc Mattmueller Date: Wed, 24 Mar 2021 11:36:03 +0100 Subject: [PATCH] vnstat: made default database storage volatile The service is storing the data in an interval to the emmc. This forces to damage our emmc in the test devices earlier as wihtout. Therefore the default location is on a ramdisk. For our test purpose this is sufficient. And if it need to be persisted a RTD section is created about how to do it. BugzID: 63636 Signed-off-by: Marc Mattmueller --- recipes-support/vnstat/vnstat_2.6.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/recipes-support/vnstat/vnstat_2.6.bb b/recipes-support/vnstat/vnstat_2.6.bb index 9a650f4..03e1dba 100644 --- a/recipes-support/vnstat/vnstat_2.6.bb +++ b/recipes-support/vnstat/vnstat_2.6.bb @@ -13,6 +13,18 @@ inherit autotools pkgconfig systemd EXTRA_OECONF = "--disable-extra-paths" +do_configure_append() { + # enable a volatile and persistent path for reading and writing the data base: + sed -i 's|ReadWritePaths=\/var\/lib|ReadWritePaths=\/var\/lib \/run\/|g' ${S}/examples/systemd/vnstat.service + + # adapt the default config running in volatile mode + sed -i 's|DatabaseDir \"\/var\/lib\/vnstat\"|DatabaseDir \"\/run\/vnstat\"|g' ${S}/cfg/vnstat.conf + + # add wwan0 as default interface + sed -i 's|Interface \"\"|Interface \"wwan0\"|g' ${S}/cfg/vnstat.conf +} + + do_install_append() { install -Dm644 ${S}/examples/systemd/vnstat.service "${D}${systemd_system_unitdir}/vnstat.service" }