From: Petter Reinholdtsen Date: Mon, 5 Oct 2009 11:04:23 +0000 (-0600) Subject: 85-hwclock.rules only ran hwclock if BADYEAR defined. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c71a54a3650f3280394b0a6d21892e0aa452214;p=util-linux 85-hwclock.rules only ran hwclock if BADYEAR defined. Addresses-Debian-Bug: 543375 Signed-off-by: LaMont Jones --- diff --git a/debian/hwclock-set b/debian/hwclock-set new file mode 100644 index 00000000..2dcc8eee --- /dev/null +++ b/debian/hwclock-set @@ -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 diff --git a/debian/hwclock.rules b/debian/hwclock.rules index fc22468c..e1e66e2e 100644 --- a/debian/hwclock.rules +++ b/debian/hwclock.rules @@ -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" diff --git a/debian/rules b/debian/rules index 5f934769..70c8a3e1 100755 --- a/debian/rules +++ b/debian/rules @@ -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/