Skip to contentSkip to conversation

libtool: Make libltdl a separate package

PATCH New Alexander Sverdlin 5 participants 25 messages Nov 11, 2018 – Nov 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtool: Make libltdl a separate package

This will save megabytes on the target filesystem if target packages only require libltdl part of libtool.

---
 package/Config.in                |  1 +
 package/libltdl/Config.in        | 10 ++++++++++
 package/libltdl/libltdl.hash     |  2 ++
 package/libltdl/libltdl.mk       | 18 ++++++++++++++++++
 package/libtool/libtool.mk       |  1 +
 package/pulseaudio/Config.in     |  2 +-
 package/pulseaudio/pulseaudio.mk |  2 +-
 7 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 package/libltdl/Config.in
 create mode 100644 package/libltdl/libltdl.hash
 create mode 100644 package/libltdl/libltdl.mk
package/Config.in +1 -0
index b60e7700ad..d136ab1f15 100644
@@ -1648,6 +1648,7 @@ menu "Other"
 	source "package/libite/Config.in"
 	source "package/liblinear/Config.in"
 	source "package/libloki/Config.in"
+	source "package/libltdl/Config.in"
 	source "package/libnpth/Config.in"
 	source "package/libnspr/Config.in"
 	source "package/libpfm4/Config.in"
package/libltdl/Config.in new file +10 -0
new file mode 100644
index 0000000000..e45dc5f15f
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_LIBLTDL
+	bool "libltdl"
+	help
+	  Library that hides the complexity of using shared/static
+	  libraries on different platforms behind a consistent, portable
+	  interface.
+
+	  This is only runtime part of libtool: libltdl.
+
+	  http://www.gnu.org/software/libtool/
package/libltdl/libltdl.hash new file +2 -0
new file mode 100644
index 0000000000..baaac61232
@@ -0,0 +1,2 @@
+# Locally calculated after checking pgp signature
+sha256	7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f	libtool-2.4.6.tar.xz
package/libltdl/libltdl.mk new file +18 -0
new file mode 100644
index 0000000000..6c9fc0bc49
@@ -0,0 +1,18 @@
+################################################################################
+#
+# libltdl
+#
+################################################################################
+
+# Same sources as libtool
+LIBLTDL_SOURCE = $(LIBTOOL_SOURCE)
+LIBLTDL_SITE = $(LIBTOOL_SITE)
+LIBLTDL_SUBDIR = libltdl
+LIBLTDL_INSTALL_STAGING = YES
+LIBLTDL_CONF_OPTS = --enable-ltdl-install
+LIBLTDL_DEPENDENCIES = host-m4
+LIBLTDL_LICENSE = LGPLv2.1
+LIBLTDL_LICENSE_FILES = $(LIBLTDL_SUBDIR)/COPYING.LIB
+LIBLTDL_PRE_CONFIGURE_HOOKS += LIBTOOL_AVOID_AUTORECONF_HOOK
+
+$(eval $(autotools-package))
package/libtool/libtool.mk +1 -0
index bf97ee12b5..b9d492d1b5 100644
@@ -9,6 +9,7 @@ LIBTOOL_SOURCE = libtool-$(LIBTOOL_VERSION).tar.xz
 LIBTOOL_SITE = $(BR2_GNU_MIRROR)/libtool
 LIBTOOL_INSTALL_STAGING = YES
 LIBTOOL_CONF_ENV = HELP2MAN=true
+LIBTOOL_CONF_OPTS = --disable-ltdl-install
 LIBTOOL_DEPENDENCIES = host-m4
 HOST_LIBTOOL_DEPENDENCIES = host-m4
 LIBTOOL_LICENSE = GPL-2.0+
package/pulseaudio/Config.in +1 -1
index 6600006a60..5fa0f67d2c 100644
@@ -14,7 +14,7 @@ config BR2_PACKAGE_PULSEAUDIO
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_USE_MMU # fork()
-	select BR2_PACKAGE_LIBTOOL
+	select BR2_PACKAGE_LIBLTDL
 	select BR2_PACKAGE_LIBSNDFILE
 	select BR2_PACKAGE_PULSEAUDIO_ENABLE_ATOMIC
 	select BR2_PACKAGE_SPEEX
package/pulseaudio/pulseaudio.mk +1 -1
index d1c35654cf..626f73309d 100644
@@ -16,7 +16,7 @@ PULSEAUDIO_CONF_OPTS = \
 	--disable-manpages
 
 PULSEAUDIO_DEPENDENCIES = \
-	host-pkgconf libtool libsndfile speex host-intltool \
+	host-pkgconf libltdl libsndfile speex host-intltool \
 	$(if $(BR2_PACKAGE_LIBGLIB2),libglib2) \
 	$(if $(BR2_PACKAGE_AVAHI_DAEMON),avahi) \
 	$(if $(BR2_PACKAGE_DBUS),dbus) \
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 Add syslinux installer host package

Add host installer for syslinux bootloader which allows to pre-install syslinux in the generated firmware images. BR2_ROOTFS_POST_IMAGE_SCRIPT can do something like this:

	${HOST_DIR}/usr/bin/syslinux -d /syslinux/ -i ${IMGFILE}

if the rest of syslinux is installed under /syslinux inside the firmware image.

