Bugzilla – Bug 14228
Lua/C bindings to make SetupTZ, etc cleaner
Last modified: 2010-04-08 17:24:59 UTC
Create Lua/C readlink(), settimeofday(), and symlink() bindings, and use them to replace various os.execute() and io.popen() calls in squeezeplay_squeezeos's SetupTZ and Squeezebox{Jive|Baby|Fab4}'s setDate.
Created attachment 6074 [details] SqueezePlay patch (proposed)
Created attachment 6075 [details] SC/SN patch (proposed)
Patches to SP and the server-side stuff proposed and attached. These patches were both just done "all in my head", I haven't yet tried to compile and/or test this code, but if anyone has an opinion on whether the logic is sane, that would be good. Summary: All software clock, RTC clock, and timezone set/get code was pushed down to squeezeplay_squeezeos C code. The SetupTZ applet no longer has to load its (fat) self to attempt timezone guessing at applet registration / server connect time, and 7.5 SC/SN only send "date_epoch" which is unix epoch seconds used to set the SP software clock directly without any date-parsing magic.
Created attachment 6185 [details] SqueezePlay patch (proposed, v2) Updated the SP half of the patch now that I've actually compiled and tested it, it works. The SC/SN patch was fine as-is. Summary above still applies. Richard can you review this?
I've reviewed the SP patch, looks good to me. One minor thing, in lua you should use namesLikeThis, not names_like_this. I'd suggest something like: static const struct luaL_Reg squeezeos_bsp_lib[] = { { "reboot", squeezeos_reboot }, { "poweroff", squeezeos_poweroff }, + { "swclockSetEpoch", squeezeos_swclock_set_epoch }, + { "sys2hwclock", squeezeos_hwclock_sys2hc }, + { "hwclock2sys", squeezeos_hwclock_hc2sys }, + { "getTimezone", squeezeos_get_timezone }, + { "setTimezone", squeezeos_set_timezone }, { NULL, NULL } };
== Auto-comment from SVN commit #29156 to the slim repo by blblack == == https://svn.slimdevices.com/slim?view=revision&revision=29156 == bug 14228: switch to serving time to SP players in epoch seconds
== Auto-comment from SVN commit #8008 to the jive repo by blblack == == https://svn.slimdevices.com/jive?view=revision&revision=8008 == bug 14228: replace all the io.popen/os.execute calls related to time and timezone with C code in squeezeos.c, set time from network via epoch integer instead of date string, and do not load the heavy SetupTZ applet just for the initial timezone guessing. Needs slim/7.5/trunk r29156 to fully function
The above two commits should fix this all up.
== Auto-comment from SVN commit #8011 to the jive repo by blblack == == https://svn.slimdevices.com/jive?view=revision&revision=8011 == bug 14228: fix two missing "then"s from r8008
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release. If you are still seeing this issue, please let us know!