From fc4f61f6e0a846c4e1c4fd58e4af782c6685def4 Mon Sep 17 00:00:00 2001
From: Josef Schlehofer <josef.schlehofer@nic.cz>
Date: Sun, 23 Jun 2019 23:44:19 +0200
Subject: [PATCH] patches: luci: add /sbin/ntpd to see LuCI ntpd section

---
 ...mod-system-add-path-for-busybox-ntpd.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 patches/luci/hack/0001-luci-mod-system-add-path-for-busybox-ntpd.patch

diff --git a/patches/luci/hack/0001-luci-mod-system-add-path-for-busybox-ntpd.patch b/patches/luci/hack/0001-luci-mod-system-add-path-for-busybox-ntpd.patch
new file mode 100644
index 000000000..4f2ff8340
--- /dev/null
+++ b/patches/luci/hack/0001-luci-mod-system-add-path-for-busybox-ntpd.patch
@@ -0,0 +1,34 @@
+From 5fe39b88edc052de30d1fcfaf09d9bf89b8a878f Mon Sep 17 00:00:00 2001
+From: Josef Schlehofer <josef.schlehofer@nic.cz>
+Date: Sun, 23 Jun 2019 23:20:15 +0200
+Subject: [PATCH] luci-mod-system: add path for busybox ntpd
+
+If there is no /usr/sbin/ntpd, the ntpd section in LuCI isn't shown.
+This happens when we have located busybox ntpd in /sbin/ntpd instead of
+/usr/sbin/ntpd.
+
+Related to: https://gitlab.labs.nic.cz/turris/turris-build/blob/master/patches/openwrt/hack/0003-busybox-Try-to-install-everything-into-s-bin.patch
+
+Fixes: https://forum.turris.cz/t/ntp-server-choice-removed/10405/14?u=pepe
+
+Signed-off-by: Josef Schlehofer <josef.schlehofer@nic.cz>
+---
+ .../luci-mod-system/luasrc/model/cbi/admin_system/system.lua    | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua b/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua
+index 33ec027e0..0c007df34 100644
+--- a/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua
++++ b/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua
+@@ -8,7 +8,7 @@ local fs    = require "nixio.fs"
+ local conf  = require "luci.config"
+ 
+ local m, s, o
+-local has_ntpd = fs.access("/usr/sbin/ntpd")
++local has_ntpd = fs.access("/usr/sbin/ntpd") or fs.access("/sbin/ntpd")
+ local has_zram = fs.access("/etc/init.d/zram")
+ 
+ m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone."))
+-- 
+2.20.1
+
-- 
GitLab