---
 package/Config.in.host                    |  1 +
 package/syslinux-installer/Config.in.host |  7 +++++++
 package/syslinux-installer/syslinux.mk    | 25 +++++++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 package/syslinux-installer/Config.in.host
 create mode 100644 package/syslinux-installer/syslinux.mk
package/Config.in.host +1 -0
index 16b474fc9d..24a51d0e79 100644
@@ -59,6 +59,7 @@ menu "Host utilities"
 	source "package/squashfs/Config.in.host"
 	source "package/sunxi-tools/Config.in.host"
 	source "package/swig/Config.in.host"
+	source "package/syslinux-installer/Config.in.host"
 	source "package/tegrarcm/Config.in.host"
 	source "package/ti-cgt-pru/Config.in.host"
 	source "package/uboot-tools/Config.in.host"
package/syslinux-installer/Config.in.host new file +7 -0
new file mode 100644
index 0000000000..d82e7f00d7
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_HOST_SYSLINUX_INSTALLER
+	bool "host syslinux installer"
+	depends on BR2_TARGET_SYSLINUX
+	help
+	  Host installer for syslinux bootloader
+
+	  http://syslinux.org
package/syslinux-installer/syslinux.mk new file +25 -0
new file mode 100644
index 0000000000..cbcf49d47a
@@ -0,0 +1,25 @@
+################################################################################
+#
+# host syslinux installer
+#
+################################################################################
+
+SYSLINUX_INSTALLER_VERSION = $(SYSLINUX_VERSION)
+SYSLINUX_INSTALLER_SOURCE = $(SYSLINUX_SOURCE)
+SYSLINUX_INSTALLER_SITE = $(SYSLINUX_SITE)
+
+SYSLINUX_INSTALLER_LICENSE = $(SYSLINUX_LICENSE)
+SYSLINUX_INSTALLER_LICENSE_FILES = $(SYSLINUX_LICENSE_FILES)
+
+HOST_SYSLINUX_INSTALLER_DEPENDENCIES = syslinux
+
+define HOST_SYSLINUX_INSTALLER_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) \
+		-C $(@D) installer
+endef
+
+define HOST_SYSLINUX_INSTALLER_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bios/mtools/syslinux $(HOST_DIR)/usr/bin/syslinux
+endef
+
+$(eval $(host-generic-package))
Signature · 1 line
2.19.1
#2 lore raw

PATCH 1/1 Add syslinux installer host package

Hello,

Thanks for this contribution! I'm adding Carlos Santos, who also uses syslinux.

Quoted 6 lines · Alexander Sverdlin

Add host installer for syslinux bootloader which allows to pre-install syslinux in the generated firmware images. BR2_ROOTFS_POST_IMAGE_SCRIPT can do something like this:

	${HOST_DIR}/usr/bin/syslinux -d /syslinux/ -i ${IMGFILE}
Quoted 8 lines

if the rest of syslinux is installed under /syslinux inside the firmware image.

---
 package/Config.in.host                    |  1 +
 package/syslinux-installer/Config.in.host |  7 +++++++
 package/syslinux-installer/syslinux.mk    | 25 +++++++++++++++++++++++

Instead of making a separate package for this, what about adding a host variant of the existing syslinux package ?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/1 Add syslinux installer host package

Quoted 21 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Alexander Sverdlin" <[email protected]>
Cc: "buildroot" <[email protected]>, "Carlos Santos" <[email protected]>
Sent: Domingo, 11 de novembro de 2018 18:33:16
Subject: Re: [Buildroot] [PATCH] Add syslinux installer host package

Hello,

Thanks for this contribution! I'm adding Carlos Santos, who also uses syslinux.

Quoted 9 lines · Alexander Sverdlin

Add host installer for syslinux bootloader which allows to pre-install syslinux in the generated firmware images. BR2_ROOTFS_POST_IMAGE_SCRIPT can do something like this:

	${HOST_DIR}/usr/bin/syslinux -d /syslinux/ -i ${IMGFILE}

if the rest of syslinux is installed under /syslinux inside the firmware image.

Quoted 8 lines
Quoted 5 lines
---
 package/Config.in.host                    |  1 +
 package/syslinux-installer/Config.in.host |  7 +++++++
 package/syslinux-installer/syslinux.mk    | 25 +++++++++++++++++++++++

Instead of making a separate package for this, what about adding a host variant of the existing syslinux package ?

host-sylinux makes sense. The package would not build syslinux for the host, just the installer, but this would not be a real problem, since host packages are meant to be tools used to generate the target system.

Signature · 3 lines
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.? ? Epitaph of a volunteer
#4 lore raw

PATCH 1/1 linux-tools: Add liblockdep

In reply to Alexander Sverdlin
---
 package/linux-tools/Config.in                | 13 ++++++++
 package/linux-tools/linux-tool-liblockdep.mk | 34 ++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 package/linux-tools/linux-tool-liblockdep.mk
package/linux-tools/Config.in +13 -0
index 349dc6bf0d..63b48cfa80 100644
@@ -34,6 +34,19 @@ config BR2_PACKAGE_LINUX_TOOLS_IIO
 
 	  These tools are available only from kernel version 4.7.
 
+config BR2_PACKAGE_LINUX_TOOLS_LIBLOCKDEP
+	bool "liblockdep"
+	help
+	  liblockdep is a tiny wrapper built around kernel/lockdep.c.
+	  The aim is to provide the same functionality the kernel gets
+	  from lockdep to userspace.
+
+	  The bulk of the code here is the LD_PRELOAD support which
+	  provides users an easy way to test their code without having
+	  to integrate liblockdep into said code.
+
+	  http://lwn.net/Articles/536363/
+
 config BR2_PACKAGE_LINUX_TOOLS_PERF
 	bool "perf"
 	select BR2_PACKAGE_LINUX_TOOLS
