Time on an Embedded Device
Introduction
For a device to keep correct time with Qtopia requires the following:
- the kernel must support a Real-Time Clock (RTC) interface and be built with the correct driver for the device RTC.
- Linux distribution must contain /sbin/hwclock to update hardware-time from system-time /sbin/hwclock -systohcr by Qtopia.
- boot scripts set system-time to hardware-time on startup /sbin/hwclock -s.
Note: These processes should be tested on the device prior to Qtopia controlling them.
Install Required Time Conversion files
Qtopia requires Time Conversion data such as in <qtopia-root-dir>/etc/zoneinfo to be on the device. To install the Time Conversion data files either:
- Create a symbolic link to the Time Conversion data files provided by Qtopia, for example, on the device run:
if [ ! -d /usr/share/zoneinfo ]; then ln -s /opt/Qtopia/etc/zoneinfo /usr/share/zoneinfo; fi
- Create a symbolic link to the Time Conversion data files provided by the device's environment, for example, on the device run:
if [ -d /usr/share/zoneinfo ]; then rm -rf /opt/Qtopia/etc/zoneinfo; ln -s /usr/share/zoneinfo /opt/Qtopia/etc/zoneinfo ; fi
- If the Time Conversion data cannot be uploaded to the device's root file system modify the value of QTOPIA_ZONEINFO_PATH in the device's custom.h to point to where the Time Conversion data files are stored.