On 08/18/2014 08:39 PM, Robert Moskowitz wrote:
And firstboot.

On 08/17/2014 08:22 AM, Jacco Ligthart wrote:
* I still miss the RTC on these machines. is there a script somewhere
that sets the time to the last known date, so that (in case of missing
network connectivity) the clock never goes backwards. maybe something
like this: http://zenit.senecac.on.ca/wiki/index.php/Nortc

I have the same issue with my Cubieboards and was thinking about the
following 'simple' set of scripts.

First in the build have a file in say /etc/time/ called lasttime. The
original contents of this file is the time the image was built.

One of the first steps is to check for time not being close to zero
(nortc).  If nortc, pipe this file into the date command to set the
system date.

Since nortc, create an hourly or dayly cron job that updates the content
of lasttime.  Thus at next boot, the time set will be the last time this
file was updated.

Seems simple.  And needed.

Unfortunately I do not know how to add a script into the boot process,
as it should be easy to create this file and the script to pipe it into
'date'.

If you want it to kick in really early in the boot process, put the script into /etc/sysconfig/modules/. This is intended for driver probing/loading scripts that have to be there by the time the init scripts get run, and IIRC even before fstab is processed, but it can be abused for things like this. See the Chromebook wiki page for something similar.

Gordan
_______________________________________________
users mailing list
[email protected]
http://lists.redsleeve.org/mailman/listinfo/users

Reply via email to