package/linux-tools/linux-tool-liblockdep.mk new file +34 -0
new file mode 100644
index 0000000000..63c6fa3500
@@ -0,0 +1,34 @@
+################################################################################
+#
+# liblockdep
+#
+################################################################################
+
+LINUX_TOOLS += liblockdep
+
+LIBLOCKDEP_MAKE_FLAGS = \
+	$(LINUX_MAKE_FLAGS) \
+	prefix=/usr
+
+define LIBLOCKDEP_BUILD_CMDS
+	$(Q)if test ! -f $(@D)/tools/lib/lockdep/Makefile ; then \
+		echo "Your kernel version is too old and does not have the liblockdep." ; \
+		echo "At least kernel 4.1 must be used." ; \
+		exit 1 ; \
+	fi
+
+	$(TARGET_MAKE_ENV) $(MAKE) $(LIBLOCKDEP_MAKE_FLAGS) -C $(@D)/tools \
+		liblockdep
+endef
+
+define LIBLOCKDEP_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(LIBLOCKDEP_MAKE_FLAGS) -C $(@D)/tools \
+		DESTDIR=$(STAGING_DIR) \
+		liblockdep_install
+endef
+
+define LIBLOCKDEP_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(LIBLOCKDEP_MAKE_FLAGS) -C $(@D)/tools \
+		DESTDIR=$(TARGET_DIR) \
+		liblockdep_install
+endef
Signature · 1 line
2.19.1
#5 lore raw

PATCH 1/1 linux-tools: Add liblockdep

Hello,

Thanks for this patch, unfortunately, I encountered a number of issues while testing it, and I have some review comments. See below.

Quoted 4 lines · Alexander Sverdlin
---
 package/linux-tools/Config.in                | 13 ++++++++
 package/linux-tools/linux-tool-liblockdep.mk | 34 ++++++++++++++++++++

This file should be named linux-tool-liblockdep.mk.in, to follow the pattern of other files in the same folder.

Quoted 1 line

+config BR2_PACKAGE_LINUX_TOOLS_LIBLOCKDEP

You need a:

	# <execinfo.h>
	depends on BR2_TOOLCHAIN_USES_GLIBC

because the liblockdep source code uses <execinfo.h>, which is only provided by glibc.

Also, you forgot:

select BR2_PACKAGE_LINUX_TOOLS

and therefore if only liblockdep is selected in linux-tools, the linux-tools package is not built at all.

package/linux-tools/Config.in config BR2_PACKAGE_LINUX_TOOLS_IIO · line 48

Quoted 11 lines
package/linux-tools/Config.in +11 -0
+	bool "liblockdep"
+	help
+	  liblockdep is a tiny wrapper built around kernel/lockdep.c.
+	  The aim is to provide the same functionality the kernel gets
+	  from lockdep to userspace.
+
+	  The bulk of the code here is the LD_PRELOAD support which
+	  provides users an easy way to test their code without having
+	  to integrate liblockdep into said code.
+
+	  http://lwn.net/Articles/536363/

And therefore, you need:

comment "liblockdep needs a toolchain w/ glibc"
depends on !BR2_TOOLCHAIN_USES_GLIBC

Quoted 1 line

+LIBLOCKDEP_MAKE_FLAGS = \

We are not very consistent between the different .mk.in files, but I think I'd prefer to see this variable named LIBLOCKDEP_MAKE_OPTS.

package/linux-tools/linux-tool-liblockdep.mk line 14

Quoted 2 lines
package/linux-tools/linux-tool-liblockdep.mk new file +2 -0
+define LIBLOCKDEP_BUILD_CMDS
+	$(Q)if test ! -f $(@D)/tools/lib/lockdep/Makefile ; then \

It clearly doesn't work with $(@D) here, you need to use $(LINUX_DIR) everywhere.

But even with this fixed, I get:

CC lockdep.o
In file included from lockdep.c:8:0:
../../../kernel/locking/lockdep.c:49:10: fatal error: linux/jhash.h: No such file or directory

 #include <linux/jhash.h>
          ^~~~~~~~~~~~~~~

compilation terminated.
mv: cannot stat './.lockdep.o.tmp': No such file or directory

When building with Linux 4.9.

Could you have a look at those issues, and send an updated version ?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH 1/1 Add mini-snmpd package

In reply to Alexander Sverdlin

Mini SNMPd is a minimal implementation targeted at small or embedded UNIX systems with limited resources.

---

Note:
check-package issues "Signed-off-by" warnings on the .patch files, but that's how they present in the original repository.

 package/Config.in                             |  1 +
 ...d-zero-byte-before-unsigned-integers.patch | 29 +++++++++++++++++++
 ...igned-integers-to-have-an-extra-byte.patch | 26 +++++++++++++++++
 package/mini-snmpd/Config.in                  |  7 +++++
 package/mini-snmpd/mini-snmpd.mk              | 21 ++++++++++++++
 package/mini-snmpd/mini-snmpd.service         | 12 ++++++++
 6 files changed, 96 insertions(+)
 create mode 100644 package/mini-snmpd/0001-Prepend-zero-byte-before-unsigned-integers.patch
 create mode 100644 package/mini-snmpd/0002-mib.c-allow-unsigned-integers-to-have-an-extra-byte.patch
 create mode 100644 package/mini-snmpd/Config.in
 create mode 100644 package/mini-snmpd/mini-snmpd.mk
 create mode 100644 package/mini-snmpd/mini-snmpd.service
