I’ve been trying for the past few hours to get resin to look at a hardware clock at boot time as I need a rough approximation of the time when used in a closed network (can’t always guarantee that the device will be able to sync with ntp).
Traditionally, this involves putting a little code in
/etc/rc.local such that it is executed at boot time, however I cannot find a way to either replicate this from the container, or inject the code into the base OS (preferably into the image so it is a one off process).
The code to be executed is (roughly)
echo ds3231 0x68 >/sys/bus/i2c/devices/i2c-1/new_device echo BB-I2C1 > /sys/devices/bone_capemgr.9/slots sleep 1 hwclock -f /dev/rtc1 -s