Thanks Eric for your help on tracking this down, and posting your fix. I believe that as given, though, setalarm would give the wrong time for people who do have their hardware clocks in local time. Instead, I modified the script as follows:
# Account for hardware clock vs UTC mismatch
hw_offset=$(( $(date -d "$(sudo hwclock)" +%s) - $(date +%s) ))
I have attached a patch. Apply by running `patch /usr/bin/setalarm setalarm.patch`.
It would be great if folks with their hardware clcok in either utc or local time could test this out. If it works, I'll push the update to the code trunk.
Thanks Eric for your help on tracking this down, and posting your fix. I believe that as given, though, setalarm would give the wrong time for people who do have their hardware clocks in local time. Instead, I modified the script as follows:
# Account for hardware clock vs UTC mismatch
hw_offset=$(( $(date -d "$(sudo hwclock)" +%s) - $(date +%s) ))
# Actually set alarm # rtc/rtc0/ wakealarm
echo $(( wake_time - offset*60 + hw_offset )) > /sys/class/
I have attached a patch. Apply by running `patch /usr/bin/setalarm setalarm.patch`.
It would be great if folks with their hardware clcok in either utc or local time could test this out. If it works, I'll push the update to the code trunk.