package/Config.in +1 -0
index d136ab1f15..c9450cd033 100644
@@ -1886,6 +1886,7 @@ menu "Networking applications"
 	source "package/macchanger/Config.in"
 	source "package/memcached/Config.in"
 	source "package/mii-diag/Config.in"
+	source "package/mini-snmpd/Config.in"
 	source "package/minidlna/Config.in"
 	source "package/minissdpd/Config.in"
 	source "package/mjpg-streamer/Config.in"
package/mini-snmpd/0001-Prepend-zero-byte-before-unsigned-integers.patch new file +29 -0
new file mode 100644
index 0000000000..990d5bb9b7
@@ -0,0 +1,29 @@
+From 949ae648bf7c654b8fae607a0988bfa672607156 Mon Sep 17 00:00:00 2001
+From: Patrick Rauscher <[email protected]>
+Date: Fri, 18 Aug 2017 17:31:23 +0200
+Subject: [PATCH] Prepend zero-byte before unsigned integers
+
+fixes #8
+---
+ mib.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/mib.c b/mib.c
+index 7d2e513..a9ffbe2 100644
+--- a/mib.c
++++ b/mib.c
+@@ -207,6 +207,11 @@ static int encode_unsigned(data_t *data, int type, unsigned int ticks_value)
+ 	else
+ 		length = 1;
+ 
++	/* check if the integer could be interpreted negative during a signed decode and prepend a zero-byte if necessary */
++	if ((ticks_value >> (8 * (length - 1))) & 0x80) {
++		length++;
++	}
++
+ 	*buffer++ = type;
+ 	*buffer++ = length;
+ 	while (length--)
+-- 
+2.13.2
+
package/mini-snmpd/0002-mib.c-allow-unsigned-integers-to-have-an-extra-byte.patch new file +26 -0
new file mode 100644
index 0000000000..d1b18050a5
@@ -0,0 +1,26 @@
+From 556c8a406c9e08dd9444222e072f7eb9c82a81e8 Mon Sep 17 00:00:00 2001
+From: Patrick Rauscher <[email protected]>
+Date: Fri, 18 Aug 2017 17:44:32 +0200
+Subject: [PATCH] mib.c: allow unsigned integers to have an extra byte
+
+The extra byte can be needed when encoding huge unsigned numbers (i.e. 0x80000000 or higher). In this case, during encoding we need an extra byte to make sure clients decoding as signed int do not get negative numbers. For further details, see commit 949ae648
+---
+ mib.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mib.c b/mib.c
+index a9ffbe2..83cc20d 100644
+--- a/mib.c
++++ b/mib.c
+@@ -372,7 +372,7 @@ static int data_alloc(data_t *data, int type)
+ 		case BER_TYPE_COUNTER:
+ 		case BER_TYPE_GAUGE:
+ 		case BER_TYPE_TIME_TICKS:
+-			data->max_length = sizeof(unsigned int) + 2;
++			data->max_length = sizeof(unsigned int) + 3;
+ 			data->encoded_length = 0;
+ 			data->buffer = allocate(data->max_length);
+ 			break;
+-- 
+2.13.2
+
package/mini-snmpd/Config.in new file +7 -0
new file mode 100644
index 0000000000..1f61cddbcf
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_MINI_SNMPD
+	bool "mini-snmpd"
+	help
+	  Mini SNMPd is a minimal implementation targeted at small or
+	  embedded UNIX systems with limited resources
+
+	  http://troglobit.com/mini-snmpd.html
package/mini-snmpd/mini-snmpd.mk new file +21 -0
new file mode 100644
index 0000000000..ebcbcce1ce
@@ -0,0 +1,21 @@
+################################################################################
+#
+# mini-snmpd
+#
+################################################################################
+
+MINI_SNMPD_VERSION = v1.4
+MINI_SNMPD_SITE = $(call github,troglobit,mini-snmpd,$(MINI_SNMPD_VERSION))
+MINI_SNMPD_LICENSE = GPL-2.0
+MINI_SNMPD_LICENSE_FILES = COPYING
+MINI_SNMPD_AUTORECONF = YES
+
+define MINI_SNMPD_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/mini-snmpd/mini-snmpd.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/mini-snmpd.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -sf ../../../../usr/lib/systemd/system/mini-snmpd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mini-snmpd.service
+endef
+
+$(eval $(autotools-package))
package/mini-snmpd/mini-snmpd.service new file +12 -0
new file mode 100644
index 0000000000..8a15585e6e
@@ -0,0 +1,12 @@
+[Unit]
+Description=Mini SNMP Daemon
+StartLimitIntervalSec=0
+
+[Service]
+Environment='COMMUNITY=public'
+ExecStart=/sbin/mini_snmpd -a -n -c ${COMMUNITY} $EXTRA_PARAMS
+Restart=always
+RestartSec=1
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.19.1
#7 lore raw

PATCH 1/1 Add mini-snmpd package

Hello,

Thanks for this contribution! It looks mostly good, I really only have some minor comments, see below.

