* luci/libs: move time fix to luci-addons
This commit is contained in:
parent
cb53f314f4
commit
971ffe47da
3 changed files with 13 additions and 6 deletions
|
@ -26,12 +26,14 @@ define Package/luci-addons/install
|
|||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/crontabs
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
|
||||
$(INSTALL_BIN) ./dist/usr/bin/run-parts $(1)/usr/bin
|
||||
$(INSTALL_BIN) ./dist/sbin/luci-flash $(1)/sbin
|
||||
$(INSTALL_BIN) ./dist/etc/init.d/luci-fixtime $(1)/etc/init.d
|
||||
|
||||
$(CP) ./dist/etc/crontabs/root $(1)/etc/crontabs/root
|
||||
$(CP) ./dist/etc/hotplug.d/iface/20-aliases $(1)/etc/hotplug.d/iface/20-aliases
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,luci-addons))
|
||||
$(eval $(call BuildPackage,luci-addons))
|
||||
|
|
10
contrib/package/luci-addons/dist/etc/init.d/luci-fixtime
vendored
Normal file
10
contrib/package/luci-addons/dist/etc/init.d/luci-fixtime
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
START=5
|
||||
|
||||
start() {
|
||||
cat <<' EOF' | lua -l luci.fs -l luci.sys -
|
||||
if (os.time() < 1000000000) then
|
||||
os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath())))
|
||||
end
|
||||
EOF
|
||||
}
|
|
@ -29,11 +29,6 @@ require("luci.http")
|
|||
require("luci.sys")
|
||||
require("luci.fs")
|
||||
|
||||
-- Dirty OpenWRT fix
|
||||
if (os.time() < 1000000000) then
|
||||
os.execute('date -s '..os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath() .. "/dispatcher.lua"))..' > /dev/null 2>&1')
|
||||
end
|
||||
|
||||
context = luci.util.threadlocal()
|
||||
|
||||
-- Index table
|
||||
|
|
Loading…
Reference in a new issue