All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 0/4] yp-tools, ypbind-mt: new packages
@ 2016-01-24 14:54 Jonathan Ben-Avraham
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu Jonathan Ben-Avraham
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jonathan Ben-Avraham @ 2016-01-24 14:54 UTC (permalink / raw)
  To: buildroot

From: Jonathan Ben Avraham <yba@tkos.co.il>

This patch series adds the yp-tools and yp-bind packages to Buildroot.

This is the fourth attempt to submit an acceptable patch series for these
packages and is labeled as "v4" although the patch files themselves do not have
the same content as the equivalently numbered patch files from previous versions
of series.

Changes v3 -> v4:
  - Added comment to my yp-tools configure.ac patch 0000-remove-Wcast-align-\
    from-configure.ac.patch to indicate that my original patch that actually
    fixes the cast align problem was applied to the upstream.

  - Changed the Config.in web site URL's for yp-tools and yp-bind from the
    github repo URL's to the http://www.linux-nis.org/nis URL's.

  - Added comments in the *.mk files for yp-tools and ypbind-mt to explain
    the reason for choosing github over the web site Download links for the
    package sources.

  - Replaced the S70ypbind rc script with an original work based on the upstream
    author's rc script for SuSe. The current version is designed for simplicity.

  - Re-ordered the patches by 1) package/Config.in changes required by both of
    the new packages, 2) changes to other packages required by ypbind-mt, 3) the
    yp-tools package with all of its files and 4) the ypbind-mt package with all
    of its files.

Changes v2 -> v3:
  - Not changed: I retained the mapv4v6addr.h in its entirety rather than
    patching nis-hosts.c as per TP's request. The reason for this is that the
    two files have different licensing, as explained in the comments in
    yp-tools.mk. I think that patching an BSD-style licensed file in
    in its entirety, with it's copyright and license, into a GPLv2 file
    is not correct policy, and extracting the map_v4v6_address from
    mapv4v6addr.h without the copyright and license notice is a clear
    violation of license.
    
  - At TP's request, I added the 0000-remove-Wcast-align-from-configure\
    .ac.patch to squelch the -Wcast-align warning that causes the ARM
    build to fail, instead of the original 0001-Change-do_ypcall_tr-\
    param-resp-to-ypresp_val.patch that actually fixed the bug. My
    personal opinion is that it would have been better to leave the fix
    rather than to squelch the warning.

  - Added "comment" to the Config.in regarding glibc dependency.

  - Added a patch to linux-pam.mk to enable NIS support if yp-tools is
    selected.

  - Performed menuconfig UI testing and build testing for absolute
    minimal configurations using the following toolchains:
      - br-arm-basic-2015.11-rc1
      - br-arm-full-2015.11-rc1
      - br-arm-cortex-a9-musl-2015.11-rc1
      - br-arm11-full-nothread-2015.11-rc1
      - br-arm-full-static-2015.11-rc1
      - ia32-2012.09-62-i686-pc-linux-gnu-i386-linux
      - crosstool-ng GCC 5.1 arm-mxs-linux-gnueabihf

Jonathan Ben Avraham (4):
  Add yp-tools and ypbind-mt to packages menu
  linux-pam: Enable NIS support if yp-tools selected
  yp-tools: new package
  ypbind-mt: new package

 package/Config.in                                  |    2 +
 package/linux-pam/linux-pam.mk                     |    9 +-
 ...0000-remove-Wcast-align-from-configure.ac.patch |   19 ++++
 package/yp-tools/Config.in                         |   15 ++++
 package/yp-tools/mapv4v6addr.h                     |   69 +++++++++++++++
 package/yp-tools/yp-tools.hash                     |    2 +
 package/yp-tools/yp-tools.mk                       |   30 +++++++
 .../ypbind-mt/0001-Remove_man_dir_from_build.patch |   16 ++++
 package/ypbind-mt/Config.in                        |   17 ++++
 package/ypbind-mt/S70ypbind                        |   93 ++++++++++++++++++++
 package/ypbind-mt/ypbind-mt.mk                     |   24 +++++
 11 files changed, 295 insertions(+), 1 deletion(-)
 create mode 100644 package/yp-tools/0000-remove-Wcast-align-from-configure.ac.patch
 create mode 100644 package/yp-tools/Config.in
 create mode 100644 package/yp-tools/mapv4v6addr.h
 create mode 100644 package/yp-tools/yp-tools.hash
 create mode 100644 package/yp-tools/yp-tools.mk
 create mode 100644 package/ypbind-mt/0001-Remove_man_dir_from_build.patch
 create mode 100644 package/ypbind-mt/Config.in
 create mode 100755 package/ypbind-mt/S70ypbind
 create mode 100644 package/ypbind-mt/ypbind-mt.mk

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu
  2016-01-24 14:54 [Buildroot] [PATCH v4 0/4] yp-tools, ypbind-mt: new packages Jonathan Ben-Avraham