The first nit is that the commit title should be:

package/mini-snmpd: new package

Quoted 9 lines · Alexander Sverdlin

Mini SNMPd is a minimal implementation targeted at small or embedded UNIX systems with limited resources.

---

Note:
check-package issues "Signed-off-by" warnings on the .patch files, but that's how they present in the original repository.

Still, we need *your* SoB added to the patches, so that's why check-package complains: there should always be at least one SoB in the patches, the one of the person who added the patch into Buildroot.

Quoted 8 lines
 package/Config.in                             |  1 +
 ...d-zero-byte-before-unsigned-integers.patch | 29 +++++++++++++++++++
 ...igned-integers-to-have-an-extra-byte.patch | 26 +++++++++++++++++
 package/mini-snmpd/Config.in                  |  7 +++++
 package/mini-snmpd/mini-snmpd.mk              | 21 ++++++++++++++
 package/mini-snmpd/mini-snmpd.service         | 12 ++++++++
 6 files changed, 96 insertions(+)

Please add an entry to the DEVELOPERS file.

package/mini-snmpd/0001-Prepend-zero-byte-before-unsigned-integers.patch line 6

Quoted 12 lines
package/mini-snmpd/0001-Prepend-zero-byte-before-unsigned-integers.patch new file +6 -0
new file mode 100644
index 0000000000..990d5bb9b7
@@ -0,0 +1,29 @@
+From 949ae648bf7c654b8fae607a0988bfa672607156 Mon Sep 17 00:00:00 2001
+From: Patrick Rauscher <[email protected]>
+Date: Fri, 18 Aug 2017 17:31:23 +0200
+Subject: [PATCH] Prepend zero-byte before unsigned integers
+
+fixes #8

We need your SoB here.

package/mini-snmpd/0002-mib.c-allow-unsigned-integers-to-have-an-extra-byte.patch line 6

Quoted 12 lines
package/mini-snmpd/0002-mib.c-allow-unsigned-integers-to-have-an-extra-byte.patch new file +6 -0
new file mode 100644
index 0000000000..d1b18050a5
@@ -0,0 +1,26 @@
+From 556c8a406c9e08dd9444222e072f7eb9c82a81e8 Mon Sep 17 00:00:00 2001
+From: Patrick Rauscher <[email protected]>
+Date: Fri, 18 Aug 2017 17:44:32 +0200
+Subject: [PATCH] mib.c: allow unsigned integers to have an extra byte
+
+The extra byte can be needed when encoding huge unsigned numbers (i.e. 0x80000000 or higher). In this case, during encoding we need an extra byte to make sure clients decoding as signed int do not get negative numbers. For further details, see commit 949ae648

And here.

package/mini-snmpd/Config.in line 7

Quoted 13 lines
package/mini-snmpd/Config.in new file +7 -0
new file mode 100644
index 0000000000..1f61cddbcf
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_MINI_SNMPD
+	bool "mini-snmpd"
+	help
+	  Mini SNMPd is a minimal implementation targeted at small or
+	  embedded UNIX systems with limited resources
+
+	  http://troglobit.com/mini-snmpd.html

Just curious, did you test the build of this package with ./utils/test-pkg ? It would be useful to do so.

Quoted 7 lines
package/mini-snmpd/mini-snmpd.mk new file +1 -0
new file mode 100644
index 0000000000..ebcbcce1ce
@@ -0,0 +1,21 @@
+################################################################################

package/mini-snmpd/mini-snmpd.mk line 11

Quoted 10 lines
package/mini-snmpd/mini-snmpd.mk new file +10 -0
+#
+# mini-snmpd
+#
+################################################################################
+
+MINI_SNMPD_VERSION = v1.4
+MINI_SNMPD_SITE = $(call github,troglobit,mini-snmpd,$(MINI_SNMPD_VERSION))
+MINI_SNMPD_LICENSE = GPL-2.0
+MINI_SNMPD_LICENSE_FILES = COPYING
+MINI_SNMPD_AUTORECONF = YES

mini-snmpd has an optional dependency on libconfuse, when --with-config is passed, or by default. So, you should either pass --without-config and not bother with this dependency, or handle it explicitly with something like this:

ifeq ($(BR2_PACKAGE_LIBCONFUSE),y) MINI_SNMPD_DEPENDENCIES += host-pkgconf libconfuse MINI_SNMPD_CONF_OPTS += --with-config
else
MINI_SNMPD_CONF_OPTS += --without-config endif

Could you fix those various small details and send an updated version?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

PATCH 1/1 Add mini-snmpd package

Hello Thomas,

Quoted 11 lines · Thomas Petazzoni

mini-snmpd has an optional dependency on libconfuse, when --with-config is passed, or by default. So, you should either pass --without-config and not bother with this dependency, or handle it explicitly with something like this:

ifeq ($(BR2_PACKAGE_LIBCONFUSE),y) MINI_SNMPD_DEPENDENCIES += host-pkgconf libconfuse MINI_SNMPD_CONF_OPTS += --with-config
else
MINI_SNMPD_CONF_OPTS += --without-config endif

I believe, we can ignore this for now until the new feature with config file is released. Current latest release package (1.4) doesn't have such an option.

But thanks for heads-up, one updating the version should not forget to add the above handling.

--
Alex.

#9 lore raw

PATCH 1/1 acpid: Add systemd service

In reply to Alexander Sverdlin

