diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2017-11-01 22:09:04 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-01-17 04:01:51 +0300 |
commit | 1e445244992dcd70eceb1b07ee1df5d6a4ab15ae (patch) | |
tree | fbef5769a8181e4096ac7a8a59da9206b2eca458 | |
parent | 9abc62353d60a18e160bdd14ac06f37384eb72fc (diff) | |
download | openbmc-1e445244992dcd70eceb1b07ee1df5d6a4ab15ae.tar.xz |
Exclude /tmp/images from cleanup
/tmp is deleted every 10 days
/usr/lib/tmpfiles.d/tmp.conf does this cleanup with this entry,
"q /tmp 1777 root root 10d".
Exclude /tmp/images from the cleanup, by adding "x /tmp/images"
to /usr/lib/tmpfiles.d/software.conf, if a feature of the machine is
obmc-ubi-fs or openpower-ubi-fs.
Resolves openbmc/openbmc#2544
Change-Id: I3ead88724adcd63ebfd809d310109a19232b1def
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
4 files changed, 27 insertions, 0 deletions
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd/software.conf b/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd/software.conf new file mode 100644 index 000000000..09ecd92e4 --- /dev/null +++ b/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd/software.conf @@ -0,0 +1,3 @@ +# /tmp/images is the software image upload directory +# It should not be deleted if the UBI code update is used. +x /tmp/images diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd_%.bbappend b/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 000000000..134bab5f1 --- /dev/null +++ b/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd_%.bbappend @@ -0,0 +1,13 @@ +SRC_URI += "${@mf_enabled(d, 'openpower-ubi-fs', 'file://software.conf')}" + +do_install_append() { + + # /tmp/images is the software image upload directory. + # It should not be deleted since it is watched by the Image Manager for + # new images. Don't install software.conf if obmc-ubi-fs is set since + # the bbappend in the meta-phosphor layer already installs if + # obmc-ubi-fs is set. + if ${@bb.utils.contains('MACHINE_FEATURES', 'openpower-ubi-fs', 'true', 'false', d)} && ! ${@bb.utils.contains('MACHINE_FEATURES', 'obmc-ubi-fs', 'true', 'false', d)}; then + install -m 0644 ${WORKDIR}/software.conf ${D}${exec_prefix}/lib/tmpfiles.d/ + fi +} diff --git a/meta-phosphor/common/recipes-core/systemd/systemd/software.conf b/meta-phosphor/common/recipes-core/systemd/systemd/software.conf new file mode 100644 index 000000000..09ecd92e4 --- /dev/null +++ b/meta-phosphor/common/recipes-core/systemd/systemd/software.conf @@ -0,0 +1,3 @@ +# /tmp/images is the software image upload directory +# It should not be deleted if the UBI code update is used. +x /tmp/images diff --git a/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend b/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend index dd8cddd64..52edfc5c1 100644 --- a/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend +++ b/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend @@ -16,6 +16,7 @@ SRC_URI += "file://0004-basic-Use-path-escaping-when-mangling-path-instances.pat SRC_URI += "file://0005-dont-return-error-if-unable-to-create-network-namespace.patch" SRC_URI += "file://0006-journal-Create-journald-dbus-object.patch" SRC_URI += "file://0007-journal-Add-Synchronize-dbus-method.patch" +SRC_URI += "${@mf_enabled(d, 'obmc-ubi-fs', 'file://software.conf')}" RRECOMMENDS_${PN} += "obmc-targets" FILES_${PN} += "${libdir}/systemd/network/default.network" @@ -30,4 +31,11 @@ do_install_append() { #TODO Remove after this issue is resolved #https://github.com/openbmc/openbmc/issues/152 ln -s /dev/null ${D}/etc/systemd/system/systemd-hwdb-update.service + + # /tmp/images is the software image upload directory. + # It should not be deleted since it is watched by the Image Manager + # for new images. + if ${@bb.utils.contains('MACHINE_FEATURES', 'obmc-ubi-fs', 'true', 'false', d)}; then + install -m 0644 ${WORKDIR}/software.conf ${D}${exec_prefix}/lib/tmpfiles.d/ + fi } |