[Voyage-linux] alix without hardware clock - saving/restore time on reboot
Teco Boot
(spam-protected)
Fri Jan 20 00:19:17 HKT 2012
BTW, alix2c has HW clock, but may lack battery. Maybe better save clock
by enabling rtc.ko or add --directisa in hwclock options. I changed
/etc/init.d/hwclock.so, I added:
# Include hwclock defaults if available
if [ -f /etc/default/hwclock ] ; then
. /etc/default/hwclock
fi
And /etc/default/hwclock:
# Defaults for hwclock.sh and hwclockfirst.sh initscripts
# Set this to any options you might need to give to hwclock, such
# as machine hardware clock type for Alphas.
HWCLOCKPARS="--directisa -u --noadjfile"
Teco
Op 19 jan. 2012, om 14:07 heeft Przemysław Matejko het volgende geschreven:
> Thank you, that's exactly what I needed.
>
> Noctivivans
>
> W dniu 19 stycznia 2012 13:46 użytkownik Teco Boot <teco at inf-net.nl> napisał:
>> This is implemented in voyage-sync. Enable in /etc/default/voyage-util:
>>
>> # set VOYAGE_SAVE_DATE_TIME to "YES" to enable saving date time before reboot
>> # and restore saved time after reboot.
>> VOYAGE_SAVE_DATE_TIME="YES"
>>
>> Teco
>>
>> Op 19 jan. 2012, om 13:34 heeft Przemysław Matejko het volgende geschreven:
>>
>>> Hi
>>> Does Voyage Linux supports boards without hardware clock (I have
>>> alix2c2)? I mean, if it provides "software clock" script or similar?
>>> For example, in Gentoo Linux there is a 'swclock' script (in
>>> baselayout-2) which writes system time during shutdown to file and
>>> restore it from file during startup - when you reboot device, there is
>>> only a few seconds clock drift, instead of years; also, this prevents
>>> problems with some programs which check date of files ("file from the
>>> future" error), when ntp server is out of sync.
>>> If there is no script like that, I have an idea how to do it:
>>> - saving time (filesystem must be rw; command must be invoked as late
>>> as possible on shutdown):
>>>
>>> date +%m%d%H%M%Y.%S > /place/where/we/write/time
>>>
>>> - restore time (filesystem can be ro; command must be invoked as early
>>> as possible on startup):
>>>
>>> date $(cat /place/where/we/write/time)
>>>
>>> I tested these commands on running system and it seems that the
>>> commands work, but I'm not sure where it should be added into init
>>> scripts.
>>> Anyway, I think it's good Idea to add regular init script like that
>>> (if there is no any) to repositories - after all, Voyage Linux is
>>> dedicated system for alix devices (most of them doesn't have hardware
>>> clock, not only mine).
>>>
>>> _______________________________________________
>>> Voyage-linux mailing list
>>> Voyage-linux at list.voyage.hk
>>> http://list.voyage.hk/mailman/listinfo/voyage-linux
>>
More information about the Voyage-linux
mailing list