Question

Using buildroot 2013.05 (with Freescale i.MX6 CPU).

When I change date/time from console, e.g.: date -s "2013-11-26 02:11", this setting will lost during reboot. I'd learned, that I have to call hwclock -wu afterwards.

But what's the way to configure my buildroot-based linux that the hwclock is set automatically after date/time has been changed (regardless if date/time changed from linux console or via libc call from a C program).

Was it helpful?

Solution

The standard way to handle the hwclock on linux systems is to save the system time to the hardware clock during reboot, and restore it on boot. This is done through init scripts.

So in buildroot, you would add an init script that ends up in /etc/init.d/Sxxhwclock, typically using a rootfs overlay, or alternatively with a completely custom target skeleton.

See http://buildroot.uclibc.org/downloads/manual/manual.html#rootfs-custom for more info on customizing the target rootfs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top