* [Buildroot] [PATCH] busybox: add option to install ntp startup script
@ 2015-05-18 19:58 Floris Bos
2015-05-19 3:08 ` Gergely Imreh
0 siblings, 1 reply; 6+ messages in thread
From: Floris Bos @ 2015-05-18 19:58 UTC (permalink / raw)
To: buildroot
Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
---
package/busybox/Config.in | 6 ++++++
package/busybox/S49ntp | 34 ++++++++++++++++++++++++++++++++++
package/busybox/busybox.mk | 15 +++++++++++++++
package/busybox/ntp.conf | 2 ++
4 files changed, 57 insertions(+)
create mode 100644 package/busybox/S49ntp
create mode 100644 package/busybox/ntp.conf
diff --git a/package/busybox/Config.in b/package/busybox/Config.in
index b4f949f..0b74536 100644
--- a/package/busybox/Config.in
+++ b/package/busybox/Config.in
@@ -26,6 +26,12 @@ config BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
Show packages in menuconfig that are potentially also provided
by busybox.
+config BR2_PACKAGE_BUSYBOX_NTP
+ bool "Install the ntp startup script"
+ help
+ Install the ntp daemon startup script, that by default operates in
+ client-only mode and synchronizes the system time with pool.ntp.org.
+
config BR2_PACKAGE_BUSYBOX_WATCHDOG
bool "Install the watchdog daemon startup script"
help
diff --git a/package/busybox/S49ntp b/package/busybox/S49ntp
new file mode 100644
index 0000000..357c95d
--- /dev/null
+++ b/package/busybox/S49ntp
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# Start ntp daemon (in client mode)
+#
+
+start() {
+ echo -n "Starting ntpd: "
+ start-stop-daemon -S -b -q -m -p /var/run/ntpd.pid --exec /usr/sbin/ntpd -- -n
+ echo "OK"
+}
+
+stop() {
+ echo -n "Stopping ntpd: "
+ start-stop-daemon -K -q -p /var/run/ntpd.pid
+ echo "OK"
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 1ce508a..32b6db8 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -151,6 +151,19 @@ define BUSYBOX_INSTALL_WATCHDOG_SCRIPT
endef
endif
+ifeq ($(BR2_PACKAGE_BUSYBOX_NTP),y)
+define BUSYBOX_SET_NTP
+ $(call KCONFIG_ENABLE_OPT,CONFIG_NTPD,$(BUSYBOX_BUILD_CONFIG))
+ $(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_NTPD_CONF,$(BUSYBOX_BUILD_CONFIG))
+endef
+define BUSYBOX_INSTALL_NTP_SCRIPT
+ $(INSTALL) -D -m 0644 package/busybox/ntp.conf \
+ $(TARGET_DIR)/etc/ntp.conf
+ $(INSTALL) -D -m 0755 package/busybox/S49ntp \
+ $(TARGET_DIR)/etc/init.d/S49ntp
+endef
+endif
+
# Enable "noclobber" in install.sh, to prevent BusyBox from overwriting any
# full-blown versions of apps installed by other packages with sym/hard links.
define BUSYBOX_NOCLOBBER_INSTALL
@@ -166,6 +179,7 @@ define BUSYBOX_KCONFIG_FIXUP_CMDS
$(BUSYBOX_SET_CRYPT_SHA)
$(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
$(BUSYBOX_SET_INIT)
+ $(BUSYBOX_SET_NTP)
$(BUSYBOX_SET_WATCHDOG)
endef
@@ -188,6 +202,7 @@ endef
define BUSYBOX_INSTALL_INIT_SYSV
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
+ $(BUSYBOX_INSTALL_NTP_SCRIPT)
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
endef
diff --git a/package/busybox/ntp.conf b/package/busybox/ntp.conf
new file mode 100644
index 0000000..9851d9f
--- /dev/null
+++ b/package/busybox/ntp.conf
@@ -0,0 +1,2 @@
+server 0.pool.ntp.org
+server 1.pool.ntp.org
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] busybox: add option to install ntp startup script
2015-05-18 19:58 [Buildroot] [PATCH] busybox: add option to install ntp startup script Floris Bos
@ 2015-05-19 3:08 ` Gergely Imreh
2015-05-19 4:23 ` Gergely Imreh
2015-05-19 8:24 ` Floris Bos
0 siblings, 2 replies; 6+ messages in thread
From: Gergely Imreh @ 2015-05-19 3:08 UTC (permalink / raw)
To: buildroot
On 19 May 2015 at 03:58, Floris Bos <bos@je-eigen-domein.nl> wrote:
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> ---
> package/busybox/Config.in | 6 ++++++
> package/busybox/S49ntp | 34 ++++++++++++++++++++++++++++++++++
> package/busybox/busybox.mk | 15 +++++++++++++++
> package/busybox/ntp.conf | 2 ++
> 4 files changed, 57 insertions(+)
> create mode 100644 package/busybox/S49ntp
> create mode 100644 package/busybox/ntp.conf
>
> diff --git a/package/busybox/Config.in b/package/busybox/Config.in
> index b4f949f..0b74536 100644
> --- a/package/busybox/Config.in
> +++ b/package/busybox/Config.in
> @@ -26,6 +26,12 @@ config BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> Show packages in menuconfig that are potentially also provided
> by busybox.
>
> +config BR2_PACKAGE_BUSYBOX_NTP
> + bool "Install the ntp startup script"
> + help
> + Install the ntp daemon startup script, that by default operates in
> + client-only mode and synchronizes the system time with pool.ntp.org.
> +
Should this section be wrapped in an "if BR2_PACKAGE_NTP" / "endif"
block? I guess there's no point showing the option if the NTP package
is not selected.
On a higher level, wouldn't it make sense to add this option to the
NTP package itself, instead of busybox? Especially because NTP is not
the only ntp client supported by busybox, there's also chrony. Ideally
that should also have an option for default setup and startup script,
just like the this patch aims to do for ntp.
> config BR2_PACKAGE_BUSYBOX_WATCHDOG
> bool "Install the watchdog daemon startup script"
> help
> diff --git a/package/busybox/S49ntp b/package/busybox/S49ntp
> new file mode 100644
> index 0000000..357c95d
> --- /dev/null
> +++ b/package/busybox/S49ntp
> @@ -0,0 +1,34 @@
> +#!/bin/sh
> +#
> +# Start ntp daemon (in client mode)
> +#
> +
> +start() {
> + echo -n "Starting ntpd: "
> + start-stop-daemon -S -b -q -m -p /var/run/ntpd.pid --exec /usr/sbin/ntpd -- -n
> + echo "OK"
> +}
> +
> +stop() {
> + echo -n "Stopping ntpd: "
> + start-stop-daemon -K -q -p /var/run/ntpd.pid
> + echo "OK"
> +}
> +
> +case "$1" in
> + start)
> + start
> + ;;
> + stop)
> + stop
> + ;;
> + restart|reload)
> + stop
> + start
> + ;;
> + *)
> + echo "Usage: $0 {start|stop|restart}"
> + exit 1
> +esac
> +
> +exit $?
> diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
> index 1ce508a..32b6db8 100644
> --- a/package/busybox/busybox.mk
> +++ b/package/busybox/busybox.mk
> @@ -151,6 +151,19 @@ define BUSYBOX_INSTALL_WATCHDOG_SCRIPT
> endef
> endif
>
> +ifeq ($(BR2_PACKAGE_BUSYBOX_NTP),y)
> +define BUSYBOX_SET_NTP
> + $(call KCONFIG_ENABLE_OPT,CONFIG_NTPD,$(BUSYBOX_BUILD_CONFIG))
> + $(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_NTPD_CONF,$(BUSYBOX_BUILD_CONFIG))
> +endef
> +define BUSYBOX_INSTALL_NTP_SCRIPT
> + $(INSTALL) -D -m 0644 package/busybox/ntp.conf \
> + $(TARGET_DIR)/etc/ntp.conf
> + $(INSTALL) -D -m 0755 package/busybox/S49ntp \
> + $(TARGET_DIR)/etc/init.d/S49ntp
> +endef
> +endif
> +
> # Enable "noclobber" in install.sh, to prevent BusyBox from overwriting any
> # full-blown versions of apps installed by other packages with sym/hard links.
> define BUSYBOX_NOCLOBBER_INSTALL
> @@ -166,6 +179,7 @@ define BUSYBOX_KCONFIG_FIXUP_CMDS
> $(BUSYBOX_SET_CRYPT_SHA)
> $(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
> $(BUSYBOX_SET_INIT)
> + $(BUSYBOX_SET_NTP)
> $(BUSYBOX_SET_WATCHDOG)
> endef
>
> @@ -188,6 +202,7 @@ endef
>
> define BUSYBOX_INSTALL_INIT_SYSV
> $(BUSYBOX_INSTALL_MDEV_SCRIPT)
> + $(BUSYBOX_INSTALL_NTP_SCRIPT)
> $(BUSYBOX_INSTALL_LOGGING_SCRIPT)
> $(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
> endef
> diff --git a/package/busybox/ntp.conf b/package/busybox/ntp.conf
> new file mode 100644
> index 0000000..9851d9f
> --- /dev/null
> +++ b/package/busybox/ntp.conf
> @@ -0,0 +1,2 @@
> +server 0.pool.ntp.org
> +server 1.pool.ntp.org
Isn't 2 servers too few in general? If there's a default conf, maybe
use the same setup as the NTP Pool project page's simple setup at
http://www.pool.ntp.org/en/use.html
--- /dev/null
+++ b/package/busybox/ntp.conf
@@ -0,0 +1,6 @@
+driftfile /var/lib/ntp/ntp.drift
+
+server 0.pool.ntp.org
+server 1.pool.ntp.org
+server 2.pool.ntp.org
+server 3.pool.ntp.org
Cheers,
Greg
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] busybox: add option to install ntp startup script
2015-05-19 3:08 ` Gergely Imreh
@ 2015-05-19 4:23 ` Gergely Imreh
2015-05-19 5:00 ` Baruch Siach
2015-05-19 8:24 ` Floris Bos
1 sibling, 1 reply; 6+ messages in thread
From: Gergely Imreh @ 2015-05-19 4:23 UTC (permalink / raw)
To: buildroot
On 19 May 2015 at 11:08, Gergely Imreh <imrehg@gmail.com> wrote:
> On 19 May 2015 at 03:58, Floris Bos <bos@je-eigen-domein.nl> wrote:
>> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>> ---
>> package/busybox/Config.in | 6 ++++++
>> package/busybox/S49ntp | 34 ++++++++++++++++++++++++++++++++++
>> package/busybox/busybox.mk | 15 +++++++++++++++
>> package/busybox/ntp.conf | 2 ++
>> 4 files changed, 57 insertions(+)
>> create mode 100644 package/busybox/S49ntp
>> create mode 100644 package/busybox/ntp.conf
>>
>> diff --git a/package/busybox/Config.in b/package/busybox/Config.in
>> index b4f949f..0b74536 100644
>> --- a/package/busybox/Config.in
>> +++ b/package/busybox/Config.in
>> @@ -26,6 +26,12 @@ config BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>> Show packages in menuconfig that are potentially also provided
>> by busybox.
>>
>> +config BR2_PACKAGE_BUSYBOX_NTP
>> + bool "Install the ntp startup script"
>> + help
>> + Install the ntp daemon startup script, that by default operates in
>> + client-only mode and synchronizes the system time with pool.ntp.org.
>> +
>
> Should this section be wrapped in an "if BR2_PACKAGE_NTP" / "endif"
> block? I guess there's no point showing the option if the NTP package
> is not selected.
>
> On a higher level, wouldn't it make sense to add this option to the
> NTP package itself, instead of busybox? Especially because NTP is not
> the only ntp client supported by busybox, there's also chrony. Ideally
> that should also have an option for default setup and startup script,
> just like the this patch aims to do for ntp.
>
>
>> config BR2_PACKAGE_BUSYBOX_WATCHDOG
>> bool "Install the watchdog daemon startup script"
>> help
>> diff --git a/package/busybox/S49ntp b/package/busybox/S49ntp
>> new file mode 100644
>> index 0000000..357c95d
>> --- /dev/null
>> +++ b/package/busybox/S49ntp
>> @@ -0,0 +1,34 @@
>> +#!/bin/sh
>> +#
>> +# Start ntp daemon (in client mode)
>> +#
>> +
>> +start() {
>> + echo -n "Starting ntpd: "
>> + start-stop-daemon -S -b -q -m -p /var/run/ntpd.pid --exec /usr/sbin/ntpd -- -n
>> + echo "OK"
>> +}
>> +
>> +stop() {
>> + echo -n "Stopping ntpd: "
>> + start-stop-daemon -K -q -p /var/run/ntpd.pid
>> + echo "OK"
>> +}
>> +
>> +case "$1" in
>> + start)
>> + start
>> + ;;
>> + stop)
>> + stop
>> + ;;
>> + restart|reload)
>> + stop
>> + start
>> + ;;
>> + *)
>> + echo "Usage: $0 {start|stop|restart}"
>> + exit 1
>> +esac
>> +
>> +exit $?
>> diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
>> index 1ce508a..32b6db8 100644
>> --- a/package/busybox/busybox.mk
>> +++ b/package/busybox/busybox.mk
>> @@ -151,6 +151,19 @@ define BUSYBOX_INSTALL_WATCHDOG_SCRIPT
>> endef
>> endif
>>
>> +ifeq ($(BR2_PACKAGE_BUSYBOX_NTP),y)
>> +define BUSYBOX_SET_NTP
>> + $(call KCONFIG_ENABLE_OPT,CONFIG_NTPD,$(BUSYBOX_BUILD_CONFIG))
>> + $(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_NTPD_CONF,$(BUSYBOX_BUILD_CONFIG))
>> +endef
>> +define BUSYBOX_INSTALL_NTP_SCRIPT
>> + $(INSTALL) -D -m 0644 package/busybox/ntp.conf \
>> + $(TARGET_DIR)/etc/ntp.conf
>> + $(INSTALL) -D -m 0755 package/busybox/S49ntp \
>> + $(TARGET_DIR)/etc/init.d/S49ntp
>> +endef
>> +endif
>> +
>> # Enable "noclobber" in install.sh, to prevent BusyBox from overwriting any
>> # full-blown versions of apps installed by other packages with sym/hard links.
>> define BUSYBOX_NOCLOBBER_INSTALL
>> @@ -166,6 +179,7 @@ define BUSYBOX_KCONFIG_FIXUP_CMDS
>> $(BUSYBOX_SET_CRYPT_SHA)
>> $(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
>> $(BUSYBOX_SET_INIT)
>> + $(BUSYBOX_SET_NTP)
>> $(BUSYBOX_SET_WATCHDOG)
>> endef
>>
>> @@ -188,6 +202,7 @@ endef
>>
>> define BUSYBOX_INSTALL_INIT_SYSV
>> $(BUSYBOX_INSTALL_MDEV_SCRIPT)
>> + $(BUSYBOX_INSTALL_NTP_SCRIPT)
>> $(BUSYBOX_INSTALL_LOGGING_SCRIPT)
>> $(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
>> endef
>> diff --git a/package/busybox/ntp.conf b/package/busybox/ntp.conf
>> new file mode 100644
>> index 0000000..9851d9f
>> --- /dev/null
>> +++ b/package/busybox/ntp.conf
>> @@ -0,0 +1,2 @@
>> +server 0.pool.ntp.org
>> +server 1.pool.ntp.org
>
> Isn't 2 servers too few in general? If there's a default conf, maybe
> use the same setup as the NTP Pool project page's simple setup at
> http://www.pool.ntp.org/en/use.html
>
> --- /dev/null
> +++ b/package/busybox/ntp.conf
> @@ -0,0 +1,6 @@
> +driftfile /var/lib/ntp/ntp.drift
> +
> +server 0.pool.ntp.org
> +server 1.pool.ntp.org
> +server 2.pool.ntp.org
> +server 3.pool.ntp.org
>
Also, after trying a test build, the ntp.conf script from this patch
is overwritten by package/ntp/ntpd.etc.conf anyways, so would not
actually show up on the target (I'm assuming that the ntp package is
selected).
Cheers,
Greg
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] busybox: add option to install ntp startup script
2015-05-19 4:23 ` Gergely Imreh
@ 2015-05-19 5:00 ` Baruch Siach
0 siblings, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2015-05-19 5:00 UTC (permalink / raw)
To: buildroot
Hi Greg,
On Tue, May 19, 2015 at 12:23:21PM +0800, Gergely Imreh wrote:
> >> diff --git a/package/busybox/ntp.conf b/package/busybox/ntp.conf
> >> new file mode 100644
> >> index 0000000..9851d9f
> >> --- /dev/null
> >> +++ b/package/busybox/ntp.conf
> >> @@ -0,0 +1,2 @@
> >> +server 0.pool.ntp.org
> >> +server 1.pool.ntp.org
> >
> > Isn't 2 servers too few in general? If there's a default conf, maybe
> > use the same setup as the NTP Pool project page's simple setup at
> > http://www.pool.ntp.org/en/use.html
> >
> > --- /dev/null
> > +++ b/package/busybox/ntp.conf
> > @@ -0,0 +1,6 @@
> > +driftfile /var/lib/ntp/ntp.drift
> > +
> > +server 0.pool.ntp.org
> > +server 1.pool.ntp.org
> > +server 2.pool.ntp.org
> > +server 3.pool.ntp.org
>
> Also, after trying a test build, the ntp.conf script from this patch
> is overwritten by package/ntp/ntpd.etc.conf anyways, so would not
> actually show up on the target (I'm assuming that the ntp package is
> selected).
That's the intended behaviour. Whenever you select a package that implements
the same functionality as a Busybox applet, the selected package takes
precedence. For this reason any such package should list busybox in its
<PKG>_DEPENDENCIES. I see that the ntp package doesn't do so, but I think it's
a bug. I'll send a patch shortly.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] busybox: add option to install ntp startup script
2015-05-19 3:08 ` Gergely Imreh
2015-05-19 4:23 ` Gergely Imreh
@ 2015-05-19 8:24 ` Floris Bos
2015-05-20 2:48 ` Gergely Imreh
1 sibling, 1 reply; 6+ messages in thread
From: Floris Bos @ 2015-05-19 8:24 UTC (permalink / raw)
To: buildroot
Hi,
On 05/19/2015 05:08 AM, Gergely Imreh wrote:
> On 19 May 2015 at 03:58, Floris Bos <bos@je-eigen-domein.nl> wrote:
>> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>> ---
>> package/busybox/Config.in | 6 ++++++
>> package/busybox/S49ntp | 34 ++++++++++++++++++++++++++++++++++
>> package/busybox/busybox.mk | 15 +++++++++++++++
>> package/busybox/ntp.conf | 2 ++
>> 4 files changed, 57 insertions(+)
>> create mode 100644 package/busybox/S49ntp
>> create mode 100644 package/busybox/ntp.conf
>>
>> diff --git a/package/busybox/Config.in b/package/busybox/Config.in
>> index b4f949f..0b74536 100644
>> --- a/package/busybox/Config.in
>> +++ b/package/busybox/Config.in
>> @@ -26,6 +26,12 @@ config BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>> Show packages in menuconfig that are potentially also provided
>> by busybox.
>>
>> +config BR2_PACKAGE_BUSYBOX_NTP
>> + bool "Install the ntp startup script"
>> + help
>> + Install the ntp daemon startup script, that by default operates in
>> + client-only mode and synchronizes the system time with pool.ntp.org.
>> +
> Should this section be wrapped in an "if BR2_PACKAGE_NTP" / "endif"
> block? I guess there's no point showing the option if the NTP package
> is not selected.
>
> On a higher level, wouldn't it make sense to add this option to the
> NTP package itself, instead of busybox?
Note that this patch is about enabling the ntpd applet included in
Busybox, as a light-weight alternative to the full blown standalone NTP
package.
So no, it does not depend on BR2_PACKAGE_NTP.
BR2_PACKAGE_NTP and BR2_PACKAGE_OPENNTPD already have startup scripts of
their own.
But if you just want your device to retrieve the time because it lacks a
RTC (as opposed to playing server and providing the time to others),
installing those is overkill in my opinion.
> Especially because NTP is not the only ntp client supported by busybox, there's also chrony.
>Ideally that should also have an option for default setup and startup
script, just like the this patch aims to do for ntp.
Chrony is a standalone buildroot package, and not an applet provided by
busybox.
Doesn't it install a startup script implicity, if you select it in
buildroot?
>> +++ b/package/busybox/ntp.conf
>> @@ -0,0 +1,2 @@
>> +server 0.pool.ntp.org
>> +server 1.pool.ntp.org
> Isn't 2 servers too few in general? If there's a default conf, maybe
> use the same setup as the NTP Pool project page's simple setup at
> http://www.pool.ntp.org/en/use.html
It is the same we currently have for the standalone ntp package in
package/ntp/ntpd.etc.conf
Am open to change that, but I do think the standalone ntp config should
be changed too then.
--
Yours sincerely,
Floris Bos
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] busybox: add option to install ntp startup script
2015-05-19 8:24 ` Floris Bos
@ 2015-05-20 2:48 ` Gergely Imreh
0 siblings, 0 replies; 6+ messages in thread
From: Gergely Imreh @ 2015-05-20 2:48 UTC (permalink / raw)
To: buildroot
On 19 May 2015 at 16:24, Floris Bos <bos@je-eigen-domein.nl> wrote:
> Hi,
>
>
> On 05/19/2015 05:08 AM, Gergely Imreh wrote:
>>
>> On 19 May 2015 at 03:58, Floris Bos <bos@je-eigen-domein.nl> wrote:
>>>
>>> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>>> ---
>>> package/busybox/Config.in | 6 ++++++
>>> package/busybox/S49ntp | 34 ++++++++++++++++++++++++++++++++++
>>> package/busybox/busybox.mk | 15 +++++++++++++++
>>> package/busybox/ntp.conf | 2 ++
>>> 4 files changed, 57 insertions(+)
>>> create mode 100644 package/busybox/S49ntp
>>> create mode 100644 package/busybox/ntp.conf
>>>
>>> diff --git a/package/busybox/Config.in b/package/busybox/Config.in
>>> index b4f949f..0b74536 100644
>>> --- a/package/busybox/Config.in
>>> +++ b/package/busybox/Config.in
>>> @@ -26,6 +26,12 @@ config BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>>> Show packages in menuconfig that are potentially also provided
>>> by busybox.
>>>
>>> +config BR2_PACKAGE_BUSYBOX_NTP
>>> + bool "Install the ntp startup script"
>>> + help
>>> + Install the ntp daemon startup script, that by default operates
>>> in
>>> + client-only mode and synchronizes the system time with
>>> pool.ntp.org.
>>> +
>>
>> Should this section be wrapped in an "if BR2_PACKAGE_NTP" / "endif"
>> block? I guess there's no point showing the option if the NTP package
>> is not selected.
>>
>> On a higher level, wouldn't it make sense to add this option to the
>> NTP package itself, instead of busybox?
>
>
> Note that this patch is about enabling the ntpd applet included in Busybox,
> as a light-weight alternative to the full blown standalone NTP package.
> So no, it does not depend on BR2_PACKAGE_NTP.
>
> BR2_PACKAGE_NTP and BR2_PACKAGE_OPENNTPD already have startup scripts of
> their own.
> But if you just want your device to retrieve the time because it lacks a RTC
> (as opposed to playing server and providing the time to others), installing
> those is overkill in my opinion.
Ah, sorry, it's my bad then! It wasn't really obvious to me that
there's an NTP within busybox.
>
>
>> Especially because NTP is not the only ntp client supported by busybox,
>> there's also chrony.
>
>>Ideally that should also have an option for default setup and startup
>> script, just like the this patch aims to do for ntp.
>
> Chrony is a standalone buildroot package, and not an applet provided by
> busybox.
> Doesn't it install a startup script implicity, if you select it in
> buildroot?
>
>>> +++ b/package/busybox/ntp.conf
>>> @@ -0,0 +1,2 @@
>>> +server 0.pool.ntp.org
>>> +server 1.pool.ntp.org
>>
>> Isn't 2 servers too few in general? If there's a default conf, maybe
>> use the same setup as the NTP Pool project page's simple setup at
>> http://www.pool.ntp.org/en/use.html
>
>
> It is the same we currently have for the standalone ntp package in
> package/ntp/ntpd.etc.conf
> Am open to change that, but I do think the standalone ntp config should be
> changed too then.
Looking at package/ntp/ntpd.etc.conf and it's just similar, but not
the same. It's similar in the sense that it only uses two servers, but
different that "iburst" is not used, and no other settings are in
there.
By the way, one more data point for choosing more than 2 NTP servers:
the RedHat knowledgebase also recommends at least 4:
https://access.redhat.com/solutions/58025
>
> --
> Yours sincerely,
>
> Floris Bos
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-20 2:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 19:58 [Buildroot] [PATCH] busybox: add option to install ntp startup script Floris Bos
2015-05-19 3:08 ` Gergely Imreh
2015-05-19 4:23 ` Gergely Imreh
2015-05-19 5:00 ` Baruch Siach
2015-05-19 8:24 ` Floris Bos
2015-05-20 2:48 ` Gergely Imreh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox