openwrt/package
Petr Štetiar 9e8e8b7253 base-files: sysfixtime: Keep RTC time in UTC timezone
We need to tell hwclock with -u commandline option, that we would like
to keep our RTC clock in UTC timezone. Linux kernel expects RTC in UTC
timezone anyway.

In current state of things, we don't tell hwclock to load/store time
from/to RTC in UTC timezone so it uses the timezone from the system
time. If it's set to different timezone then UTC, sysfixtime is going to
screw the time in RTC.

I've following in the setup script:

  uci set system.@system[0].timezone='CET-1CEST,M3.5.0,M10.5.0/3'
  uci set system.@system[0].zonename='Europe/Prague'

I've this RTC setup (rtc1 is RTC on i.MX6 SoC, rtc0 is battery backed RTC mcp7941x):

  rtc-ds1307 3-006f: rtc core: registered mcp7941x as rtc0
  snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc1

Then we can experience following (current time is 10:15am):

	$ date
	Fri Oct 21 10:15:07 CEST 2016

	$ hwclock -r -f /dev/rtc0
	Fri Oct 21 08:14:46 2016  0.000000 seconds

	$ hwclock -u -r -f /dev/rtc0
	Fri Oct 21 10:14:46 2016  0.000000 seconds

And after current broken sysfixtime:

	$ /etc/init.d/sysfixtime stop

	$ date
	Fri Oct 21 10:15:25 CEST 2016

	$ hwclock -r -f /dev/rtc0
	Fri Oct 21 10:15:31 2016  0.000000 seconds

Now we've time in our battery backed RTC in CEST timezone instead of
UTC.  Then once again, but with this patch applied to sysfixtime, where
hwclock is using correctly the -u parameter:

	$ /etc/init.d/sysfixtime stop

	$ date
	Fri Oct 21 10:15:53 CEST 2016

	$ hwclock -r -f /dev/rtc0
	Fri Oct 21 08:15:55 2016  0.000000 seconds

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Jo-Philipp Wich <jo@mein.io>
2016-10-31 16:33:19 +01:00
..
base-files base-files: sysfixtime: Keep RTC time in UTC timezone 2016-10-31 16:33:19 +01:00
boot uboot-kirkwood: fix default bootcmd for Seagate Dockstar 2016-10-27 12:45:02 +02:00
devel strace: Update to 4.14 2016-10-26 12:37:46 +02:00
firmware ath10k-firmware: update qca9984 firmware 2016-10-31 12:49:57 +01:00
kernel linux/modules: drop ledtrig-netfilter 2016-10-27 15:29:36 +02:00
libs libreadline: set ABI_VERSION to force rebuild of dependent packages 2016-10-19 20:26:54 +02:00
network hostapd: properly package wpa-supplicant-mesh 2016-10-31 13:46:01 +01:00
system mtd: add fixwrgg command 2016-10-27 01:50:42 +03:00
utils util-linux: disc -> Disc and moved some packages 2016-10-27 12:45:05 +02:00
Makefile image: fix CONFIG_CLEAN_IPKG with CONFIG_TARGET_PER_DEVICE_ROOTFS 2016-09-25 09:30:55 +02:00