This one is based on Archlinux's service file.

---
 package/acpid/acpid.mk      | 8 ++++++++
 package/acpid/acpid.service | 9 +++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 package/acpid/acpid.service
package/acpid/acpid.mk +8 -0
index 48fe005e5e..c5ed3bfbeb 100644
@@ -10,6 +10,14 @@ ACPID_SITE = http://downloads.sourceforge.net/project/acpid2
 ACPID_LICENSE = GPL-2.0+
 ACPID_LICENSE_FILES = COPYING
 
+define ACPID_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0755 package/acpid/acpid.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/acpid.service
+	mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants
+	ln -sf /usr/lib/systemd/system/acpid.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/acpid.service
+endef
+
 define ACPID_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 0755 package/acpid/S02acpid \
 		$(TARGET_DIR)/etc/init.d/S02acpid
package/acpid/acpid.service new file +9 -0
new file mode 100644
index 0000000000..5252b52f5f
@@ -0,0 +1,9 @@
+[Unit]
+Description=ACPI event daemon
+Documentation=man:acpid(8)
+
+[Service]
+ExecStart=/usr/sbin/acpid --foreground --netlink
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.19.1
#10 lore raw

PATCH 1/1 acpid: Add systemd service

Hello Alexander,

Thanks for this contribution!

package/acpid/acpid.mk ACPID_SITE = http://downloads.sourceforge.net/project/acpid2 · line 18

Quoted 6 lines · Alexander Sverdlin
package/acpid/acpid.mk +6 -0
+define ACPID_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0755 package/acpid/acpid.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/acpid.service
+	mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants
+	ln -sf /usr/lib/systemd/system/acpid.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/acpid.service

We normally create the link under /etc, and use a relative path for the target of the symlink, i.e like this:

define DHCPCD_INSTALL_INIT_SYSTEMD

        $(INSTALL) -D -m 0644 package/dhcpcd/dhcpcd.service \
                $(TARGET_DIR)/usr/lib/systemd/system/dhcpcd.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
        ln -sf ../../../../usr/lib/systemd/system/dhcpcd.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpcd.service

endef

Could you adjust your patch accordingly ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#11 lore raw

PATCH 1/1 acpid: Make bundled event files optional

In reply to Alexander Sverdlin

On one hand the preinstalled /etc/acpi/events/powerbtn is not part of acpid, one other hand others might want to implement more complicated logic on power button. Therefore, make it optional.

---
 package/acpid/Config.in | 10 ++++++++++
 package/acpid/acpid.mk  |  2 ++
 2 files changed, 12 insertions(+)
package/acpid/Config.in +10 -0
index 0c8ecf2473..f6fb0ae1fc 100644
@@ -9,3 +9,13 @@ config BR2_PACKAGE_ACPID
 	  specific events.
 
 	  http://sourceforge.net/projects/acpid2/
+
+if BR2_PACKAGE_ACPID
+
+config BR2_PACKAGE_ACPID_SUPPLEMENTARY
+	bool "Supplementary event handlers"
+	default y
+	help
+	  Install additional event handlers such as power button handler
+
+endif
package/acpid/acpid.mk +2 -0
index c5ed3bfbeb..21bed5c220 100644
@@ -35,6 +35,8 @@ define ACPID_SET_EVENTS
 		>$(TARGET_DIR)/etc/acpi/events/powerbtn
 endef
 
+ifeq ($(BR2_PACKAGE_ACPID_SUPPLEMENTARY),y)
 ACPID_POST_INSTALL_TARGET_HOOKS += ACPID_SET_EVENTS
+endif
 
 $(eval $(autotools-package))
Signature · 1 line
2.19.1
#12 lore raw

PATCH 1/1 acpid: Make bundled event files optional

Hello Alexander,

Adding in Cc: Carlos Santos, who recently tweakedthe powerbtn script logic.

Quoted 5 lines · Alexander Sverdlin

On one hand the preinstalled /etc/acpi/events/powerbtn is not part of acpid, one other hand others might want to implement more complicated logic on power button. Therefore, make it optional.

On the other hand, it makes quite a bit of sense to have some kind of default/minimal behavior for this, which can easily be overridden in a post-build script / root filesystem overlay.

To me, this is a little bit like "let's make the installation of the OpenSSH server configuration file optional, because the default doesn't suite me".

package/acpid/Config.in config BR2_PACKAGE_ACPID · line 15

Quoted 3 lines
package/acpid/Config.in +3 -0
+if BR2_PACKAGE_ACPID
+
+config BR2_PACKAGE_ACPID_SUPPLEMENTARY

If anything, the name of the option should be revisited, because "supplementary" is quite vague.

But overall, I'm not really convinced that we need to change anything here, I believe the current behavior is OK.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#13 lore raw

PATCH 1/1 acpid: Make bundled event files optional

----- Original Message -----

Quoted 16 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Alexander Sverdlin" <[email protected]>
Cc: "buildroot" <[email protected]>, "DATACOM" <[email protected]>
Sent: Domingo, 11 de novembro de 2018 18:50:16
Subject: Re: [Buildroot] [PATCH] acpid: Make bundled event files optional

Hello Alexander,

Adding in Cc: Carlos Santos, who recently tweakedthe powerbtn script logic.

Quoted 4 lines · Alexander Sverdlin

On one hand the preinstalled /etc/acpi/events/powerbtn is not part of acpid, one other hand others might want to implement more complicated logic on power button. Therefore, make it optional.