@ 2016-01-24 14:55 ` Jonathan Ben-Avraham
  2016-01-24 15:09   ` Thomas Petazzoni
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected Jonathan Ben-Avraham
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Jonathan Ben-Avraham @ 2016-01-24 14:55 UTC (permalink / raw)
  To: buildroot

From: Jonathan Ben Avraham <yba@tkos.co.il>


Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
---
 package/Config.in |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/Config.in b/package/Config.in
index 09c2b40..af9656b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1482,6 +1482,8 @@ endif
 	source "package/xinetd/Config.in"
 	source "package/xl2tp/Config.in"
 	source "package/xtables-addons/Config.in"
+	source "package/yp-tools/Config.in"
+	source "package/ypbind-mt/Config.in"
 	source "package/znc/Config.in"
 
 endmenu
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected
  2016-01-24 14:54 [Buildroot] [PATCH v4 0/4] yp-tools, ypbind-mt: new packages Jonathan Ben-Avraham
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu Jonathan Ben-Avraham
@ 2016-01-24 14:55 ` Jonathan Ben-Avraham
  2016-01-24 15:09   ` Thomas Petazzoni
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 3/4] yp-tools: new package Jonathan Ben-Avraham
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 4/4] ypbind-mt: " Jonathan Ben-Avraham
  3 siblings, 1 reply; 12+ messages in thread
From: Jonathan Ben-Avraham @ 2016-01-24 14:55 UTC (permalink / raw)
  To: buildroot

From: Jonathan Ben Avraham <yba@tkos.co.il>

Enable the NIS support in linux-pam when the yp-tools package is selected.

Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
---
 package/linux-pam/linux-pam.mk |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/package/linux-pam/linux-pam.mk b/package/linux-pam/linux-pam.mk
index 26b627e..3d860d2 100644
--- a/package/linux-pam/linux-pam.mk
+++ b/package/linux-pam/linux-pam.mk
@@ -11,7 +11,6 @@ LINUX_PAM_INSTALL_STAGING = YES
 LINUX_PAM_CONF_OPTS = \
 	--disable-prelude \
 	--disable-isadir \
-	--disable-nis \
 	--disable-db \
 	--disable-regenerate-docu \
 	--enable-securedir=/lib/security \
@@ -21,6 +20,14 @@ LINUX_PAM_AUTORECONF = YES
 LINUX_PAM_LICENSE = BSD-3c
 LINUX_PAM_LICENSE_FILES = Copyright
 
