[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#751238: util-linux/linux: ignores RTC when the RTC driver is a module

Package: util-linux,linux
Severity: important
Tags: patch

With the new armmp kernel, RTC drivers are built as modules, and thus
the kernel doesn't set the system clock from the hardware clock when
the module is loaded, as explained in the RTC_HCTOSYS_DEVICE KConfig

| The driver for this RTC device must be loaded before late_initcall
| functions run, so it must usually be statically linked.

In that case, util-linux should set the system clock from the RTC
itself. This is correctly done through /etc/init.d/hwclock.sh when udev
is not used. When using udev, the rule 85-hwclock.rules call
hwclock-set, which assumes that the system clock has already been set
earlier by the kernel and that the only remaining thing to do is the
correct it to the local timezone (--systz). While this was true with
the wheezy kernels, it's not longer true with the jessie one, and the
--systohc option has to be used instead.

This is the purpose of the patch below:

--- util-linux-2.20.1/debian/hwclock-set
+++ util-linux-2.20.1/debian/hwclock-set
@@ -24,5 +24,5 @@
 if [ yes = "$BADYEAR" ] ; then
-    /sbin/hwclock --rtc=$dev --systz --badyear
+    /sbin/hwclock --rtc=$dev --hctosys --badyear
-    /sbin/hwclock --rtc=$dev --systz
+    /sbin/hwclock --rtc=$dev --hctosys
--- util-linux-2.20.1/debian/hwclock.rules
+++ util-linux-2.20.1/debian/hwclock.rules
@@ -1,4 +1,4 @@
-# Reset the System Clock to UTC if the hardware clock from which it was
-# copied by the kernel was in localtime.
+# Set the System Time from the Hardware Clock and set the kernel's timezone
+# value to the local timezone when the kernel clock module is loaded.
 KERNEL=="rtc0", RUN+="/lib/udev/hwclock-set $root/$name"

-- System Information:
Debian Release: 7.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: armhf (armv7l)

Kernel: Linux 3.13-0.bpo.1-armmp (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Reply to: