]> err.no Git - util-linux/commitdiff
85-hwclock.rules only ran hwclock if BADYEAR defined.
authorPetter Reinholdtsen <pere@hungry.com>
Mon, 5 Oct 2009 11:04:23 +0000 (05:04 -0600)
committerLaMont Jones <lamont@debian.org>
Mon, 5 Oct 2009 11:06:44 +0000 (05:06 -0600)
Addresses-Debian-Bug: 543375
Signed-off-by: LaMont Jones <lamont@debian.org>
debian/hwclock-set [new file with mode: 0644]
debian/hwclock.rules
debian/rules

diff --git a/debian/hwclock-set b/debian/hwclock-set
new file mode 100644 (file)
index 0000000..2dcc8ee
--- /dev/null
@@ -0,0 +1,17 @@
+#!/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 [ -f /etc/default/rcS ] ; then
+    . /etc/default/rcS
+fi     
+
+if [ yes != "$UTC" ] ; then
+    if [ yes = "$BADYEAR" ] ; then
+       /sbin/hwclock --rtc=$dev --systz --localtime --noadjfile --badyear
+    else
+       /sbin/hwclock --rtc=$dev --systz --localtime --noadjfile
+    fi
+fi
index fc22468ce7bbe01c4eafb8836e3fe04f1d5746c3..e1e66e2e969afbc9b13f51eb17874ad56b9b749e 100644 (file)
@@ -1,8 +1,4 @@
 # Reset the System Clock to UTC if the hardware clock from which it was
 # copied by the kernel was in localtime.
 
-KERNEL=="rtc0", IMPORT{file}="/etc/default/rcS"
-KERNEL=="rtc0", ENV{UTC}!="yes", ENV{BADYEAR}!="yes", \
-       RUN+="/sbin/hwclock --rtc=$root/$name --systz --localtime --noadjfile"
-KERNEL=="rtc0", ENV{UTC}!="yes", ENV{BADYEAR}=="yes", \
-       RUN+="/sbin/hwclock --rtc=$root/$name --systz --localtime --noadjfile --badyear"
+KERNEL=="rtc0", RUN+="/lib/udev/hwclock-set $root/$name"
index 5f934769dbba422fec842918ba8cff4cbc38f0b6..70c8a3e1b7ea16420176e85cdab7c04db168293b 100755 (executable)
@@ -115,6 +115,7 @@ endif
        fi
        if [ -f debian/util-linux/sbin/hwclock ] ; then \
            install -m 644 debian/hwclock.rules debian/util-linux/lib/udev/rules.d/85-hwclock.rules; \
+           install -m 755 debian/hwclock-set debian/util-linux/lib/udev/hwclock-set; \
        fi
        # copy blkid library and symlink into udeb
        ln debian/libblkid1/lib/libblkid.so.1.* debian/libblkid1-udeb/lib/