alarm/fake-hwclock update

This commit is contained in:
moonman 2013-12-21 21:27:46 -07:00
parent 36cb3911cb
commit 795ff09cf5
4 changed files with 18 additions and 6 deletions

View file

@ -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/"
}

View file

@ -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
}

View file

@ -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