diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2019-12-16 23:21:26 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2019-12-17 00:07:50 +0300 |
commit | 4aeb24cf629a60980d4ad270fc1750754826613d (patch) | |
tree | 2b1448d35f422dfc4762616a1b9adbb8ff9d6ca0 /meta-openbmc-mods/meta-common/recipes-core/nv-sync | |
parent | 506611d226c82d05215ec3d2dab50a43a531b691 (diff) | |
download | openbmc-4aeb24cf629a60980d4ad270fc1750754826613d.tar.xz |
Update to internal 2019-12-16
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-core/nv-sync')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service | 11 | ||||
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync_git.bb | 20 |
2 files changed, 31 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service b/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service new file mode 100644 index 000000000..852027209 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service @@ -0,0 +1,11 @@ +[Unit] +Description=Overlay sync to NV storage + +[Service] +# Run rsync periodically to sync the overlay to NV storage +ExecStart=bash -c 'while true; do rsync -a --delete /tmp/.overlay/ /tmp/.rwfs/.overlay; sleep 20; done' +# On shutdown, archive the bash history so we don't lose it and run one last sync +ExecStop=bash -c 'history -a; rsync -a --delete /tmp/.overlay/ /tmp/.rwfs/.overlay' + +[Install] +WantedBy=multi-user.target diff --git a/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync_git.bb b/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync_git.bb new file mode 100644 index 000000000..0ee70e880 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync_git.bb @@ -0,0 +1,20 @@ +SUMMARY = "NV Overlay Sync" +DESCRIPTION = "Script to periodically sync the overlay to NV storage" + +S = "${WORKDIR}" +SRC_URI = "file://nv-sync.service \ +" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit systemd + +FILES_${PN} += "${systemd_system_unitdir}/nv-sync.service" + +do_install() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/nv-sync.service ${D}${systemd_system_unitdir} +} + +SYSTEMD_SERVICE_${PN} += " nv-sync.service" |