Patchwork [meta-networking] ntp : Convert libcap use from PACKAGECONFIG to hard DEPEND.

login
register
mail settings
Submitter Philip Balister
Date April 23, 2014, 1:09 p.m.
Message ID <1398258576-21567-1-git-send-email-philip@balister.org>
Download mbox | patch
Permalink /patch/70803/
State New, archived
Headers show

Comments

Philip Balister - April 23, 2014, 1:09 p.m.
If ntp is built without libcap, it refuses to start with the following
message:

Starting ntpd: /usr/sbin/ntpd: The ``user'' option has been disabled -- built
without --enable-clockctl or --enable-linuxcaps
ntpd - NTP daemon program - Ver. 4.2.6p5
USAGE:  ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]...

Signed-off-by: Philip Balister <philip@balister.org>
---
 meta-networking/recipes-support/ntp/ntp.inc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Phil Blundell - April 23, 2014, 1:30 p.m.
On Wed, 2014-04-23 at 06:09 -0700, Philip Balister wrote:
> If ntp is built without libcap, it refuses to start with the following
> message:
> 
> Starting ntpd: /usr/sbin/ntpd: The ``user'' option has been disabled -- built
> without --enable-clockctl or --enable-linuxcaps

Aside from the DEPEND thing, wouldn't it be better to just avoid the
"--user" option if building without libcap?

p.
Martin Jansa - April 23, 2014, 2:58 p.m.
On Wed, Apr 23, 2014 at 06:09:36AM -0700, Philip Balister wrote:
> If ntp is built without libcap, it refuses to start with the following
> message:
> 

Why don't you just add cap to default PACKAGECONFIG? someone can add
PACKAGECONFIG for clockctl later and use that instead of linuxcaps.

> Starting ntpd: /usr/sbin/ntpd: The ``user'' option has been disabled -- built
> without --enable-clockctl or --enable-linuxcaps
> ntpd - NTP daemon program - Ver. 4.2.6p5
> USAGE:  ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
> 
> Signed-off-by: Philip Balister <philip@balister.org>
> ---
>  meta-networking/recipes-support/ntp/ntp.inc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
> index 9c3e0d1..b8e9853 100644
> --- a/meta-networking/recipes-support/ntp/ntp.inc
> +++ b/meta-networking/recipes-support/ntp/ntp.inc
> @@ -29,20 +29,21 @@ inherit autotools update-rc.d useradd systemd
>  
>  # The ac_cv_header_readline_history is to stop ntpdc depending on either
>  # readline or curses
> -EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no --with-binsubdir=sbin"
> +EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no --with-binsubdir=sbin --enable-linuxcaps"
>  CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
>  
>  USERADD_PACKAGES = "${PN}"
>  USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ntp \
>                         --shell /bin/false --user-group ntp"
>  
> +DEPEND = "libcap"
> +
>  PACKAGECONFIG ??= ""
>  PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
>                            --with-openssl-incdir=${STAGING_INCDIR} \
>                            --with-crypto, \
>                            --without-openssl --without-crypto, \
>                            openssl"
> -PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap"
>  PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline"
>  
>  do_install_append() {
> -- 
> 1.9.0
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Patch

diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index 9c3e0d1..b8e9853 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -29,20 +29,21 @@  inherit autotools update-rc.d useradd systemd
 
 # The ac_cv_header_readline_history is to stop ntpdc depending on either
 # readline or curses
-EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no --with-binsubdir=sbin"
+EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no --with-binsubdir=sbin --enable-linuxcaps"
 CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
 
 USERADD_PACKAGES = "${PN}"
 USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ntp \
                        --shell /bin/false --user-group ntp"
 
+DEPEND = "libcap"
+
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
                           --with-openssl-incdir=${STAGING_INCDIR} \
                           --with-crypto, \
                           --without-openssl --without-crypto, \
                           openssl"
-PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap"
 PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline"
 
 do_install_append() {