summaryrefslogtreecommitdiffstats
path: root/debian/hwclock-set
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:51 +0000
commitb324f452799a9aba5a1e9acc6833010c8635828e (patch)
treeccfd0a81e7daab4a2cd681a8161d3ae3748833dc /debian/hwclock-set
parentAdding upstream version 2.33.1. (diff)
downloadutil-linux-b324f452799a9aba5a1e9acc6833010c8635828e.tar.xz
util-linux-b324f452799a9aba5a1e9acc6833010c8635828e.zip
Adding debian version 2.33.1-0.1.debian/2.33.1-0.1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/hwclock-set')
-rwxr-xr-xdebian/hwclock-set37
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/hwclock-set b/debian/hwclock-set
new file mode 100755
index 0000000..eacf948
--- /dev/null
+++ b/debian/hwclock-set
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Reset the System Clock to UTC if the hardware clock from which it
+# was copied by the kernel was in localtime.
+
+dev=$1
+
+if [ -e /run/systemd/system ] ; then
+ exit 0
+fi
+
+if [ -e /run/udev/hwclock-set ]; then
+ exit 0
+fi
+
+if [ -f /etc/default/rcS ] ; then
+ . /etc/default/rcS
+fi
+
+# These defaults are user-overridable in /etc/default/hwclock
+BADYEAR=no
+HWCLOCKACCESS=yes
+HWCLOCKPARS=
+HCTOSYS_DEVICE=rtc0
+if [ -f /etc/default/hwclock ] ; then
+ . /etc/default/hwclock
+fi
+
+if [ yes = "$BADYEAR" ] ; then
+ /sbin/hwclock --rtc=$dev --systz --badyear
+ /sbin/hwclock --rtc=$dev --hctosys --badyear
+else
+ /sbin/hwclock --rtc=$dev --systz
+ /sbin/hwclock --rtc=$dev --hctosys
+fi
+
+# Note 'touch' may not be available in initramfs
+> /run/udev/hwclock-set