Quoted 5 lines
Quoted 1 line

On the other hand, it makes quite a bit of sense to have some kind of default/minimal behavior for this, which can easily be overridden in a post-build script / root filesystem overlay.

Exactly.

Quoted 11 lines

To me, this is a little bit like "let's make the installation of the OpenSSH server configuration file optional, because the default doesn't suite me".

package/acpid/Config.in config BR2_PACKAGE_ACPID · line 15

Quoted 3 lines
package/acpid/Config.in +3 -0
+if BR2_PACKAGE_ACPID
+
+config BR2_PACKAGE_ACPID_SUPPLEMENTARY

If anything, the name of the option should be revisited, because "supplementary" is quite vague.

Quoted 2 lines

But overall, I'm not really convinced that we need to change anything here, I believe the current behavior is OK.

I'm not 100% against this change because it makes the installation of the powerbtn script optional but leaves the option chosen by default, so it does not change the current behavior.

Power button handling, however, is a very basic behavior that I'm a bit afraid of making optional.

Signature · 3 lines
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.? ? Epitaph of a volunteer
#14 lore raw

PATCH 1/1 systemd: Explicitly configure split-usr=false and split-bin=true

In reply to Alexander Sverdlin

bison-based build of systemd runs couple of checks on the structure of the *host* system which will incorrectly configure systemd if build host configuration doesn't match Buildroot target.

One can also find the following in the NEWS file:

* A new -Dsplit-bin= build configuration switch may be used to specify whether bin and sbin directories are merged, or if they should be included separately in $PATH and various listings of executable directories. The build configuration scripts will try to autodetect the proper values of -Dsplit-usr= and -Dsplit-bin= based on build system, but distributions are encouraged to configure this explicitly.

---
 package/systemd/systemd.mk | 2 ++
 1 file changed, 2 insertions(+)
package/systemd/systemd.mk +2 -0
index 4813496670..ecbf7e97ff 100644
@@ -29,6 +29,8 @@ SYSTEMD_CONF_OPTS += \
 	-Dldconfig=false \
 	-Ddefault-dnssec=no \
 	-Dtests=false \
+	-Dsplit-bin=true \
+	-Dsplit-usr=false \
 	-Dsystem-uid-max=999 \
 	-Dsystem-gid-max=999 \
 	-Dtelinit-path=$(TARGET_DIR)/sbin/telinit \
Signature · 1 line
2.19.1
#15 lore raw

PATCH 1/1 systemd: Explicitly configure split-usr=false and split-bin=true

Alexander, All,

On 2018-11-11 16:06 +0100, Alexander Sverdlin spake thusly:

Quoted 14 lines

bison-based build of systemd runs couple of checks on the structure of the *host* system which will incorrectly configure systemd if build host configuration doesn't match Buildroot target.

One can also find the following in the NEWS file:

* A new -Dsplit-bin= build configuration switch may be used to specify whether bin and sbin directories are merged, or if they should be included separately in $PATH and various listings of executable directories. The build configuration scripts will try to autodetect the proper values of -Dsplit-usr= and -Dsplit-bin= based on build system, but distributions are encouraged to configure this explicitly.

Quoted 1 line

Regards,
Yann E. MORIN.

Quoted 20 lines
---
 package/systemd/systemd.mk | 2 ++
 1 file changed, 2 insertions(+)
package/systemd/systemd.mk +2 -0
index 4813496670..ecbf7e97ff 100644
@@ -29,6 +29,8 @@ SYSTEMD_CONF_OPTS += \
 	-Dldconfig=false \
 	-Ddefault-dnssec=no \
 	-Dtests=false \
+	-Dsplit-bin=true \
+	-Dsplit-usr=false \
 	-Dsystem-uid-max=999 \
 	-Dsystem-gid-max=999 \
 	-Dtelinit-path=$(TARGET_DIR)/sbin/telinit \
Signature · 1 line
2.19.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#16 lore raw

PATCH 1/1 systemd: Explicitly configure split-usr=false and split-bin=true

In reply to Alexander Sverdlin

Hello,

Quoted 1 line · Alexander Sverdlin

bison-based build of systemd runs couple of checks on the structure of the

I assume you wanted to say "meson-based build" and not "bison-based build". I've fixed that and applied to master. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#17 lore raw

PATCH 1/1 systemd: Explicitly configure split-usr=false and split-bin=true

Hello!

Quoted 2 lines · Thomas Petazzoni
Quoted 1 line

bison-based build of systemd runs couple of checks on the structure of the

I assume you wanted to say "meson-based build" and not "bison-based

Exactly, thanks!

Quoted 1 line

build". I've fixed that and applied to master. Thanks!

--
Alexander.

#18 lore raw

PATCH 1/1 systemd: Explicitly configure split-usr=false and split-bin=true

In reply to Thomas Petazzoni

Thomas, All,

On 2018-11-11 21:55 +0100, Thomas Petazzoni spake thusly:

Quoted 4 lines · Alexander Sverdlin
Quoted 1 line

bison-based build of systemd runs couple of checks on the structure of the

I assume you wanted to say "meson-based build" and not "bison-based build". I've fixed that and applied to master. Thanks!

I acked the patch becasue I read 'bison', but I saw 'meson', as it was so obvious...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#19 lore raw

PATCH 1/1 systemd: Explicitly configure split-usr=false and split-bin=true

