From 795ff09cf596021c13f888b6fa51536a4ce5dacb Mon Sep 17 00:00:00 2001 From: moonman Date: Sat, 21 Dec 2013 21:27:46 -0700 Subject: [PATCH] alarm/fake-hwclock update --- alarm/fake-hwclock/PKGBUILD | 9 +++++---- alarm/fake-hwclock/fake-hwclock.install | 11 +++++++++++ alarm/fake-hwclock/fake-hwclock.service | 4 ++-- .../fake-hwclock/{savesettime.sh => fake-hwclock.sh} | 0 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 alarm/fake-hwclock/fake-hwclock.install rename alarm/fake-hwclock/{savesettime.sh => fake-hwclock.sh} (100%) diff --git a/alarm/fake-hwclock/PKGBUILD b/alarm/fake-hwclock/PKGBUILD index 1126e04e5..c0aea5fc4 100644 --- a/alarm/fake-hwclock/PKGBUILD +++ b/alarm/fake-hwclock/PKGBUILD @@ -5,19 +5,20 @@ pkgname=fake-hwclock pkgver=0.1 -pkgrel=1 +pkgrel=2 pkgdesc="Saves time on shutdown and restores it on boot from a file" arch=('arm') license=('GPL') -source=('savesettime.sh' +install=fake-hwclock.install +source=('fake-hwclock.sh' 'fake-hwclock.service') md5sums=('8264f56630b0ed3299b51a43f3854285' - '555ce36333857e6ee56c98daa7df2f5f') + '011d9723726df436172c12a906c341c6') package() { mkdir -p "${pkgdir}/usr/lib/systemd/"{scripts,system} - cp "${srcdir}/savesettime.sh" "${pkgdir}/usr/lib/systemd/scripts/" + cp "${srcdir}/fake-hwclock.sh" "${pkgdir}/usr/lib/systemd/scripts/" cp "${srcdir}/fake-hwclock.service" "${pkgdir}/usr/lib/systemd/system/" } diff --git a/alarm/fake-hwclock/fake-hwclock.install b/alarm/fake-hwclock/fake-hwclock.install new file mode 100644 index 000000000..3372de6b3 --- /dev/null +++ b/alarm/fake-hwclock/fake-hwclock.install @@ -0,0 +1,11 @@ +post_install () { + echo "**********************************************************************" + echo "To keep fake-hwclock up to date in case of a power failure, add the" + echo "following job to root crontab: " + echo "*/15 * * * * /usr/lib/systemd/scripts/fake-hwclock.sh set" + echo "**********************************************************************" +} + +post_upgrade () { + post_install +} diff --git a/alarm/fake-hwclock/fake-hwclock.service b/alarm/fake-hwclock/fake-hwclock.service index 138e53713..e683e5165 100644 --- a/alarm/fake-hwclock/fake-hwclock.service +++ b/alarm/fake-hwclock/fake-hwclock.service @@ -1,12 +1,12 @@ [Unit] -Description=Sets time to what it was at last shutdown. +Description=Saves time on shutdown and sets it at boot to. After=sysinit.target [Service] Type=oneshot ExecStart=/usr/lib/systemd/scripts/savesettime.sh set -RemainAfterExit=true ExecStop=/usr/lib/systemd/scripts/savesettime.sh save +RemainAfterExit=true [Install] WantedBy=sysinit.target diff --git a/alarm/fake-hwclock/savesettime.sh b/alarm/fake-hwclock/fake-hwclock.sh similarity index 100% rename from alarm/fake-hwclock/savesettime.sh rename to alarm/fake-hwclock/fake-hwclock.sh