+fake-hwclock (0.2) unstable; urgency=low
+
+ * Move to /sbin. Closes: #658587
+ * Stop working in the initramfs, just running at rcS should be
+ enough. For machines upgrading from v0.1, need to:
+ + Re-generate the initramfs to remove the old hook
+ + Force installation of an rcS script
+ Closes: #658590
+ * Fix the cron job to exit cleanly after package removal.
+ Closes: #659254
+ * Reword the Description slightly. Closes: #660610
+
+ -- Steve McIntyre <93sam@debian.org> Mon, 20 Feb 2012 18:17:26 +0000
+
fake-hwclock (0.1) unstable; urgency=low
* Initial upload.
-- Steve McIntyre <93sam@debian.org> Tue, 31 Jan 2012 14:46:43 +0000
+
Architecture: all
Depends: ${misc:Depends}
Suggests: cron, ntp
-Description: Save/restore system clock on machines without working realtime clock
+Description: Save/restore system clock on machines without working RTC hardware
Some machines don't have a working realtime clock (RTC) unit, or no
driver for the hardware that does exist. fake-hwclock is a simple set
of scripts to save the kernel's current clock periodically (including
at shutdown) and restore it at boot so that the system clock keeps at
- least close to realtime. This will stop the problems of needing
- filesystem checks at every boot due to the system believing it has
- travelled in time back to 1970.
+ least close to realtime. This will stop some of the problems that may
+ be caused by a system believing it has travelled in time back to
+ 1970, such as needing to perform filesystem checks at every boot.
.
On top of this, use of NTP is still recommended to deal with the fake
clock "drifting" while the hardware is halted or rebooting.
# Simple cron script - save the current clock periodically in case of
# a power failure or other crash
-/bin/fake-hwclock save
+command -v fake-hwclock >/dev/null 2>&1 && fake-hwclock save
-/bin
-/usr/share/initramfs-tools/scripts/init-bottom
+/sbin
#!/bin/sh
+
### BEGIN INIT INFO
# Provides: fake-hwclock
# Required-Start:
# Required-Stop: umountroot
# Should-Stop:
-# Default-Start:
+# X-Start-Before: checkroot
+# Default-Start: S
# Default-Stop: 0 1 6
-# Short-Description: Save the current clock at shutdown
+# Short-Description: Restore / save the current clock
# Description:
### END INIT INFO
case "${1:-}" in
stop|reload|restart|force-reload)
echo "Stopping fake hwclock: saving system time."
- /bin/fake-hwclock save;;
+ fake-hwclock save;;
- start|status)
- ;;
+ start)
+ echo "Starting fake hwclock: loading system time."
+ fake-hwclock load;;
*)
echo "Usage: ${0:-} {start|stop|status|restart|reload|force-reload}" >&2
#!/bin/sh
-
set -e
+# Version 0.1 included an initramfs hook. If we're upgrading from that
+# version, we no longer have that hook. Update the generated initramfs
+# now so that we don't have to in future.
+
+cleanup_initramfs() {
+ if command -v update-initramfs >/dev/null 2>&1; then
+ update-initramfs -u
+ fi
+}
+
+# We'll also need to clean up links to make sure that our new start
+# link is installed by update-rc.d. Grotty. :-(
+force_remove_old_init_links() {
+ rm -f /etc/rc?.d/[SK]*fake-hwclock
+}
+
case "${1:-}" in
- configure|reconfigure)
- command -v update-initramfs >/dev/null 2>&1 && update-initramfs -u
+ configure)
+ if [ "$2"x = "0.1"x ] ; then
+ cleanup_initramfs
+ force_remove_old_init_links
+ fi
;;
+
+ *) :;;
esac
#DEBHELPER#
set -e
case "${1:-}" in
- remove)
- if command -v update-initramfs >/dev/null 2>&1; then
- update-initramfs -u
- fi
- ;;
-
purge)
- if command -v update-initramfs >/dev/null 2>&1; then
- update-initramfs -u
- fi
rm -f /etc/fake-hwclock.data
;;
+
*) :;;
esac
dh_testroot
dh_prep
dh_installdirs
- install -m 0755 fake-hwclock debian/fake-hwclock/bin
- install -m 0755 init debian/fake-hwclock/usr/share/initramfs-tools/scripts/init-bottom/fake-hwclock
+ install -m 0755 fake-hwclock debian/fake-hwclock/sbin
binary: binary-indep binary-arch
dh_installchangelogs
dh_installdocs
dh_installcron
- dh_installinit -- stop 02 0 1 6 .
+ dh_installinit --no-start -- start 02 S . stop 02 0 1 6 .
dh_compress
dh_fixperms
dh_installdeb
+++ /dev/null
-#!/bin/sh -e
-
-PREREQ=""
-prereqs()
-{
- echo "$PREREQ"
-}
-case $1 in
-# get pre-requisites
-prereqs)
- prereqs
- exit 0
- ;;
-esac
-
-echo
-echo "Starting fake hwclock: loading saved system time."
-FILE=/root/etc/fake-hwclock.data /root/bin/fake-hwclock load