In reply to Thomas Petazzoni

Hello Thomas,

Quoted 3 lines · Thomas Petazzoni
Quoted 1 line

bison-based build of systemd runs couple of checks on the structure of the

I assume you wanted to say "meson-based build" and not "bison-based build". I've fixed that and applied to master. Thanks!

this commit BTW fixes 7684637bf6 ("systemd: bump to v239") (broken PATH env passed to all services started by systemd), so it can go to 2018.08.x...

--
Best regards,
Alexander.

#20 lore raw

PATCH 1/1 libtool: Make libltdl a separate package

In reply to Alexander Sverdlin

Hello,

Quoted 4 lines · Alexander Sverdlin

This will save megabytes on the target filesystem if target packages only require libltdl part of libtool.

Thanks for this patch!

In fact, I don't think we need the full libtool on the target at all, so perhaps we should just change the existing libtool package in its target variant to only install libltdl ?

I see the following packages that have a dependency on target libtool:

- clamav
- nut
- pulseaudio
- unixodbc

and all of them seem to have this dependency solely for libltdl.

Peter, Yann, Arnout, thoughts ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#21 lore raw

PATCH 1/1 libtool: Make libltdl a separate package

Quoted 16 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Alexander Sverdlin

This will save megabytes on the target filesystem if target packages only require libltdl part of libtool.

Thanks for this patch!

In fact, I don't think we need the full libtool on the target at all, so perhaps we should just change the existing libtool package in its target variant to only install libltdl ?

I see the following packages that have a dependency on target libtool:

Quoted 8 lines

- clamav
- nut
- pulseaudio
- unixodbc

and all of them seem to have this dependency solely for libltdl.

Peter, Yann, Arnout, thoughts ?

I agree. If anybody needs the rest of libtool, then we can add an option like
BR2_PACKAGE_LIBTOOL_FULL or _TOOLS or something like that, similar to e.g. libcurl (where BTW curl was originally a separate package but we merged it).

Regards,
Arnout

#22 lore raw

PATCH 1/1 libtool: Make libltdl a separate package

Thomas, Alexander, Arnout, All,

On 2018-11-11 23:15 +0100, Arnout Vandecappelle spake thusly:

Quoted 7 lines · Thomas Petazzoni
Quoted 6 lines · Alexander Sverdlin
Quoted 2 lines

This will save megabytes on the target filesystem if target packages only require libltdl part of libtool.

In fact, I don't think we need the full libtool on the target at all, so perhaps we should just change the existing libtool package in its target variant to only install libltdl ?

[--SNIP--]

Quoted 2 lines

I agree. If anybody needs the rest of libtool, then we can add an option like
BR2_PACKAGE_LIBTOOL_FULL or _TOOLS or something like that,

Agreed.

Quoted 2 lines

similar to e.g.
libcurl (where BTW curl was originally a separate package but we merged it).

Exceot that, because of that legacy, curl is a bad example, as the option is badly named.

A better exaple would be libcap (_TOOLS) or gnutls (_UTILS).

I would favour the _TOOLS suffix, even though we have both in tree.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#23 lore raw

PATCH 1/1 libtool: Make libltdl a separate package

Hello Yann, Arnout, Thomas,

Quoted 13 lines · Yann E. MORIN

On 2018-11-11 23:15 +0100, Arnout Vandecappelle spake thusly:

Quoted 7 lines · Thomas Petazzoni
Quoted 6 lines · Alexander Sverdlin
Quoted 2 lines

This will save megabytes on the target filesystem if target packages only require libltdl part of libtool.

In fact, I don't think we need the full libtool on the target at all, so perhaps we should just change the existing libtool package in its target variant to only install libltdl ?

[--SNIP--]

Quoted 2 lines

I agree. If anybody needs the rest of libtool, then we can add an option like
BR2_PACKAGE_LIBTOOL_FULL or _TOOLS or something like that,

Agreed.

Quoted 8 lines
Quoted 2 lines

similar to e.g.
libcurl (where BTW curl was originally a separate package but we merged it).

Exceot that, because of that legacy, curl is a bad example, as the option is badly named.

A better exaple would be libcap (_TOOLS) or gnutls (_UTILS).

I would favour the _TOOLS suffix, even though we have both in tree.

But it seems that HOST_LIBTOOL package is widely used and it would look awkward for me if we would build completely different stuff for LIBTOOL and HOST_LIBTOOL package variants.

I'd rather go with LIBTOOL_RUNTIME package (or indeed LIBLTDL?), I can merge it into libtool.mk and make all 4 target packages depend on it instead of full libtool.

What are your thoughts?

--
Alexander.

#24 lore raw

PATCH 1/1 libtool: Make libltdl a separate package

Hello Alexander,

Quoted 3 lines · Alexander Sverdlin

But it seems that HOST_LIBTOOL package is widely used and it would look awkward for me if we would build completely different stuff for LIBTOOL and HOST_LIBTOOL package variants.

We already do that for a few packages, where the host and target variant don't install the same stuff. libglib2 is an example that comes to mind for example, but there are others.

Quoted 4 lines

I'd rather go with LIBTOOL_RUNTIME package (or indeed LIBLTDL?), I can merge it into libtool.mk and make all 4 target packages depend on it instead of full libtool.

What are your thoughts?

I think we really want what we suggested initially, i.e the target libtool package only install libltdl.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com