-# This file causes the hardware clock to be set when /dev/rtc is available.
+# Reset the System Clock to UTC if the hardware clock from which it was
+# copied by the kernel was in localtime.
-KERNEL=="rtc", ACTION=="add", RUN+="set_hwclock"
+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"
+++ /dev/null
-#!/bin/sh
-# udev helper for hwclock
-#
-# This is based on the hwclock.sh init script, but somewhat simplified.
-
-[ ! -x /sbin/hwclock ] && exit 0
-. /etc/default/rcS
-
-[ "$GMT" = "-u" ] && UTC="yes"
-case "$UTC" in
- no|"") GMT="--localtime"
- UTC=""
- ;;
- yes) GMT="--utc"
- UTC="--utc"
- ;;
- *) exit 1 ;;
-esac
-
-case "$BADYEAR" in
- no|"") BADYEAR="" ;;
- yes) BADYEAR="--badyear" ;;
- *) exit 1 ;;
-esac
-
-# Copies Hardware Clock time to System Clock using the correct
-# timezone for hardware clocks in local time, and sets kernel
-# timezone. DO NOT REMOVE.
-/sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR
fi
ifneq ($(DISTRO),Debian)
if [ -f debian/util-linux/sbin/hwclock ] ; then \
- install -m 755 debian/hwclock.udev debian/util-linux/lib/udev/set_hwclock && \
- install -m 644 debian/hwclock.rules debian/util-linux/etc/udev/rules.d/85-hwclock.rules; \
+ install -m 644 debian/hwclock.rules debian/util-linux/lib/udev/rules.d/85-hwclock.rules; \
fi
endif
cd debian; if [ -f util-linux/sbin/fdisk ]; then \