Selaa lähdekoodia

add swupdate specific systemd-tmpfiles configuration file

The default systemd-tmpfiles configuration for the /tmp directory
(tmp.conf) causes systemd-tmpfiles-clean.service to remove the folders
/tmp/datadst and /tmp/scripts if they are not used for >=10 days.

SWUpdate creates these directories on startup (swupdate_init) and
assumes their existence on use.

For this reason, an SWUpdate specific systemd-tmpfiles configuration
is installed, in order to guarantee that the two directores above
are preserved (only the folders, not their content).

Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Simon Ausserlechner <simon.ausserlechner@siemens.com>
Tested-by: Austin Phillips <austin.phillips@planetinnovation.com.au>
Simon Ausserlechner 6 vuotta sitten
vanhempi
commit
66af6e7e01

+ 4 - 0
recipes-support/swupdate/swupdate.inc

@@ -14,6 +14,7 @@ SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=https \
      file://swupdate-usb.rules \
      file://swupdate-usb@.service \
      file://swupdate-progress.service \
+     file://systemd-tmpfiles-swupdate.conf \
      "
 
 INSANE_SKIP_${PN} = "ldflags"
@@ -21,6 +22,7 @@ PACKAGES =+ "${PN}-www ${PN}-lua"
 
 FILES_${PN}-lua += "${libdir}/lua/"
 FILES_${PN}-www = "/www/*"
+FILES_${PN} += "${libdir}/tmpfiles.d"
 
 S = "${WORKDIR}/git/"
 
@@ -137,6 +139,8 @@ do_install () {
 
 
   if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+    install -d ${D}${libdir}/tmpfiles.d
+    install -m 0644 ${WORKDIR}/systemd-tmpfiles-swupdate.conf ${D}${libdir}/tmpfiles.d/swupdate.conf
     install -d ${D}${sysconfdir}/udev/rules.d
     install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/
   fi

+ 3 - 0
recipes-support/swupdate/swupdate/systemd-tmpfiles-swupdate.conf

@@ -0,0 +1,3 @@
+X /tmp/datadst
+X /tmp/scripts
+X /tmp/swupdate.env