+ifeq ($(BR2_PACKAGE_YP_TOOLS),y)
+LINUX_PAM_CONF_OPTS += \
+	--enable-nis
+else
+LINUX_PAM_CONF_OPTS += \
+	--disable-nis
+endif
+
 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 LINUX_PAM_DEPENDENCIES += gettext
 LINUX_PAM_MAKE_OPTS += LIBS=-lintl
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 3/4] yp-tools: new package
  2016-01-24 14:54 [Buildroot] [PATCH v4 0/4] yp-tools, ypbind-mt: new packages Jonathan Ben-Avraham
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu Jonathan Ben-Avraham
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected Jonathan Ben-Avraham
@ 2016-01-24 14:55 ` Jonathan Ben-Avraham
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 4/4] ypbind-mt: " Jonathan Ben-Avraham
  3 siblings, 0 replies; 12+ messages in thread
From: Jonathan Ben-Avraham @ 2016-01-24 14:55 UTC (permalink / raw)
  To: buildroot

From: Jonathan Ben Avraham <yba@tkos.co.il>

Adds the yp-tools package that provides various NIS (yp) utilities.

Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
---
 ...0000-remove-Wcast-align-from-configure.ac.patch |   19 ++++++
 package/yp-tools/Config.in                         |   15 +++++
 package/yp-tools/mapv4v6addr.h                     |   69 ++++++++++++++++++++
 package/yp-tools/yp-tools.hash                     |    2 +
 package/yp-tools/yp-tools.mk                       |   30 +++++++++
 5 files changed, 135 insertions(+)
 create mode 100644 package/yp-tools/0000-remove-Wcast-align-from-configure.ac.patch
 create mode 100644 package/yp-tools/Config.in
 create mode 100644 package/yp-tools/mapv4v6addr.h
 create mode 100644 package/yp-tools/yp-tools.hash
 create mode 100644 package/yp-tools/yp-tools.mk

diff --git a/package/yp-tools/0000-remove-Wcast-align-from-configure.ac.patch b/package/yp-tools/0000-remove-Wcast-align-from-configure.ac.patch
new file mode 100644
index 0000000..f73728d
--- /dev/null
+++ b/package/yp-tools/0000-remove-Wcast-align-from-configure.ac.patch
@@ -0,0 +1,19 @@
+Remove "-Wcast-align" from the compiler warnings for compilation on arm arch.
+A patch to fix the cast-align warning was submitted to the package maintainer
+on December 16, 2015 and applied on January 20, 2016 in https://github.com/\
+thkukuk/yp-tools/commit/ea66fde92c228bf7b13612b07e4cf1b0667e8481.
+
+Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
+
+--- a/configure.ac	2015-04-16 13:08:34.000000000 +0300
++++ b/configure.ac	2015-12-23 18:38:55.358622278 +0200
+@@ -56,7 +56,7 @@
+ AM_PROG_CC_C_O
+ dnl If we're using gcc, we want warning flags
+ dnl test -n "$GCC" && WARNFLAGS="-Wall"
+-test -n "$GCC" && WARNFLAGS="-W -Wall -Wbad-function-cast -Wcast-align -Winline -Wnested-externs -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror"
++test -n "$GCC" && WARNFLAGS="-W -Wall -Wbad-function-cast -Winline -Wnested-externs -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror"
+ AC_SUBST(WARNFLAGS)
+ AC_PROG_CPP
+ AC_ISC_POSIX
+
diff --git a/package/yp-tools/Config.in b/package/yp-tools/Config.in
new file mode 100644
index 0000000..846bb1e
--- /dev/null
+++ b/package/yp-tools/Config.in
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_YP_TOOLS
+	bool "yp-tools"
+	depends on BR2_TOOLCHAIN_USES_GLIBC # rpcsvc/nis.h
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
+	select BR2_PACKAGE_RPCBIND # runtime
+	help
+	  The yp-tools package contains the programs domainname,
+	  nisdomainname, ypcat, ypchfn, ypchsh, ypdomainname, ypmatch,
+	  yppoll, ypset, ypwhich and yppasswd. yp-tools 3.x is a port of
+	  yp-tools 2.x to support IPv6.
+
+	  http://www.linux-nis.org/nis/yp-tools/
+
+comment "yp-tools needs an (e)glibc toolchain with rpcsvc/nis.h"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL
diff --git a/package/yp-tools/mapv4v6addr.h b/package/yp-tools/mapv4v6addr.h
new file mode 100644
index 0000000..7f85f7d
--- /dev/null
+++ b/package/yp-tools/mapv4v6addr.h
@@ -0,0 +1,69 @@
+/*
+ * ++Copyright++ 1985, 1988, 1993
+ * -
+ * Copyright (c) 1985, 1988, 1993
+ *    The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * --Copyright--
+ */
+
+#include <string.h>
+#include <arpa/nameser.h>
+
+static void
+map_v4v6_address (const char *src, char *dst)
+{
+  u_char *p = (u_char *) dst;
+  int i;
+
+  /* Move the IPv4 part to the right position.  */
+  memcpy (dst + 12, src, INADDRSZ);
+
+  /* Mark this ipv6 addr as a mapped ipv4. */
+  for (i = 0; i < 10; i++)
+    *p++ = 0x00;
+  *p++ = 0xff;
+  *p = 0xff;
+}
diff --git a/package/yp-tools/yp-tools.hash b/package/yp-tools/yp-tools.hash
new file mode 100644
index 0000000..2fdac72
--- /dev/null
+++ b/package/yp-tools/yp-tools.hash
@@ -0,0 +1,2 @@
+# Computed locally
+sha256 ba026ed7438fb14b82f08acbb2c1191f0d0d8031d77c1d870569ae9116ad4109 yp-tools-yp-tools-3_4.tar.gz
diff --git a/package/yp-tools/yp-tools.mk b/package/yp-tools/yp-tools.mk
new file mode 100644
index 0000000..6cee159
--- /dev/null
+++ b/package/yp-tools/yp-tools.mk
@@ -0,0 +1,30 @@
+################################################################################
+#
+# yp-tools
+#
+################################################################################
+
+# The github release tags are one to two releases ahead of the "Download"
+# links on http://www.linux-nis.org/nis/yp-tools/
+YP_TOOLS_VERSION = yp-tools-3_4
+YP_TOOLS_SITE = $(call github,thkukuk,yp-tools,$(YP_TOOLS_VERSION))
+YP_TOOLS_LICENSE = GPLv2
+YP_TOOLS_LICENSE_FILES = COPYING
+YP_TOOLS_AUTORECONF = YES
+YP_TOOLS_DEPENDENCIES = host-pkgconf
+YP_TOOLS_PRE_CONFIGURE_HOOKS += YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+
+# If mapv4v6addr.h is not otherwise available we provide it here. It provides a
+# single function, map_v4v6_address is needed by a single yp-tools file,
+# nis-hosts.c. This mapv4v6addr.h code has BSD style licensing, whereas yp-tools
+# has GPLv2 licensing. In order not to confuse the licensing we maintain
+# mapv4v6addr.h as a separate file rather than patching the entire file with
+# it's copyright and license notice into nis-hosts.c, which is licensed under
+# GPLv2.
+
+define YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+	$(INSTALL) -D -m 0644 $(YP_TOOLS_PKGDIR)/mapv4v6addr.h \
+		$(STAGING_DIR)/usr/include/resolv/mapv4v6addr.h
+endef
+
+$(eval $(autotools-package))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 4/4] ypbind-mt: new package
  2016-01-24 14:54 [Buildroot] [PATCH v4 0/4] yp-tools, ypbind-mt: new packages Jonathan Ben-Avraham
                   ` (2 preceding siblings ...)
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 3/4] yp-tools: new package Jonathan Ben-Avraham
@ 2016-01-24 14:55 ` Jonathan Ben-Avraham
  3 siblings, 0 replies; 12+ messages in thread
From: Jonathan Ben-Avraham @ 2016-01-24 14:55 UTC (permalink / raw)
  To: buildroot

From: Jonathan Ben Avraham <yba@tkos.co.il>

Adds the ypbind-mt package that contains a multithreaded ypbind daemon
for Linux. Uses threads for better response and supports the ypbind
protocols version 1, 2 and 3. ypbind finds the server for a given NIS
domain and stores information about it in a binding file on the local
host.

Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
---
 .../ypbind-mt/0001-Remove_man_dir_from_build.patch |   16 ++++
 package/ypbind-mt/Config.in                        |   17 ++++
 package/ypbind-mt/S70ypbind                        |   93 ++++++++++++++++++++
 package/ypbind-mt/ypbind-mt.mk                     |   24 +++++
 4 files changed, 150 insertions(+)
 create mode 100644 package/ypbind-mt/0001-Remove_man_dir_from_build.patch
 create mode 100644 package/ypbind-mt/Config.in
 create mode 100755 package/ypbind-mt/S70ypbind
 create mode 100644 package/ypbind-mt/ypbind-mt.mk

diff --git a/package/ypbind-mt/0001-Remove_man_dir_from_build.patch b/package/ypbind-mt/0001-Remove_man_dir_from_build.patch
new file mode 100644
index 0000000..10ebed7
--- /dev/null
+++ b/package/ypbind-mt/0001-Remove_man_dir_from_build.patch
@@ -0,0 +1,16 @@
+Remove the man directory from the build in order to avoid trying to build the
+commented targets ypbind.8 and ypconf.5
+
+Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
+
+--- a/Makefile.am	2014-12-04 16:27:18.000000000 +0200
++++ b/Makefile.am	2015-12-16 15:00:21.950050679 +0200
+@@ -5,7 +5,7 @@
+ #
+ AUTOMAKE_OPTIONS = 1.6 gnits dist-bzip2
+ #
+-SUBDIRS = lib src man po
++SUBDIRS = lib src po
+ 
+ CLEANFILES = *~
+ 
diff --git a/package/ypbind-mt/Config.in b/package/ypbind-mt/Config.in
new file mode 100644
index 0000000..2ac9d28
--- /dev/null
+++ b/package/ypbind-mt/Config.in
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_YPBIND_MT
+	bool "ypbind-mt"
+	depends on BR2_TOOLCHAIN_USES_GLIBC # rpcsvc/nis.h
+	select BR2_PACKAGE_YP_TOOLS
+	select BR2_PACKAGE_RPCBIND # runtime
+	help
+	  The ypbind-mt package contains a multithreaded ypbind daemon
+	  for Linux. It uses threads for better response and supports
+	  the ypbind protocols version 1, 2 and 3.
+
+	  Note: You need to select package "linux-pam" for NIS
+	  authentication.
+
+	  http://www.linux-nis.org/nis/ypbind-mt/
+
+comment "ypbind-mt needs an (e)glibc toolchain with rpcsvc/nis.h"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL
diff --git a/package/ypbind-mt/S70ypbind b/package/ypbind-mt/S70ypbind
new file mode 100755
index 0000000..e73bec6
--- /dev/null
+++ b/package/ypbind-mt/S70ypbind
@@ -0,0 +1,93 @@
+#!/bin/sh
+# Based on /etc/init.d/ypbind from SuSe Linux by Thorsten Kukuk
+
+DAEMON=/usr/sbin/ypbind
+pidfile=/var/run/ypbind.pid
+
+[ -x ${DAEMON} ] || exit 0
+
+[ -f /etc/default/ypbind ] && source /etc/default/ypbind
+
+case "$1" in
+	start)
+		echo -n "Starting ypbind: "
+		# Check for preset YP domainname
+		ypdomainname &> /dev/null
+		if [ $? -ne 0 ]; then
+			if [ ! -f /etc/defaultdomain ]; then
+				# No configured YP domainname
+				echo "FAIL"
+				exit 1
+			fi
+			# Assume that /etc/defaultdomain contains
+			# a valid domainname and assume ypdomainname
+			# succeeds
+			XDOMAINNAME=$(cat /etc/defaultdomain)
+			ypdomainname "${XDOMAINNAME}"
+		fi
+
+		if [ ! -f /etc/yp.conf -a "${YPBIND_BROADCAST}" != "yes" ]; then
+			# We need a local configuration if not in broadcast mode
+			echo "FAIL"
+			exit 1
+		fi
+
+		OPTIONS=""
+		test "${YPBIND_LOCAL_ONLY}" = "yes" && \
+			OPTIONS="-local-only ${OPTIONS}"
+		test "${YPBIND_BROADCAST}" = "yes" && \
+			OPTIONS="-broadcast ${OPTIONS}"
+		test "${YPBIND_BROKEN_SERVER}" = "yes" && \
+			OPTIONS="-broken-server ${OPTIONS}"
+
+		start-stop-daemon --start --quiet --pidfile ${pidfile} \
+			--exec ${DAEMON} -- ${OPTIONS}
+
+		if [ $? -ne 0 ]; then
+			echo "FAIL"
+			exit 1
+		fi
+
+		# Make sure we have a server so that later scripts can know
+		notfound=1
+		for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
+			if ypwhich &>/dev/null; then
+				notfound=0
+				break
+			fi
+			echo -n " ."
+			sleep 1;
+		done
+
+		if [ ${notfound} -eq 1 ]; then
+			# No NIS server found
+			echo "FAIL"
+			exit 1
+		fi
+
+		echo "OK"
+		;;
+
+	stop)
+		echo "Shutting down ypbind "
+		start-stop-daemon --stop --quiet --pidfile $pidfile
+		# Remove static data, else glibc will continue to use NIS
+		rm -f /var/yp/binding/* /var/run/ypbind.pid
+		;;
+
+	restart)
+		${0} stop
+		sleep 1
+		${0} start
+		;;
+
+	reload|force-reload)
+		echo "Reloading ypbind"
+		start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile
+		;;
+
+	*)
+		echo "Usage: ${0} {start|stop|restart|force-reload|reload}"
+		exit 1
+		;;
+esac
diff --git a/package/ypbind-mt/ypbind-mt.mk b/package/ypbind-mt/ypbind-mt.mk
new file mode 100644
index 0000000..08baf6e
--- /dev/null
+++ b/package/ypbind-mt/ypbind-mt.mk
@@ -0,0 +1,24 @@
+################################################################################
+#
+# ypbind-mt
+#
+################################################################################
+
+# The github releases of ypbind-mt are often a release or more ahead of the
+# "Download" links on http://www.linux-nis.org/nis/ypbind-mt/
+YPBIND_MT_VERSION = ypbind-mt-2_2
+YPBIND_MT_SITE = $(call github,thkukuk,ypbind-mt,$(YPBIND_MT_VERSION))
+YPBIND_MT_LICENSE = GPLv2
+YPBIND_MT_LICENSE_FILES = COPYING
+YPBIND_MT_AUTORECONF = YES
+YPBIND_MT_DEPENDENCIES = host-pkgconf yp-tools
+YPBIND_MT_CONF_ENV = \
+	PKG_CONFIG_SYSROOT_DIR="$(TARGET_DIR)" \
+	PKG_CONFIG_PATH="$(TARGET_DIR)/usr/lib/pkgconfig"
+
+define YPBIND_MT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(YPBIND_MT_PKGDIR)/S70ypbind \
+		$(TARGET_DIR)/etc/init.d/S70ypbind
+endef
+
+$(eval $(autotools-package))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu Jonathan Ben-Avraham
@ 2016-01-24 15:09   ` Thomas Petazzoni
  2016-01-24 15:33     ` Jonathan Ben Avraham
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-01-24 15:09 UTC (permalink / raw)
  To: buildroot

Jonathan,

On Sun, 24 Jan 2016 16:55:00 +0200, Jonathan Ben-Avraham wrote:
> From: Jonathan Ben Avraham <yba@tkos.co.il>
> 
> 
> Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
> ---
>  package/Config.in |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/Config.in b/package/Config.in
> index 09c2b40..af9656b 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1482,6 +1482,8 @@ endif
>  	source "package/xinetd/Config.in"
>  	source "package/xl2tp/Config.in"
>  	source "package/xtables-addons/Config.in"
> +	source "package/yp-tools/Config.in"
> +	source "package/ypbind-mt/Config.in"

This should not be a separate patch. Instead, adding yp-tools to the
menu should be part of the patch adding the yp-tools package, and
adding ypbind-mt to the menu should be part of the patch adding the
ypbind-mt package.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected
  2016-01-24 14:55 ` [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected Jonathan Ben-Avraham
@ 2016-01-24 15:09   ` Thomas Petazzoni
  2016-01-24 15:36     ` Jonathan Ben Avraham
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-01-24 15:09 UTC (permalink / raw)
  To: buildroot

Jonathan,

On Sun, 24 Jan 2016 16:55:01 +0200, Jonathan Ben-Avraham wrote:

> +ifeq ($(BR2_PACKAGE_YP_TOOLS),y)
> +LINUX_PAM_CONF_OPTS += \
> +	--enable-nis
> +else
> +LINUX_PAM_CONF_OPTS += \
> +	--disable-nis
> +endif

This patch should come *after* the yp-tools package is added in the
series.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu
  2016-01-24 15:09   ` Thomas Petazzoni
@ 2016-01-24 15:33     ` Jonathan Ben Avraham
  2016-01-24 15:38       ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Jonathan Ben Avraham @ 2016-01-24 15:33 UTC (permalink / raw)
  To: buildroot

On Sun, 24 Jan 2016, Thomas Petazzoni wrote:

> Date: Sun, 24 Jan 2016 16:09:20 +0100
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> To: Jonathan Ben-Avraham <yba@tkos.co.il>
> Cc: buildroot at busybox.net
> Subject: Re: [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages
>      menu
> 
> Jonathan,
>
> On Sun, 24 Jan 2016 16:55:00 +0200, Jonathan Ben-Avraham wrote:
>> From: Jonathan Ben Avraham <yba@tkos.co.il>
>>
>>
>> Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
>> ---
>>  package/Config.in |    2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/package/Config.in b/package/Config.in
>> index 09c2b40..af9656b 100644
>> --- a/package/Config.in
>> +++ b/package/Config.in
>> @@ -1482,6 +1482,8 @@ endif
>>  	source "package/xinetd/Config.in"
>>  	source "package/xl2tp/Config.in"
>>  	source "package/xtables-addons/Config.in"
>> +	source "package/yp-tools/Config.in"
>> +	source "package/ypbind-mt/Config.in"
>
> This should not be a separate patch. Instead, adding yp-tools to the
> menu should be part of the patch adding the yp-tools package, and
> adding ypbind-mt to the menu should be part of the patch adding the
> ypbind-mt package.

That is, one patch should look something like

 	source "package/xinetd/Config.in"
 	source "package/xl2tp/Config.in"
 	source "package/xtables-addons/Config.in"
  +	source "package/yp-tools/Config.in"
 	source "package/znc/Config.in"


and the other should look like

 	source "package/xinetd/Config.in"
 	source "package/xl2tp/Config.in"
 	source "package/xtables-addons/Config.in"
  +	source "package/ypbind-mt/Config.in"
 	source "package/znc/Config.in"

?

And then we rely on the order of the application of the patches to 
determine the order of the items in the final Config.in?

  - yba


> Thanks!
>
> Thomas
>

-- 
  9590 8E58 D30D 1660 C349  673D B205 4FC4 B8F5 B7F9  ~. .~  Tk Open Systems
=}-------- Jonathan Ben-Avraham ("yba") ----------ooO--U--Ooo------------{=
mailto:yba at tkos.co.il tel:+972.52.486.3386 http://tkos.co.il skype:benavrhm

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected
  2016-01-24 15:09   ` Thomas Petazzoni
@ 2016-01-24 15:36     ` Jonathan Ben Avraham
  2016-01-24 15:51       ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Jonathan Ben Avraham @ 2016-01-24 15:36 UTC (permalink / raw)
  To: buildroot

On Sun, 24 Jan 2016, Thomas Petazzoni wrote:

> Date: Sun, 24 Jan 2016 16:09:49 +0100
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> To: Jonathan Ben-Avraham <yba@tkos.co.il>
> Cc: buildroot at busybox.net
> Subject: Re: [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if
>     yp-tools selected
> 
> Jonathan,
>
> On Sun, 24 Jan 2016 16:55:01 +0200, Jonathan Ben-Avraham wrote:
>
>> +ifeq ($(BR2_PACKAGE_YP_TOOLS),y)
>> +LINUX_PAM_CONF_OPTS += \
>> +	--enable-nis
>> +else
>> +LINUX_PAM_CONF_OPTS += \
>> +	--disable-nis
>> +endif
>
> This patch should come *after* the yp-tools package is added in the
> series.

Is this a rule defined in the documentation? I didn't notice it. What is 
the reasoning behind the rule?

  - yba


> Thanks!
>
> Thomas
>

-- 
  9590 8E58 D30D 1660 C349  673D B205 4FC4 B8F5 B7F9  ~. .~  Tk Open Systems
=}-------- Jonathan Ben-Avraham ("yba") ----------ooO--U--Ooo------------{=
mailto:yba at tkos.co.il tel:+972.52.486.3386 http://tkos.co.il skype:benavrhm

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu
  2016-01-24 15:33     ` Jonathan Ben Avraham
@ 2016-01-24 15:38       ` Thomas Petazzoni
  2016-01-24 15:47         ` Jonathan Ben Avraham
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-01-24 15:38 UTC (permalink / raw)
  To: buildroot

Dear Jonathan Ben Avraham,

On Sun, 24 Jan 2016 17:33:24 +0200 (IST), Jonathan Ben Avraham wrote:

> That is, one patch should look something like
> 
>  	source "package/xinetd/Config.in"
>  	source "package/xl2tp/Config.in"
>  	source "package/xtables-addons/Config.in"
>   +	source "package/yp-tools/Config.in"
>  	source "package/znc/Config.in"

This change should be part of the patch adding package/yp-tools/.

> and the other should look like
> 
>  	source "package/xinetd/Config.in"
>  	source "package/xl2tp/Config.in"
>  	source "package/xtables-addons/Config.in"
>   +	source "package/ypbind-mt/Config.in"
>  	source "package/znc/Config.in"

This change should be part of the patch adding package/ypbind-mt/

> And then we rely on the order of the application of the patches to 
> determine the order of the items in the final Config.in?

Yes. A series is a list of patches that are ordered. They will be
applied in the order they are listed in your series. Many series have
patches that have dependencies between each other, that's the whole
purpose of sending them as a series rather than independently.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu
  2016-01-24 15:38       ` Thomas Petazzoni
@ 2016-01-24 15:47         ` Jonathan Ben Avraham
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Ben Avraham @ 2016-01-24 15:47 UTC (permalink / raw)
  To: buildroot

On Sun, 24 Jan 2016, Thomas Petazzoni wrote:

> Date: Sun, 24 Jan 2016 16:38:27 +0100
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> To: Jonathan Ben Avraham <yba@tkos.co.il>
> Cc: buildroot at busybox.net
> Subject: Re: [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages
>      menu
> 
> Dear Jonathan Ben Avraham,
>
> On Sun, 24 Jan 2016 17:33:24 +0200 (IST), Jonathan Ben Avraham wrote:
>
>> That is, one patch should look something like
>>
>>  	source "package/xinetd/Config.in"
>>  	source "package/xl2tp/Config.in"
>>  	source "package/xtables-addons/Config.in"
>>   +	source "package/yp-tools/Config.in"
>>  	source "package/znc/Config.in"
>
> This change should be part of the patch adding package/yp-tools/.
>
>> and the other should look like
>>
>>  	source "package/xinetd/Config.in"
>>  	source "package/xl2tp/Config.in"
>>  	source "package/xtables-addons/Config.in"
>>   +	source "package/ypbind-mt/Config.in"
>>  	source "package/znc/Config.in"
>
> This change should be part of the patch adding package/ypbind-mt/
>
>> And then we rely on the order of the application of the patches to
>> determine the order of the items in the final Config.in?
>
> Yes. A series is a list of patches that are ordered. They will be
> applied in the order they are listed in your series. Many series have
> patches that have dependencies between each other, that's the whole
> purpose of sending them as a series rather than independently.

Hi Thomas,
Thanks. I was not aware of the use of patch order to determine the final 
outcome and so I intentionally created a series that could be applied in 
any order and still have the desired outcome.

  - yba


> Thanks!
>
> Thomas
>

-- 
  9590 8E58 D30D 1660 C349  673D B205 4FC4 B8F5 B7F9  ~. .~  Tk Open Systems
=}-------- Jonathan Ben-Avraham ("yba") ----------ooO--U--Ooo------------{=
mailto:yba at tkos.co.il tel:+972.52.486.3386 http://tkos.co.il skype:benavrhm

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected
  2016-01-24 15:36     ` Jonathan Ben Avraham
@ 2016-01-24 15:51       ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2016-01-24 15:51 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Jan 2016 17:36:26 +0200 (IST), Jonathan Ben Avraham wrote:

> Is this a rule defined in the documentation? I didn't notice it. What is 
> the reasoning behind the rule?

Patches are applied in order. If we apply just your PATCH 2/4 without
applying 3/4, then this change will be an orphan change, since
BR2_PACKAGE_YP_TOOLS does not exist.

What you're doing is like adding code calling a function foo() in PATCH
2/4, and then adding the implementation of foo() in PATCH 3/4.

Granted, it's not that bad because if BR2_PACKAGE_YP_TOOLS doesn't
exist, then its value is empty, and your PATCH 2/4 doesn't do anything,
so it doesn't break anything. But it's just some dead code.

Note that these rules are nothing Buildroot specific. If you want to
contribute to any other open-source project like the Linux kernel,
U-Boot or other things, they will ask your patch series to comply with
those exact same rules.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-01-24 15:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-24 14:54 [Buildroot] [PATCH v4 0/4] yp-tools, ypbind-mt: new packages Jonathan Ben-Avraham
2016-01-24 14:55 ` [Buildroot] [PATCH v4 1/4] Add yp-tools and ypbind-mt to packages menu Jonathan Ben-Avraham
2016-01-24 15:09   ` Thomas Petazzoni
2016-01-24 15:33     ` Jonathan Ben Avraham
2016-01-24 15:38       ` Thomas Petazzoni
2016-01-24 15:47         ` Jonathan Ben Avraham
2016-01-24 14:55 ` [Buildroot] [PATCH v4 2/4] linux-pam: Enable NIS support if yp-tools selected Jonathan Ben-Avraham
2016-01-24 15:09   ` Thomas Petazzoni
2016-01-24 15:36     ` Jonathan Ben Avraham
2016-01-24 15:51       ` Thomas Petazzoni
2016-01-24 14:55 ` [Buildroot] [PATCH v4 3/4] yp-tools: new package Jonathan Ben-Avraham
2016-01-24 14:55 ` [Buildroot] [PATCH v4 4/4] ypbind-mt: " Jonathan Ben-Avraham

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.