All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 00/15] use host-systemd to enable units
@ 2019-11-03 16:56 Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 01/15] new recipe : host-systemd Jérémy Rosen
                   ` (14 more replies)
  0 siblings, 15 replies; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot


As discussed during the buildroot dev days, upstream systemd now relies
on systemctl to enable units at install time.

The patch bumping systemd to v243 in buildroot did add the logic to
handle that through Makefiles.

This patch adds support for compiling host-systemd and using it to
enable all units.

* 0001-new-recipe-host-systemd.patch
I might have missed some build-dependencies. Please review carefully

* 0002-use-host-systemctl-preset-all-to-enable-units.patch
Use the previous patch to simplify the systemd recipe

* 0003-fix-tty-handling.patch
TTY handling is tricky. Separate it in its own patch

Everything else deals with updating the packages

0004-fix-trivial-packages-with-buildroot-provided-service.patch
0005-fix-trivial-cases-upstream-provided-services.patch
0006-package-avahi-adapt-to-preset-all.patch
0007-package-connman-adapt-to-preset-all.patch
0008-package-dante-adapt-to-preset-all.patch
0009-package-linuxptp-adapt-to-preset-all.patch
0010-package-docker-engine-adapt-to-preset-all.patch
0011-package-network-manager-adapt-to-preset-all.patch
0012-package-wpa_supplicant-adapt-for-preset-all.patch
0013-package-sysklogd-adapt-to-preset-all.patch
0014-package-targetcli-fb-adapt-to-preset-all.patch
0015-package-tor-adapt-to-preset-all.patch

J?r?my Rosen (15):
  new recipe : host-systemd
  use host-systemctl preset all to enable units
  fix tty handling
  fix trivial packages with buildroot-provided services
  fix trivial cases, upstream-provided services
  package/avahi: adapt to preset-all
  package/connman: adapt to preset-all
  package/dante: adapt to preset-all
  package/linuxptp adapt to preset-all
  package/docker-engine: adapt to preset-all
  package/network-manager: adapt to preset-all
  package/wpa_supplicant: adapt for preset-all
  package/sysklogd: adapt to preset-all
  package/targetcli-fb: adapt to preset-all
  package/tor: adapt to preset-all

 package/Config.in.host                        |   1 +
 package/acpid/acpid.mk                        |   3 -
 package/apache/apache.mk                      |   3 -
 package/audit/audit.mk                        |   4 -
 package/avahi/50-avahi.preset                 |   3 +
 package/avahi/avahi.mk                        |  10 +-
 package/babeld/babeld.mk                      |   5 -
 package/bandwidthd/bandwidthd.mk              |   5 -
 package/bind/bind.mk                          |   5 -
 package/bluez5_utils/bluez5_utils.mk          |   8 -
 package/boinc/boinc.mk                        |   5 -
 package/brltty/brltty.mk                      |   4 -
 package/chrony/chrony.mk                      |   3 -
 package/collectd/collectd.mk                  |   3 -
 package/connman/connman.mk                    |   6 -
 package/dante/50-dante.preset                 |   1 +
 package/dante/dante.mk                        |   2 +
 package/darkhttpd/darkhttpd.mk                |   3 -
 package/dcron/dcron.mk                        |   3 -
 package/dhcp/dhcp.mk                          |   5 -
 package/dhcpcd/dhcpcd.mk                      |   3 -
 package/docker-engine/50-docker-engine.preset |   1 +
 package/docker-engine/docker-engine.mk        |   5 +-
 package/domoticz/domoticz.mk                  |   3 -
 package/dropbear/dropbear.mk                  |   3 -
 package/exim/exim.mk                          |   3 -
 package/fail2ban/fail2ban.mk                  |   3 -
 package/freescale-imx/imx-uuc/imx-uuc.mk      |   3 -
 package/gerbera/gerbera.mk                    |   6 -
 package/haveged/haveged.mk                    |   3 -
 package/i2pd/i2pd.mk                          |   3 -
 package/ifupdown-scripts/ifupdown-scripts.mk  |   3 -
 package/igd2-for-linux/igd2-for-linux.mk      |   3 -
 package/inadyn/inadyn.mk                      |   3 -
 .../input-event-daemon/input-event-daemon.mk  |   3 -
 package/irqbalance/irqbalance.mk              |   3 -
 package/iucode-tool/iucode-tool.mk            |   3 -
 package/kodi/kodi.mk                          |   5 -
 package/lighttpd/lighttpd.mk                  |   6 -
 package/linuxptp/50-linuxptp.preset           |   1 +
 .../linuxptp/linuxptp-system-clock.service    |   1 -
 package/linuxptp/linuxptp.mk                  |   5 +-
 package/lldpd/lldpd.mk                        |   6 -
 package/mariadb/mariadb.mk                    |   3 -
 package/mender/mender.mk                      |   3 -
 package/mini-snmpd/mini-snmpd.mk              |   3 -
 package/minidlna/minidlna.mk                  |   5 -
 package/minissdpd/minissdpd.mk                |   3 -
 package/mosquitto/mosquitto.mk                |   3 -
 package/motion/motion.mk                      |   3 -
 package/netplug/netplug.mk                    |   3 -
 package/network-manager/network-manager.mk    |   7 -
 package/nfs-utils/nfs-utils.mk                |  16 --
 package/nginx/nginx.mk                        |   5 -
 package/nss-pam-ldapd/nss-pam-ldapd.mk        |   3 -
 package/ntp/ntp.mk                            |   3 -
 package/ofono/ofono.mk                        |   6 -
 package/olsr/olsr.mk                          |   3 -
 package/openntpd/openntpd.mk                  |   3 -
 package/openssh/openssh.mk                    |   3 -
 package/openvmtools/openvmtools.mk            |   3 -
 package/oracle-mysql/oracle-mysql.mk          |   3 -
 package/pcsc-lite/pcsc-lite.mk                |   6 -
 package/php/php.mk                            |   3 -
 package/postgresql/postgresql.mk              |   3 -
 package/proftpd/proftpd.mk                    |   3 -
 package/psplash/psplash.mk                    |   6 -
 package/ptpd/ptpd.mk                          |   3 -
 package/ptpd2/ptpd2.mk                        |   3 -
 package/pulseaudio/pulseaudio.mk              |   3 -
 package/python-web2py/python-web2py.mk        |   3 -
 package/rabbitmq-server/rabbitmq-server.mk    |   5 -
 package/redis/redis.mk                        |   3 -
 package/rng-tools/rng-tools.mk                |   3 -
 package/rpcbind/rpcbind.mk                    |   3 -
 package/rpi-userland/rpi-userland.mk          |   3 -
 package/rsyslog/rsyslog.mk                    |  14 --
 package/rygel/rygel.mk                        |   3 -
 package/sane-backends/sane-backends.mk        |   6 -
 package/squid/squid.mk                        |   3 -
 package/sshguard/sshguard.mk                  |   3 -
 package/supervisor/supervisor.mk              |   3 -
 package/suricata/suricata.mk                  |   3 -
 package/sysklogd/50-sysklogd.preset           |   1 +
 package/sysklogd/sysklogd.mk                  |   7 +-
 .../systemd-bootchart/systemd-bootchart.mk    |   6 -
 ...e-default-instance-of-getty-.service.patch |  27 +++
 package/systemd/80-buildroot.preset           |   4 +
 package/systemd/Config.in                     |   1 +
 package/systemd/Config.in.host                |   4 +
 package/systemd/systemd.mk                    | 219 ++++++++++--------
 package/targetcli-fb/50-targetcli-fb.preset   |   1 +
 package/targetcli-fb/targetcli-fb.mk          |   2 +
 package/tcf-agent/tcf-agent.mk                |   3 -
 package/thttpd/thttpd.mk                      |   3 -
 package/ti-gfx/ti-gfx.mk                      |   3 -
 package/tinyhttpd/tinyhttpd.mk                |   3 -
 package/tor/50-tor.preset                     |   1 +
 package/tor/tor.mk                            |   2 +
 package/transmission/transmission.mk          |   3 -
 package/triggerhappy/triggerhappy.mk          |   3 -
 package/upmpdcli/upmpdcli.mk                  |   3 -
 .../wpa_supplicant/50-wpa_supplicant.preset   |   5 +
 package/wpa_supplicant/wpa_supplicant.mk      |   2 +
 104 files changed, 190 insertions(+), 439 deletions(-)
 create mode 100644 package/avahi/50-avahi.preset
 create mode 100644 package/dante/50-dante.preset
 create mode 100644 package/docker-engine/50-docker-engine.preset
 create mode 100644 package/linuxptp/50-linuxptp.preset
 create mode 100644 package/sysklogd/50-sysklogd.preset
 create mode 100644 package/systemd/0002-remove-default-instance-of-getty-.service.patch
 create mode 100644 package/systemd/80-buildroot.preset
 create mode 100644 package/systemd/Config.in.host
 create mode 100644 package/targetcli-fb/50-targetcli-fb.preset
 create mode 100644 package/tor/50-tor.preset
 create mode 100644 package/wpa_supplicant/50-wpa_supplicant.preset

-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 01/15] new recipe : host-systemd
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:20   ` James Hilliard
  2019-11-09 21:49   ` Yann E. MORIN
  2019-11-03 16:56 ` [Buildroot] [PATCH 02/15] use host-systemctl preset all to enable units Jérémy Rosen
                   ` (13 subsequent siblings)
  14 siblings, 2 replies; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

Add the infrastructure to build the host version of systemd
* disable all optional features, they can be re-added when needed
* systemd has creative way of dealing with cross compile
  we build a "normal" host systemd, but install it in $HOST_DIR
  we use systemctl --root to correctly act on TARGET_DIR
* we need to adjust RPATH using patchelf because meson can't do it
  correctly by itsel

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/Config.in.host         |  1 +
 package/systemd/Config.in.host |  4 ++
 package/systemd/systemd.mk     | 92 ++++++++++++++++++++++++++++++++++
 3 files changed, 97 insertions(+)
 create mode 100644 package/systemd/Config.in.host

diff --git a/package/Config.in.host b/package/Config.in.host
index c0ac4fbbcc..d4e31ade2d 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -69,6 +69,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/systemd/Config.in.host"
 	source "package/tegrarcm/Config.in.host"
 	source "package/ti-cgt-pru/Config.in.host"
 	source "package/uboot-tools/Config.in.host"
diff --git a/package/systemd/Config.in.host b/package/systemd/Config.in.host
new file mode 100644
index 0000000000..09099752d2
--- /dev/null
+++ b/package/systemd/Config.in.host
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_HOST_SYSTEMD
+	bool "host systemd tools"
+	help
+	  Systemd command-line tools for the host
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 94d5f703cd..1e4f706517 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -550,3 +550,95 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
 SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
 
 $(eval $(meson-package))
+
+
+
+#
+# Host-systemd configuration
+#
+HOST_SYSTEMD_CONF_OPTS= \
+	-Dsplit-bin=true \
+	-Dsplit-usr=false \
+	-Dutmp=false \
+	-Dhibernate=false \
+	-Dldconfig=false \
+	-Dresolve=false \
+	-Defi=false \
+	-Dtpm=false \
+	-Denvironment-d=false \
+	-Dbinfmt=false \
+	-Dcoredump=false \
+	-Dpstore=false \
+	-Dlogind=false \
+	-Dhostnamed=false \
+	-Dlocaled=false \
+	-Dmachined=false \
+	-Dportabled=false \
+	-Dnetworkd=false \
+	-Dtimedated=false \
+	-Dtimesyncd=false \
+	-Dremote=false \
+	-Dcreate-log-dirs=false \
+	-Dnss-myhostname=false \
+	-Dnss-mymachines=false \
+	-Dnss-resolve=false \
+	-Dnss-systemd=false \
+	-Dfirstboot=false \
+	-Drandomseed=false \
+	-Dbacklight=false \
+	-Dvconsole=false \
+	-Dquotacheck=false \
+	-Dsysusers=false \
+	-Dtmpfiles=false \
+	-Dimportd=false \
+	-Dhwdb=false \
+	-Drfkill=false \
+	-Dman=false \
+	-Dhtml=false \
+	-Dsmack=false \
+	-Dpolkit=false \
+	-Dblkid=false \
+	-Didn=false \
+	-Dadm-group=false \
+	-Dwheel-group=false \
+	-Dzlib=false \
+	-Dgshadow=false \
+	-Dima=false \
+	-Dtests=false \
+	-Dglib=false \
+	-Dacl=false \
+	-Dsysvinit-path='' \
+	--prefix=/usr \
+	--libdir=lib \
+	--sysconfdir=/etc \
+	--localstatedir=/var \
+
+
+HOST_SYSTEMD_DEPENDENCIES = \
+    host-util-linux \
+    host-patchelf \
+    host-libcap \
+    host-gperf \
+
+# Fix RPATH After installation
+# * systemd provides a install_rpath instruction to meson because the binaries need to link with
+#   libsystemd which is not in a standard path
+# * meson can only replace the RPATH, not append to it
+# * the original rpatch is thus lost. 
+# * the original path had been tweaked by buildroot vial LD_FLAGS to add $(HOST_DIR)/lib
+# * thus re-tweak rpath after the installation for all binaries that need it
+#buildroot detects incorrect RPATH, so adding new binaries should be safe (it won't compile 
+#unless properly integrated).
+HOST_SYSTEMD_HOST_TOOLS = \
+    systemd-analyze  systemd-mount systemctl
+
+define HOST_SYSTEMD_FIX_RPATH
+	$(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \
+		$(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f)
+	)
+endef
+
+HOST_SYSTEMD_POST_INSTALL_HOOKS +=  HOST_SYSTEMD_FIX_RPATH
+HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
+
+$(eval $(host-meson-package))
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 02/15] use host-systemctl preset all to enable units
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 01/15] new recipe : host-systemd Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 03/15] fix tty handling Jérémy Rosen
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

since v234 upstream recommands using systemctl preset-all to enable units.
* add a buildroot specific preset file
* use that file to disable getty at tty1
* make systemd depend on host-systemd
* remove all link-creating code that systemd does for us.

This does not change how other systemd-enabled packages work.

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/systemd/80-buildroot.preset |   5 ++
 package/systemd/Config.in           |   1 +
 package/systemd/systemd.mk          | 102 ++++------------------------
 3 files changed, 18 insertions(+), 90 deletions(-)
 create mode 100644 package/systemd/80-buildroot.preset

diff --git a/package/systemd/80-buildroot.preset b/package/systemd/80-buildroot.preset
new file mode 100644
index 0000000000..4074901cbd
--- /dev/null
+++ b/package/systemd/80-buildroot.preset
@@ -0,0 +1,5 @@
+# Higher priority than systemd presets
+
+# by default systemd enables a getty on tty1
+# we don't want that because tty1 may not exist
+disable getty at .service
diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index aef39abe27..58c7696d65 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -35,6 +35,7 @@ menuconfig BR2_PACKAGE_SYSTEMD
 	select BR2_PACKAGE_KMOD_TOOLS
 	select BR2_TARGET_TZ_INFO
 	select BR2_NEEDS_HOST_UTF8_LOCALE
+	select BR2_PACKAGE_HOST_SYSTEMD
 	help
 	  systemd is a system and service manager for Linux,
 	  compatible with SysV and LSB init scripts. systemd provides
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 1e4f706517..d4680cd225 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -12,6 +12,7 @@ SYSTEMD_INSTALL_STAGING = YES
 SYSTEMD_DEPENDENCIES = \
 	$(if $(BR2_PACKAGE_BASH_COMPLETION),bash-completion) \
 	host-gperf \
+	host-systemd \
 	kmod \
 	libcap \
 	util-linux \
@@ -51,12 +52,6 @@ endif
 ifeq ($(BR2_PACKAGE_AUDIT),y)
 SYSTEMD_DEPENDENCIES += audit
 SYSTEMD_CONF_OPTS += -Daudit=true
-define SYSTEMD_INSTALL_SERVICE_AUDIT
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/auditd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/auditd.service
-endef
-
 else
 SYSTEMD_CONF_OPTS += -Daudit=false
 endif
@@ -64,11 +59,6 @@ endif
 ifeq ($(BR2_PACKAGE_CRYPTSETUP),y)
 SYSTEMD_DEPENDENCIES += cryptsetup
 SYSTEMD_CONF_OPTS += -Dlibcryptsetup=true
-define SYSTEMD_INSTALL_TARGET_CRYPTSETUP
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/remote-cryptsetup.target \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/remote-cryptsetup.target
-endef
 else
 SYSTEMD_CONF_OPTS += -Dlibcryptsetup=false
 endif
@@ -269,11 +259,6 @@ endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_MACHINED),y)
 SYSTEMD_CONF_OPTS += -Dmachined=true
-define SYSTEMD_INSTALL_TARGET_MACHINED
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../lib/systemd/system/machines.target \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/machines.target
-endef
 else
 SYSTEMD_CONF_OPTS += -Dmachined=false
 endif
@@ -317,11 +302,6 @@ endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_PSTORE),y)
 SYSTEMD_CONF_OPTS += -Dpstore=true
-define SYSTEMD_INSTALL_SERVICE_PSTORE
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/systemd-remount-fs.service.wants
-	ln -sf ../../../../lib/systemd/system/systemd-pstore.service \
-		$(TARGET_DIR)/etc/systemd/system/systemd-remount-fs.service.wants/systemd-pstore.service
-endef
 else
 SYSTEMD_CONF_OPTS += -Dpstore=false
 endif
@@ -336,24 +316,6 @@ endif
 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
 SYSTEMD_CONF_OPTS += -Dnetworkd=true
 SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * - - - Network Manager
-define SYSTEMD_INSTALL_SOCKET_NETWORKD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/sockets.target.wants
-	ln -sf ../../../../lib/systemd/system/systemd-networkd.socket \
-		$(TARGET_DIR)/etc/systemd/system/sockets.target.wants/systemd-networkd.socket
-endef
-define SYSTEMD_INSTALL_SERVICE_NETWORKD
-	ln -sf ../../../lib/systemd/system/systemd-networkd.service \
-		$(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.network1.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../lib/systemd/system/systemd-networkd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/systemd-networkd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/network-online.target.wants
-	ln -sf ../../../../lib/systemd/system/systemd-networkd-wait-online.service \
-		$(TARGET_DIR)/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/network-pre.target.wants
-	ln -sf ../../../../lib/systemd/system/systemd-network-generator.service \
-		$(TARGET_DIR)/etc/systemd/system/network-pre.target.wants/systemd-network-generator.service
-endef
 SYSTEMD_NETWORKD_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
 ifneq ($(SYSTEMD_NETWORKD_DHCP_IFACE),)
 define SYSTEMD_INSTALL_NETWORK_CONFS
@@ -373,13 +335,6 @@ define SYSTEMD_INSTALL_RESOLVCONF_HOOK
 endef
 SYSTEMD_CONF_OPTS += -Dresolve=true
 SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager
-define SYSTEMD_INSTALL_SERVICE_RESOLVED
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../lib/systemd/system/systemd-resolved.service \
-		$(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.resolve1.service
-	ln -sf ../../../../lib/systemd/system/systemd-resolved.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/systemd-resolved.service
-endef
 else
 SYSTEMD_CONF_OPTS += -Dresolve=false
 endif
@@ -387,15 +342,6 @@ endif
 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
 SYSTEMD_CONF_OPTS += -Dtimesyncd=true
 SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
-define SYSTEMD_INSTALL_SERVICE_TIMESYNCD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-	ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
-		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
-	ln -sf ../../../../lib/systemd/system/systemd-time-wait-sync.service \
-		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service
-	ln -sf ../../../lib/systemd/system/systemd-timesyncd.service \
-		$(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.timesync1.service
-endef
 else
 SYSTEMD_CONF_OPTS += -Dtimesyncd=false
 endif
@@ -446,18 +392,8 @@ SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
 endif
 
 define SYSTEMD_INSTALL_INIT_HOOK
-	ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
-	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
-	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
-	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
-	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/shutdown
-	ln -fs ../../../lib/systemd/system/multi-user.target \
-		$(TARGET_DIR)/etc/systemd/system/default.target
-	ln -fs ../../../lib/systemd/system/reboot.target \
-		$(TARGET_DIR)/etc/systemd/system/ctrl-alt-del.target
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../lib/systemd/system/remote-fs.target \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/remote-fs.target
+	ln -fs multi-user.target \
+		$(TARGET_DIR)/usr/lib/systemd/system/default.target
 endef
 
 define SYSTEMD_INSTALL_MACHINEID_HOOK
@@ -465,9 +401,6 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
 endef
 
 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
-	SYSTEMD_INSTALL_TARGET_CRYPTSETUP \
-	SYSTEMD_INSTALL_TARGET_MACHINED \
-	SYSTEMD_INSTALL_SOCKET_NETWORKD \
 	SYSTEMD_INSTALL_INIT_HOOK \
 	SYSTEMD_INSTALL_MACHINEID_HOOK \
 	SYSTEMD_INSTALL_RESOLVCONF_HOOK
@@ -491,10 +424,6 @@ define SYSTEMD_USERS
 	$(SYSTEMD_TIMESYNCD_USER)
 endef
 
-define SYSTEMD_DISABLE_SERVICE_TTY1
-	rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
-endef
-
 ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
 # systemd needs getty.service for VTs and serial-getty.service for serial ttys
 # note that console-getty.service should be used on /dev/console as it should not have dependencies
@@ -522,30 +451,23 @@ define SYSTEMD_INSTALL_SERVICE_TTY
 endef
 endif
 
-define SYSTEMD_INSTALL_SERVICE_AUTOVT
-	ln -sf ../../../lib/systemd/system/getty at .service \
-		$(TARGET_DIR)/lib/systemd/system/autovt at .service
-endef
 
-define SYSTEMD_INSTALL_SERVICE_BOOT_CHECK
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/boot-complete.target.requires
-	ln -sf ../../../../lib/systemd/system/systemd-boot-check-no-failures.service \
-		$(TARGET_DIR)/etc/systemd/system/boot-complete.target.requires/systemd-boot-check-no-failures.service
+define SYSTEMD_INSTALL_PRESET
+	$(INSTALL) -D -m 644 package/systemd/80-buildroot.preset $(TARGET_DIR)/usr/lib/systemd/system-preset/80-buildroot.preset
 endef
 
 define SYSTEMD_INSTALL_INIT_SYSTEMD
-	$(SYSTEMD_DISABLE_SERVICE_TTY1)
+	$(SYSTEMD_INSTALL_PRESET)
 	$(SYSTEMD_INSTALL_SERVICE_TTY)
-	$(SYSTEMD_INSTALL_SERVICE_AUTOVT)
-	$(SYSTEMD_INSTALL_SERVICE_RESOLVED)
-	$(SYSTEMD_INSTALL_SERVICE_TIMESYNCD)
 	$(SYSTEMD_INSTALL_NETWORK_CONFS)
-	$(SYSTEMD_INSTALL_SERVICE_PSTORE)
-	$(SYSTEMD_INSTALL_SERVICE_NETWORKD)
-	$(SYSTEMD_INSTALL_SERVICE_AUDIT)
-	$(SYSTEMD_INSTALL_SERVICE_BOOT_CHECK)
 endef
 
+define SYSTEMD_PRESET_ALL
+	$(HOST_DIR)/bin/systemctl --root=$(TARGET_DIR) preset-all
+endef
+SYSTEMD_TARGET_FINALIZE_HOOKS += SYSTEMD_PRESET_ALL
+
+
 SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
 SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
 
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 03/15] fix tty handling
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 01/15] new recipe : host-systemd Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 02/15] use host-systemctl preset all to enable units Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:48   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 04/15] fix trivial packages with buildroot-provided services Jérémy Rosen
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

Handling of tty is a bit tricky, we need to aggressively disable what
systemd does with tty1 then update for what buildroot wants to do

Rework the whole tty generation to work with presets

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 ...e-default-instance-of-getty-.service.patch | 27 +++++++++++++++++++
 package/systemd/80-buildroot.preset           |  5 ++--
 package/systemd/systemd.mk                    | 25 ++++++++++++-----
 3 files changed, 48 insertions(+), 9 deletions(-)
 create mode 100644 package/systemd/0002-remove-default-instance-of-getty-.service.patch

diff --git a/package/systemd/0002-remove-default-instance-of-getty-.service.patch b/package/systemd/0002-remove-default-instance-of-getty-.service.patch
new file mode 100644
index 0000000000..b412620cbd
--- /dev/null
+++ b/package/systemd/0002-remove-default-instance-of-getty-.service.patch
@@ -0,0 +1,27 @@
+From 77384f2f107ca99fef6a9c0b9d54a3f2147a0d18 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr>
+Date: Thu, 31 Oct 2019 16:24:02 +0100
+Subject: [PATCH] remove default instance of getty at .service
+
+upstream assumes that tty1 is always a valid tty, this generally makes
+sense but might not be the case for embedded devices. Having it as a
+DefaultInstance makes it enabled by "systemctl preset-all"
+
+it is simpler for us to remove the DefaultInstance entirely and manually
+link as needed
+---
+ units/getty at .service.m4 | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
+index 80e793bb73..7060457cb1 100644
+--- a/units/getty at .service.m4
++++ b/units/getty at .service.m4
+@@ -57,4 +57,3 @@ UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETAR
+ 
+ [Install]
+ WantedBy=getty.target
+-DefaultInstance=tty1
+-- 
+2.24.0.rc1
+
diff --git a/package/systemd/80-buildroot.preset b/package/systemd/80-buildroot.preset
index 4074901cbd..5dbae39173 100644
--- a/package/systemd/80-buildroot.preset
+++ b/package/systemd/80-buildroot.preset
@@ -1,5 +1,4 @@
 # Higher priority than systemd presets
 
-# by default systemd enables a getty on tty1
-# we don't want that because tty1 may not exist
-disable getty at .service
+# This file is currently empty, but is available for demonstration and future use
+
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index d4680cd225..ed039de82b 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -428,22 +428,35 @@ ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
 # systemd needs getty.service for VTs and serial-getty.service for serial ttys
 # note that console-getty.service should be used on /dev/console as it should not have dependencies
 # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
+#
+# systemd defaults to only have getty at tty.service enabled 
+# * DefaultInstance=tty1 in getty at service
+# * no DefaultInstance in serial-getty at .service
+# * WantedBy=getty.target in console-getty.service
+# * console-getty is not enabled because of 90-systemd.preset
+# We want "systemctl preset-all" to do the right thing, even when run on the target after boot
+# * remove the default instance of getty at .service via a patch on systemd source
+#   drop-ins cannot override DefaultInstance with an empty string
+# * set a new DefaultInstance for getty at .service, if needed
+# * set a new DefaultInstance for serial-getty at .service, if needed
+# * override the systemd-provided preset for console-getty.service if needed
 define SYSTEMD_INSTALL_SERVICE_TTY
 	if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
 	then \
 		TARGET="console-getty.service"; \
-		LINK_NAME="console-getty.service"; \
+		echo enable console-getty.service > $(TARGET_DIR)/usr/lib/systemd/system-preset/81-buildroot-tty.preset;\
 	elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
 	then \
 		TARGET="getty at .service"; \
-		LINK_NAME="getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
+		mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d;\
+		echo [Install] > $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
+		echo DefaultInstance=$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >> $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
 	else \
 		TARGET="serial-getty at .service"; \
-		LINK_NAME="serial-getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
+		mkdir $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d;\
+		echo [Install] > $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d/buildroot-console.conf;\
+		echo DefaultInstance=$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >> $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d/buildroot-console.conf;\
 	fi; \
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/getty.target.wants/; \
-	ln -fs ../../../../lib/systemd/system/$${TARGET} \
-		$(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${LINK_NAME}; \
 	if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
 	then \
 		$(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${TARGET}; \
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 04/15] fix trivial packages with buildroot-provided services
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (2 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 03/15] fix tty handling Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 05/15] fix trivial cases, upstream-provided services Jérémy Rosen
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

All the packages in this list have the following properties
* units are provided by buildroot in the package directory
* the SYSTEMD_INSTALL_INIT_HOOK is exactly equivalent to what the
  [Install] section of the unit does

The fix removes the soflinking in the .mk file

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/acpid/acpid.mk                           | 3 ---
 package/apache/apache.mk                         | 3 ---
 package/babeld/babeld.mk                         | 5 -----
 package/bandwidthd/bandwidthd.mk                 | 5 -----
 package/bind/bind.mk                             | 5 -----
 package/brltty/brltty.mk                         | 4 ----
 package/chrony/chrony.mk                         | 3 ---
 package/collectd/collectd.mk                     | 3 ---
 package/darkhttpd/darkhttpd.mk                   | 3 ---
 package/dcron/dcron.mk                           | 3 ---
 package/dhcp/dhcp.mk                             | 5 -----
 package/dhcpcd/dhcpcd.mk                         | 3 ---
 package/domoticz/domoticz.mk                     | 3 ---
 package/dropbear/dropbear.mk                     | 3 ---
 package/exim/exim.mk                             | 3 ---
 package/freescale-imx/imx-uuc/imx-uuc.mk         | 3 ---
 package/haveged/haveged.mk                       | 3 ---
 package/i2pd/i2pd.mk                             | 3 ---
 package/ifupdown-scripts/ifupdown-scripts.mk     | 3 ---
 package/igd2-for-linux/igd2-for-linux.mk         | 3 ---
 package/inadyn/inadyn.mk                         | 3 ---
 package/input-event-daemon/input-event-daemon.mk | 3 ---
 package/irqbalance/irqbalance.mk                 | 3 ---
 package/iucode-tool/iucode-tool.mk               | 3 ---
 package/kodi/kodi.mk                             | 5 -----
 package/mariadb/mariadb.mk                       | 3 ---
 package/mender/mender.mk                         | 3 ---
 package/mini-snmpd/mini-snmpd.mk                 | 3 ---
 package/minidlna/minidlna.mk                     | 5 -----
 package/minissdpd/minissdpd.mk                   | 3 ---
 package/motion/motion.mk                         | 3 ---
 package/netplug/netplug.mk                       | 3 ---
 package/nginx/nginx.mk                           | 5 -----
 package/nss-pam-ldapd/nss-pam-ldapd.mk           | 3 ---
 package/ntp/ntp.mk                               | 3 ---
 package/olsr/olsr.mk                             | 3 ---
 package/openntpd/openntpd.mk                     | 3 ---
 package/openssh/openssh.mk                       | 3 ---
 package/openvmtools/openvmtools.mk               | 3 ---
 package/oracle-mysql/oracle-mysql.mk             | 3 ---
 package/postgresql/postgresql.mk                 | 3 ---
 package/proftpd/proftpd.mk                       | 3 ---
 package/psplash/psplash.mk                       | 6 ------
 package/ptpd/ptpd.mk                             | 3 ---
 package/ptpd2/ptpd2.mk                           | 3 ---
 package/pulseaudio/pulseaudio.mk                 | 3 ---
 package/python-web2py/python-web2py.mk           | 3 ---
 package/rabbitmq-server/rabbitmq-server.mk       | 5 -----
 package/redis/redis.mk                           | 3 ---
 package/rng-tools/rng-tools.mk                   | 3 ---
 package/rpcbind/rpcbind.mk                       | 3 ---
 package/rpi-userland/rpi-userland.mk             | 3 ---
 package/rygel/rygel.mk                           | 3 ---
 package/sane-backends/sane-backends.mk           | 6 ------
 package/supervisor/supervisor.mk                 | 3 ---
 package/suricata/suricata.mk                     | 3 ---
 package/tcf-agent/tcf-agent.mk                   | 3 ---
 package/thttpd/thttpd.mk                         | 3 ---
 package/ti-gfx/ti-gfx.mk                         | 3 ---
 package/tinyhttpd/tinyhttpd.mk                   | 3 ---
 package/triggerhappy/triggerhappy.mk             | 3 ---
 61 files changed, 206 deletions(-)

diff --git a/package/acpid/acpid.mk b/package/acpid/acpid.mk
index 20295aa5a4..ff6e62b5cd 100644
--- a/package/acpid/acpid.mk
+++ b/package/acpid/acpid.mk
@@ -13,9 +13,6 @@ ACPID_LICENSE_FILES = COPYING
 define ACPID_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/acpid/acpid.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/acpid.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/acpid.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/acpid.service
 endef
 
 define ACPID_INSTALL_INIT_SYSV
diff --git a/package/apache/apache.mk b/package/apache/apache.mk
index 1d62538b19..22e7be8832 100644
--- a/package/apache/apache.mk
+++ b/package/apache/apache.mk
@@ -109,9 +109,6 @@ endef
 define APACHE_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/apache/apache.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/apache.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/apache.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/apache.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/babeld/babeld.mk b/package/babeld/babeld.mk
index 5fbfa65485..f864b5db26 100644
--- a/package/babeld/babeld.mk
+++ b/package/babeld/babeld.mk
@@ -25,11 +25,6 @@ endef
 define BABELD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/babeld/babeld.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/babeld.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -fs ../../../../usr/lib/systemd/system/babeld.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/babeld.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/bandwidthd/bandwidthd.mk b/package/bandwidthd/bandwidthd.mk
index e9bc871a6a..990d8c5d8f 100644
--- a/package/bandwidthd/bandwidthd.mk
+++ b/package/bandwidthd/bandwidthd.mk
@@ -34,11 +34,6 @@ endif
 define BANDWIDTHD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/bandwidthd/bandwidthd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/bandwidthd.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -sf /usr/lib/systemd/system/bandwidthd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/bandwidthd.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/bind/bind.mk b/package/bind/bind.mk
index 08cad22d42..eece65e75f 100644
--- a/package/bind/bind.mk
+++ b/package/bind/bind.mk
@@ -111,11 +111,6 @@ endef
 define BIND_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(BIND_PKGDIR)/named.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/named.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -sf /usr/lib/systemd/system/named.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/named.service
 endef
 else
 BIND_POST_INSTALL_TARGET_HOOKS += BIND_TARGET_REMOVE_SERVER
diff --git a/package/brltty/brltty.mk b/package/brltty/brltty.mk
index 3ae8b899b8..11b8c0d35f 100644
--- a/package/brltty/brltty.mk
+++ b/package/brltty/brltty.mk
@@ -121,10 +121,6 @@ endef
 define BRLTTY_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/brltty/brltty.service \
 		   $(TARGET_DIR)/usr/lib/systemd/system/brltty.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-	ln -fs  ../../../../usr/lib/systemd/system/brltty.service \
-		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/brltty.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/chrony/chrony.mk b/package/chrony/chrony.mk
index f6dcb11794..21c2d62afa 100644
--- a/package/chrony/chrony.mk
+++ b/package/chrony/chrony.mk
@@ -66,9 +66,6 @@ endef
 define CHRONY_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/chrony/chrony.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/chrony.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/chrony.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/chrony.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
index 820547b511..e4ccdf7770 100644
--- a/package/collectd/collectd.mk
+++ b/package/collectd/collectd.mk
@@ -229,9 +229,6 @@ endef
 define COLLECTD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/collectd/collectd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/collectd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/collectd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/collectd.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/darkhttpd/darkhttpd.mk b/package/darkhttpd/darkhttpd.mk
index df80899371..f4831a9426 100644
--- a/package/darkhttpd/darkhttpd.mk
+++ b/package/darkhttpd/darkhttpd.mk
@@ -21,9 +21,6 @@ endef
 define DARKHTTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/darkhttpd/darkhttpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/darkhttpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/darkhttpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/darkhttpd.service
 endef
 
 define DARKHTTPD_INSTALL_INIT_SYSV
diff --git a/package/dcron/dcron.mk b/package/dcron/dcron.mk
index 2ee0709af5..51ebb18745 100644
--- a/package/dcron/dcron.mk
+++ b/package/dcron/dcron.mk
@@ -31,9 +31,6 @@ endef
 define DCRON_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dcron/dcron.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/dcron.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/dcron.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dcron.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/dhcp/dhcp.mk b/package/dhcp/dhcp.mk
index 0abb0aebd7..e0abb4ff6f 100644
--- a/package/dhcp/dhcp.mk
+++ b/package/dhcp/dhcp.mk
@@ -92,11 +92,6 @@ define DHCP_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dhcp/dhcpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/dhcpd.service
 
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -sf ../../../../usr/lib/systemd/system/dhcpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpd.service
-
 	mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
 	echo "d /var/lib/dhcp 0755 - - - -" > \
 		$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf
diff --git a/package/dhcpcd/dhcpcd.mk b/package/dhcpcd/dhcpcd.mk
index cd20d8f9f3..63dbbee86c 100644
--- a/package/dhcpcd/dhcpcd.mk
+++ b/package/dhcpcd/dhcpcd.mk
@@ -48,9 +48,6 @@ endef
 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
 endif
 
diff --git a/package/domoticz/domoticz.mk b/package/domoticz/domoticz.mk
index c0568c61c6..ab560ba05f 100644
--- a/package/domoticz/domoticz.mk
+++ b/package/domoticz/domoticz.mk
@@ -78,9 +78,6 @@ endef
 define DOMOTICZ_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/domoticz/domoticz.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/domoticz.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/domoticz.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/domoticz.service
 endef
 
 $(eval $(cmake-package))
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index 7cbc16bc3d..23e5e3f600 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -90,9 +90,6 @@ DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
 define DROPBEAR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/dropbear.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dropbear.service
 endef
 
 ifeq ($(BR2_USE_MMU),y)
diff --git a/package/exim/exim.mk b/package/exim/exim.mk
index 014565c85b..040b292a87 100644
--- a/package/exim/exim.mk
+++ b/package/exim/exim.mk
@@ -145,9 +145,6 @@ endef
 define EXIM_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/exim/exim.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/exim.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/exim.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/exim.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/freescale-imx/imx-uuc/imx-uuc.mk b/package/freescale-imx/imx-uuc/imx-uuc.mk
index 040d7bd874..2ed910cb84 100644
--- a/package/freescale-imx/imx-uuc/imx-uuc.mk
+++ b/package/freescale-imx/imx-uuc/imx-uuc.mk
@@ -33,9 +33,6 @@ endef
 define IMX_UUC_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/freescale-imx/imx-uuc/imx-uuc.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/imx-uuc.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
-	ln -fs ../../../../usr/lib/systemd/system/imx-uuc.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/imx-uuc.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/haveged/haveged.mk b/package/haveged/haveged.mk
index 05b59a1685..cc834304df 100644
--- a/package/haveged/haveged.mk
+++ b/package/haveged/haveged.mk
@@ -21,9 +21,6 @@ endef
 define HAVEGED_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/haveged/haveged.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/haveged.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs /usr/lib/systemd/system/haveged.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/haveged.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/i2pd/i2pd.mk b/package/i2pd/i2pd.mk
index 5fa815c21d..de975d66a4 100644
--- a/package/i2pd/i2pd.mk
+++ b/package/i2pd/i2pd.mk
@@ -59,9 +59,6 @@ endef
 define I2PD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/i2pd/i2pd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/i2pd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/i2pd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/i2pd.service
 endef
 
 $(eval $(cmake-package))
diff --git a/package/ifupdown-scripts/ifupdown-scripts.mk b/package/ifupdown-scripts/ifupdown-scripts.mk
index 17364aed03..abb4575777 100644
--- a/package/ifupdown-scripts/ifupdown-scripts.mk
+++ b/package/ifupdown-scripts/ifupdown-scripts.mk
@@ -48,9 +48,6 @@ endef
 define IFUPDOWN_SCRIPTS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(IFUPDOWN_SCRIPTS_PKGDIR)/network.service \
 		$(TARGET_DIR)/etc/systemd/system/network.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../network.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/igd2-for-linux/igd2-for-linux.mk b/package/igd2-for-linux/igd2-for-linux.mk
index 38170b4f57..478c353997 100644
--- a/package/igd2-for-linux/igd2-for-linux.mk
+++ b/package/igd2-for-linux/igd2-for-linux.mk
@@ -40,9 +40,6 @@ endef
 define IGD2_FOR_LINUX_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/igd2-for-linux/upnpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/upnpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/upnpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/upnpd.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/inadyn/inadyn.mk b/package/inadyn/inadyn.mk
index 96a37d4768..5f67849252 100644
--- a/package/inadyn/inadyn.mk
+++ b/package/inadyn/inadyn.mk
@@ -34,9 +34,6 @@ endef
 define INADYN_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/inadyn/inadyn.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/inadyn.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/inadyn.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/inadyn.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/input-event-daemon/input-event-daemon.mk b/package/input-event-daemon/input-event-daemon.mk
index 632c9eeecb..dbe2d4bfb2 100644
--- a/package/input-event-daemon/input-event-daemon.mk
+++ b/package/input-event-daemon/input-event-daemon.mk
@@ -30,9 +30,6 @@ endef
 define INPUT_EVENT_DAEMON_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/input-event-daemon/input-event-daemon.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/input-event-daemon.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf /usr/lib/systemd/system/input-event-daemon.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/input-event-daemon.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/irqbalance/irqbalance.mk b/package/irqbalance/irqbalance.mk
index 8e550df3bf..59ab7c5c1d 100644
--- a/package/irqbalance/irqbalance.mk
+++ b/package/irqbalance/irqbalance.mk
@@ -55,9 +55,6 @@ endef
 define IRQBALANCE_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/irqbalance/irqbalance.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/irqbalance.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/irqbalance.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/irqbalance.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/iucode-tool/iucode-tool.mk b/package/iucode-tool/iucode-tool.mk
index e900888d7d..bddc37295c 100644
--- a/package/iucode-tool/iucode-tool.mk
+++ b/package/iucode-tool/iucode-tool.mk
@@ -21,9 +21,6 @@ endef
 define IUCODE_TOOL_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/iucode-tool/iucode.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/iucode.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/iucode.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/iucode.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
index 028bf551bc..86c5d33390 100644
--- a/package/kodi/kodi.mk
+++ b/package/kodi/kodi.mk
@@ -398,11 +398,6 @@ endef
 define KODI_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/kodi/kodi.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/kodi.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -fs ../../../../usr/lib/systemd/system/kodi.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service
 endef
 
 $(eval $(cmake-package))
diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk
index 6a18db48ab..5d46502c66 100644
--- a/package/mariadb/mariadb.mk
+++ b/package/mariadb/mariadb.mk
@@ -118,9 +118,6 @@ endef
 define MARIADB_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/mariadb/mysqld.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/mysqld.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/mysqld.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service
 endef
 endif
 
diff --git a/package/mender/mender.mk b/package/mender/mender.mk
index e085d542c9..d69093d976 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -70,9 +70,6 @@ MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
 define MENDER_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(MENDER_PKGDIR)/mender.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/mender.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/mender.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mender.service
 endef
 
 define MENDER_INSTALL_INIT_SYSV
diff --git a/package/mini-snmpd/mini-snmpd.mk b/package/mini-snmpd/mini-snmpd.mk
index f2480e3168..698402bc51 100644
--- a/package/mini-snmpd/mini-snmpd.mk
+++ b/package/mini-snmpd/mini-snmpd.mk
@@ -13,9 +13,6 @@ 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))
diff --git a/package/minidlna/minidlna.mk b/package/minidlna/minidlna.mk
index 262480cbff..c66e97b073 100644
--- a/package/minidlna/minidlna.mk
+++ b/package/minidlna/minidlna.mk
@@ -31,11 +31,6 @@ endef
 define MINIDLNA_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/minidlna/minidlnad.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/minidlnad.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -fs  ../../../../usr/lib/systemd/system/minidlnad.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/minidlnad.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/minissdpd/minissdpd.mk b/package/minissdpd/minissdpd.mk
index 31d942eac5..d97eece680 100644
--- a/package/minissdpd/minissdpd.mk
+++ b/package/minissdpd/minissdpd.mk
@@ -32,9 +32,6 @@ endef
 define MINISSDPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/minissdpd/minissdpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/minissdpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/minissdpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/minissdpd.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/motion/motion.mk b/package/motion/motion.mk
index 165e402fc8..ae58c54935 100644
--- a/package/motion/motion.mk
+++ b/package/motion/motion.mk
@@ -71,9 +71,6 @@ endef
 define MOTION_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/motion/motion.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/motion.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/motion.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/motion.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/netplug/netplug.mk b/package/netplug/netplug.mk
index 9363a71811..b5083120f1 100644
--- a/package/netplug/netplug.mk
+++ b/package/netplug/netplug.mk
@@ -26,9 +26,6 @@ endef
 define NETPLUG_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/netplug/netplug.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/netplug.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/netplug.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/netplug.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/nginx/nginx.mk b/package/nginx/nginx.mk
index 96f9b37bfa..83ffce5fcf 100644
--- a/package/nginx/nginx.mk
+++ b/package/nginx/nginx.mk
@@ -281,11 +281,6 @@ endef
 define NGINX_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/nginx/nginx.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/nginx.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -fs ../../../../usr/lib/systemd/system/nginx.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nginx.service
 endef
 
 define NGINX_INSTALL_INIT_SYSV
diff --git a/package/nss-pam-ldapd/nss-pam-ldapd.mk b/package/nss-pam-ldapd/nss-pam-ldapd.mk
index c094db96ac..f8358cc01d 100644
--- a/package/nss-pam-ldapd/nss-pam-ldapd.mk
+++ b/package/nss-pam-ldapd/nss-pam-ldapd.mk
@@ -29,9 +29,6 @@ endif
 define NSS_PAM_LDAPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -m 644 -D package/nss-pam-ldapd/nslcd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/nslcd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/nslcd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nslcd.service
 endef
 
 define NSS_PAM_LDAPD_INSTALL_INIT_SYSV
diff --git a/package/ntp/ntp.mk b/package/ntp/ntp.mk
index d53fcc5d0b..fb138a8fba 100644
--- a/package/ntp/ntp.mk
+++ b/package/ntp/ntp.mk
@@ -108,9 +108,6 @@ endef
 
 define NTP_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/ntpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
 endef
 endif
 
diff --git a/package/olsr/olsr.mk b/package/olsr/olsr.mk
index faff2533d9..766b1432c1 100644
--- a/package/olsr/olsr.mk
+++ b/package/olsr/olsr.mk
@@ -43,9 +43,6 @@ endef
 define OLSR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/olsr/olsr.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/olsr.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/olsr.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/olsr.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/openntpd/openntpd.mk b/package/openntpd/openntpd.mk
index f5a5690479..f2eaee7efd 100644
--- a/package/openntpd/openntpd.mk
+++ b/package/openntpd/openntpd.mk
@@ -24,9 +24,6 @@ OPENNTPD_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -pthread"
 define OPENNTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/openntpd/ntpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/ntpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
 endef
 
 define OPENNTPD_INSTALL_INIT_SYSV
diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 47a724d839..0411133bdc 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -74,9 +74,6 @@ endif
 define OPENSSH_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/openssh/sshd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/sshd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/sshd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshd.service
 	$(OPENSSH_INSTALL_SYSTEMD_SYSUSERS)
 endef
 
diff --git a/package/openvmtools/openvmtools.mk b/package/openvmtools/openvmtools.mk
index e97eaf224e..8a90aca830 100644
--- a/package/openvmtools/openvmtools.mk
+++ b/package/openvmtools/openvmtools.mk
@@ -79,9 +79,6 @@ endef
 define OPENVMTOOLS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/openvmtools/vmtoolsd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/vmtoolsd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/vmtoolsd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vmtoolsd.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/oracle-mysql/oracle-mysql.mk b/package/oracle-mysql/oracle-mysql.mk
index 0275a8428f..c33ae02033 100644
--- a/package/oracle-mysql/oracle-mysql.mk
+++ b/package/oracle-mysql/oracle-mysql.mk
@@ -116,9 +116,6 @@ endef
 define ORACLE_MYSQL_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(ORACLE_MYSQL_PKGDIR)/mysqld.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/mysqld.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/mysqld.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service
 endef
 
 else
diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
index 58f829ee00..e89063bb28 100644
--- a/package/postgresql/postgresql.mk
+++ b/package/postgresql/postgresql.mk
@@ -128,9 +128,6 @@ endef
 define POSTGRESQL_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/postgresql/postgresql.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/postgresql.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/postgresql.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/proftpd/proftpd.mk b/package/proftpd/proftpd.mk
index da1c07b410..2c3e0a6877 100644
--- a/package/proftpd/proftpd.mk
+++ b/package/proftpd/proftpd.mk
@@ -123,9 +123,6 @@ endef
 define PROFTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/proftpd/proftpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/proftpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/proftpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/proftpd.service
 endef
 
 ifneq ($(BR2_PACKAGE_PROFTPD_BUFFER_SIZE),0)
diff --git a/package/psplash/psplash.mk b/package/psplash/psplash.mk
index 4a2e0de5ce..3dd2f4d579 100644
--- a/package/psplash/psplash.mk
+++ b/package/psplash/psplash.mk
@@ -13,15 +13,9 @@ PSPLASH_AUTORECONF = YES
 define PSPLASH_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/psplash/psplash-start.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/psplash-start.service
-	$(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-	ln -sf  ../../../../usr/lib/systemd/system/psplash-start.service \
-		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/
 
 	$(INSTALL) -D -m 644 package/psplash/psplash-quit.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/psplash-quit.service
-	$(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf  ../../../../usr/lib/systemd/system/psplash-quit.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
 endef
 
 $(eval $(autotools-package))
diff --git a/package/ptpd/ptpd.mk b/package/ptpd/ptpd.mk
index dad8ccfe10..49587231e0 100644
--- a/package/ptpd/ptpd.mk
+++ b/package/ptpd/ptpd.mk
@@ -25,9 +25,6 @@ endef
 define PTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/ptpd/ptpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/ptpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/ptpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ptpd.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/ptpd2/ptpd2.mk b/package/ptpd2/ptpd2.mk
index f4a70760ad..0de336464d 100644
--- a/package/ptpd2/ptpd2.mk
+++ b/package/ptpd2/ptpd2.mk
@@ -32,9 +32,6 @@ endef
 define PTPD2_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/ptpd2/ptpd2.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/ptpd2.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/ptpd2.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ptpd2.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/pulseaudio/pulseaudio.mk b/package/pulseaudio/pulseaudio.mk
index b833d4ad27..0e78724634 100644
--- a/package/pulseaudio/pulseaudio.mk
+++ b/package/pulseaudio/pulseaudio.mk
@@ -167,9 +167,6 @@ endef
 define PULSEAUDIO_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/pulseaudio/pulseaudio.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/pulseaudio.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/pulseaudio.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/pulseaudio.service
 endef
 
 endif
diff --git a/package/python-web2py/python-web2py.mk b/package/python-web2py/python-web2py.mk
index 0b86fb148e..8706c87968 100644
--- a/package/python-web2py/python-web2py.mk
+++ b/package/python-web2py/python-web2py.mk
@@ -57,9 +57,6 @@ endef
 define PYTHON_WEB2PY_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/python-web2py/web2py.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/web2py.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib//systemd/system/web2py.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/web2py.service
 endef
 
 # www-data user and group are used for web2py. Because these user and group
diff --git a/package/rabbitmq-server/rabbitmq-server.mk b/package/rabbitmq-server/rabbitmq-server.mk
index 6df770793a..f9c28e6677 100644
--- a/package/rabbitmq-server/rabbitmq-server.mk
+++ b/package/rabbitmq-server/rabbitmq-server.mk
@@ -36,11 +36,6 @@ endef
 define RABBITMQ_SERVER_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/rabbitmq-server/rabbitmq-server.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/rabbitmq-server.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -fs ../../../../usr/lib/systemd/system/rabbitmq-server.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rabbitmq-server.service
 endef
 
 define RABBITMQ_SERVER_INSTALL_INIT_SYSV
diff --git a/package/redis/redis.mk b/package/redis/redis.mk
index a321eb9347..43ff79332c 100644
--- a/package/redis/redis.mk
+++ b/package/redis/redis.mk
@@ -49,9 +49,6 @@ endef
 define REDIS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/redis/redis.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/redis.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/redis.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/redis.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/rng-tools/rng-tools.mk b/package/rng-tools/rng-tools.mk
index fa23b3316f..cb7b2cf8a1 100644
--- a/package/rng-tools/rng-tools.mk
+++ b/package/rng-tools/rng-tools.mk
@@ -37,9 +37,6 @@ endef
 define RNG_TOOLS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/rng-tools/rngd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/rngd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/rngd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rngd.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/rpcbind/rpcbind.mk b/package/rpcbind/rpcbind.mk
index 0f5011e522..4329c9803a 100644
--- a/package/rpcbind/rpcbind.mk
+++ b/package/rpcbind/rpcbind.mk
@@ -26,9 +26,6 @@ define RPCBIND_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/rpcbind.service
 	$(INSTALL) -m 0644 -D package/rpcbind/rpcbind.socket \
 		$(TARGET_DIR)/usr/lib/systemd/system/rpcbind.socket
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/sockets.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/rpcbind.socket \
-		$(TARGET_DIR)/etc/systemd/system/sockets.target.wants/rpcbind.socket
 endef
 
 define RPCBIND_INSTALL_INIT_SYSV
diff --git a/package/rpi-userland/rpi-userland.mk b/package/rpi-userland/rpi-userland.mk
index 20ef2fca98..b398472d84 100644
--- a/package/rpi-userland/rpi-userland.mk
+++ b/package/rpi-userland/rpi-userland.mk
@@ -23,9 +23,6 @@ endef
 define RPI_USERLAND_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/rpi-userland/vcfiled.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/vcfiled.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/vcfiled.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vcfiled.service
 endef
 endif
 
diff --git a/package/rygel/rygel.mk b/package/rygel/rygel.mk
index 1bf3ab4350..5ffb6a9400 100644
--- a/package/rygel/rygel.mk
+++ b/package/rygel/rygel.mk
@@ -68,9 +68,6 @@ endef
 define RYGEL_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/rygel/rygel.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/rygel.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/rygel.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rygel.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/sane-backends/sane-backends.mk b/package/sane-backends/sane-backends.mk
index 092123e194..52e03da518 100644
--- a/package/sane-backends/sane-backends.mk
+++ b/package/sane-backends/sane-backends.mk
@@ -66,14 +66,8 @@ endef
 define SANE_BACKENDS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -m 0644 -D package/sane-backends/saned.socket \
 		$(TARGET_DIR)/usr/lib/systemd/system/saned.socket
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/socket.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/saned.socket \
-		$(TARGET_DIR)/etc/systemd/system/socket.target.wants/saned.socket
 	$(INSTALL) -m 0644 -D package/sane-backends/saned at .service \
 		$(TARGET_DIR)/usr/lib/systemd/system/saned at .service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/saned at .service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/saned at .service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/supervisor/supervisor.mk b/package/supervisor/supervisor.mk
index e99a9b18ce..424f46a7c2 100644
--- a/package/supervisor/supervisor.mk
+++ b/package/supervisor/supervisor.mk
@@ -26,9 +26,6 @@ endef
 define SUPERVISOR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/supervisor/supervisord.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/supervisord.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/supervisord.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/supervisord.service
 endef
 
 $(eval $(python-package))
diff --git a/package/suricata/suricata.mk b/package/suricata/suricata.mk
index 56eb6a706f..7dc38d30cb 100644
--- a/package/suricata/suricata.mk
+++ b/package/suricata/suricata.mk
@@ -132,9 +132,6 @@ endef
 define SURICATA_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/suricata/suricata.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/suricata.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/suricata.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/suricata.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/tcf-agent/tcf-agent.mk b/package/tcf-agent/tcf-agent.mk
index 5a0a991b1d..2b8a61b66f 100644
--- a/package/tcf-agent/tcf-agent.mk
+++ b/package/tcf-agent/tcf-agent.mk
@@ -24,9 +24,6 @@ TCF_AGENT_CONF_OPTS = \
 define TCF_AGENT_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/tcf-agent/tcf-agent.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/tcf-agent.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/tcf-agent.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/tcf-agent.service
 endef
 
 define TCF_AGENT_INSTALL_INIT_SYSV
diff --git a/package/thttpd/thttpd.mk b/package/thttpd/thttpd.mk
index 6cf86e4b95..fe96f7df65 100644
--- a/package/thttpd/thttpd.mk
+++ b/package/thttpd/thttpd.mk
@@ -36,9 +36,6 @@ endef
 define THTTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/thttpd/thttpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/thttpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
-	ln -fs ../../../../usr/lib/systemd/system/thttpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/thttpd.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/ti-gfx/ti-gfx.mk b/package/ti-gfx/ti-gfx.mk
index 9fad553780..2728572776 100644
--- a/package/ti-gfx/ti-gfx.mk
+++ b/package/ti-gfx/ti-gfx.mk
@@ -196,9 +196,6 @@ define TI_GFX_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/scripts/ti-gfx
 	$(INSTALL) -D -m 644 package/ti-gfx/ti-gfx.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/ti-gfx.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/ti-gfx.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ti-gfx.service
 endef
 
 define TI_GFX_INSTALL_TARGET_CMDS
diff --git a/package/tinyhttpd/tinyhttpd.mk b/package/tinyhttpd/tinyhttpd.mk
index 058f6bd186..6b3ba5f305 100644
--- a/package/tinyhttpd/tinyhttpd.mk
+++ b/package/tinyhttpd/tinyhttpd.mk
@@ -27,9 +27,6 @@ endef
 define TINYHTTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/tinyhttpd/tinyhttpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/tinyhttpd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/tinyhttpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/tinyhttpd.service
 endef
 
 $(eval $(generic-package))
diff --git a/package/triggerhappy/triggerhappy.mk b/package/triggerhappy/triggerhappy.mk
index 7c4bf40476..f83a557804 100644
--- a/package/triggerhappy/triggerhappy.mk
+++ b/package/triggerhappy/triggerhappy.mk
@@ -41,9 +41,6 @@ endef
 define TRIGGERHAPPY_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/triggerhappy/triggerhappy.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/triggerhappy.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/triggerhappy.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/triggerhappy.service
 endef
 
 $(eval $(generic-package))
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 05/15] fix trivial cases, upstream-provided services
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (3 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 04/15] fix trivial packages with buildroot-provided services Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all Jérémy Rosen
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

All these packages have an upstream-provided service, but buildroot
enabled manually the services in exactly the same way as the [Install]
section.

This is not needed anymore

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/audit/audit.mk                         |  4 ----
 package/avahi/avahi.mk                         |  8 --------
 package/bluez5_utils/bluez5_utils.mk           |  8 --------
 package/boinc/boinc.mk                         |  5 -----
 package/fail2ban/fail2ban.mk                   |  3 ---
 package/gerbera/gerbera.mk                     |  6 ------
 package/lighttpd/lighttpd.mk                   |  6 ------
 package/lldpd/lldpd.mk                         |  6 ------
 package/mosquitto/mosquitto.mk                 |  3 ---
 package/nfs-utils/nfs-utils.mk                 | 16 ----------------
 package/ofono/ofono.mk                         |  6 ------
 package/pcsc-lite/pcsc-lite.mk                 |  6 ------
 package/php/php.mk                             |  3 ---
 package/rsyslog/rsyslog.mk                     | 14 --------------
 package/squid/squid.mk                         |  3 ---
 package/sshguard/sshguard.mk                   |  3 ---
 package/systemd-bootchart/systemd-bootchart.mk |  6 ------
 package/transmission/transmission.mk           |  3 ---
 package/upmpdcli/upmpdcli.mk                   |  3 ---
 19 files changed, 112 deletions(-)

diff --git a/package/audit/audit.mk b/package/audit/audit.mk
index 1e05688f45..03967ee650 100644
--- a/package/audit/audit.mk
+++ b/package/audit/audit.mk
@@ -44,10 +44,6 @@ define AUDIT_INSTALL_INIT_SYSV
 endef
 
 define AUDIT_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/auditd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/auditd.service
-
 	$(INSTALL) -D -m 644 package/audit/audit_tmpfiles.conf \
 		$(TARGET_DIR)/usr/lib/tmpfiles.d/audit.conf
 endef
diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index baffe3cb69..53021f6b6d 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -198,14 +198,6 @@ endef
 endif
 
 define AVAHI_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -fs ../../../../usr/lib/systemd/system/avahi-daemon.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
-
-	ln -fs ../../../../usr/lib/systemd/system/avahi-dnsconfd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-dnsconfd.service
-
 	$(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
 		$(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
 
diff --git a/package/bluez5_utils/bluez5_utils.mk b/package/bluez5_utils/bluez5_utils.mk
index e2ce2f74dc..e9b709df4d 100644
--- a/package/bluez5_utils/bluez5_utils.mk
+++ b/package/bluez5_utils/bluez5_utils.mk
@@ -118,12 +118,4 @@ else
 BLUEZ5_UTILS_CONF_OPTS += --disable-systemd
 endif
 
-define BLUEZ5_UTILS_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/bluetooth.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/bluetooth.service \
-		$(TARGET_DIR)/etc/systemd/system/bluetooth.target.wants/bluetooth.service
-	ln -fs ../../../usr/lib/systemd/system/bluetooth.service \
-		$(TARGET_DIR)/etc/systemd/system/dbus-org.bluez.service
-endef
-
 $(eval $(autotools-package))
diff --git a/package/boinc/boinc.mk b/package/boinc/boinc.mk
index 5a29214f46..60aa5d1521 100644
--- a/package/boinc/boinc.mk
+++ b/package/boinc/boinc.mk
@@ -53,10 +53,5 @@ define BOINC_INSTALL_INIT_SYSV
 		$(TARGET_DIR)/etc/init.d/S99boinc-client
 endef
 
-define BOINC_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/boinc-client.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/boinc-client.service
-endef
 
 $(eval $(autotools-package))
diff --git a/package/fail2ban/fail2ban.mk b/package/fail2ban/fail2ban.mk
index 16fa63c147..a0325dffc5 100644
--- a/package/fail2ban/fail2ban.mk
+++ b/package/fail2ban/fail2ban.mk
@@ -25,9 +25,6 @@ endef
 define FAIL2BAN_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/files/fail2ban.service.in \
 		$(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib//systemd/system/fail2ban.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/fail2ban.service
 	$(SED) 's, at BINDIR@,/usr/bin,g' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
 	$(SED) '/^PIDFile/c\PIDFile=/run/fail2ban.pid' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
 endef
diff --git a/package/gerbera/gerbera.mk b/package/gerbera/gerbera.mk
index a177a73107..cd14649cb5 100644
--- a/package/gerbera/gerbera.mk
+++ b/package/gerbera/gerbera.mk
@@ -104,11 +104,5 @@ define GERBERA_INSTALL_INIT_SYSV
 		$(TARGET_DIR)/etc/init.d/S99gerbera
 endef
 
-# gerbera.service is installed by cmake in $(TARGET_DIR)/usr/lib/systemd/system
-define GERBERA_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/gerbera.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/gerbera.service
-endef
 
 $(eval $(cmake-package))
diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk
index 449b4b4de2..d7622ad822 100644
--- a/package/lighttpd/lighttpd.mk
+++ b/package/lighttpd/lighttpd.mk
@@ -99,12 +99,6 @@ endef
 define LIGHTTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/doc/systemd/lighttpd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/lighttpd.service
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	ln -fs ../../../../usr/lib/systemd/system/lighttpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/lighttpd.service
-
 	$(INSTALL) -D -m 644 package/lighttpd/lighttpd_tmpfiles.conf \
 		$(TARGET_DIR)/usr/lib/tmpfiles.d/lighttpd.conf
 endef
diff --git a/package/lldpd/lldpd.mk b/package/lldpd/lldpd.mk
index 5569e409dd..264323a879 100644
--- a/package/lldpd/lldpd.mk
+++ b/package/lldpd/lldpd.mk
@@ -65,10 +65,4 @@ define LLDPD_INSTALL_INIT_SYSV
 		$(TARGET_DIR)/etc/init.d/S60lldpd
 endef
 
-define LLDPD_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/lldpd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/lldpd.service
-endef
-
 $(eval $(autotools-package))
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index 533d44a088..289fcbccd2 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -111,9 +111,6 @@ endef
 define MOSQUITTO_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(@D)/service/systemd/mosquitto.service.notify \
 		$(TARGET_DIR)/usr/lib/systemd/system/mosquitto.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/mosquitto.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mosquitto.service
 endef
 
 define MOSQUITTO_USERS
diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk
index cb2caa03f0..a3484286d1 100644
--- a/package/nfs-utils/nfs-utils.mk
+++ b/package/nfs-utils/nfs-utils.mk
@@ -73,25 +73,9 @@ define NFS_UTILS_INSTALL_INIT_SYSV
 		$(TARGET_DIR)/etc/init.d/S60nfs
 endef
 
-define NFS_UTILS_INSTALL_INIT_SYSTEMD_NFSD
-	ln -fs ../../../../usr/lib/systemd/system/nfs-server.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-server.service
-endef
 endif
 
 define NFS_UTILS_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
-	$(NFS_UTILS_INSTALL_INIT_SYSTEMD_NFSD)
-
-	ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-client.target
-
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants
-
-	ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
-		$(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants/nfs-client.target
-
 	$(INSTALL) -D -m 0755 package/nfs-utils/nfs-utils_env.sh \
 		$(TARGET_DIR)/usr/libexec/nfs-utils/nfs-utils_env.sh
 
diff --git a/package/ofono/ofono.mk b/package/ofono/ofono.mk
index 18248b50d1..752fc62544 100644
--- a/package/ofono/ofono.mk
+++ b/package/ofono/ofono.mk
@@ -31,12 +31,6 @@ define OFONO_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 -D package/ofono/S46ofono $(TARGET_DIR)/etc/init.d/S46ofono
 endef
 
-define OFONO_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/systemd/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/ofono.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-endef
-
 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
 OFONO_CONF_OPTS += --enable-udev
 OFONO_DEPENDENCIES += udev
diff --git a/package/pcsc-lite/pcsc-lite.mk b/package/pcsc-lite/pcsc-lite.mk
index e819a93910..08aab466fc 100644
--- a/package/pcsc-lite/pcsc-lite.mk
+++ b/package/pcsc-lite/pcsc-lite.mk
@@ -44,10 +44,4 @@ ifeq ($(PACKAGE_PCSC_LITE_EMBEDDED),y)
 PCSC_LITE_CONF_OPTS += --enable-embedded
 endif
 
-define PCSC_LITE_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/sockets.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/pcscd.socket \
-		$(TARGET_DIR)/etc/systemd/system/sockets.target.wants/pcscd.socket
-endef
-
 $(eval $(autotools-package))
diff --git a/package/php/php.mk b/package/php/php.mk
index b679531238..e7d26da68b 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -328,9 +328,6 @@ endef
 define PHP_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/sapi/fpm/php-fpm.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/php-fpm.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service
 endef
 
 define PHP_INSTALL_FPM_CONF
diff --git a/package/rsyslog/rsyslog.mk b/package/rsyslog/rsyslog.mk
index 5bd6b59ba3..7ef56dfe7d 100644
--- a/package/rsyslog/rsyslog.mk
+++ b/package/rsyslog/rsyslog.mk
@@ -85,20 +85,6 @@ define RSYSLOG_INSTALL_INIT_SYSV
 		$(TARGET_DIR)/etc/init.d/S01rsyslogd
 endef
 
-# The rsyslog.service is installed by rsyslog, but the link is not created
-# so the service is not enabled.
-# We need to create another link which is due to the fact that the
-# rsyslog.service contains an Alias=
-# If we were to use systemctl enable to enable the service, it would
-# create both, so we mimic that.
-define RSYSLOG_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/rsyslog.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rsyslog.service
-	ln -sf ../../../usr/lib/systemd/system/rsyslog.service \
-		$(TARGET_DIR)/etc/systemd/system/syslog.service
-endef
-
 define RSYSLOG_INSTALL_CONF
 	$(INSTALL) -m 0644 -D $(@D)/platform/redhat/rsyslog.conf \
 		$(TARGET_DIR)/etc/rsyslog.conf
diff --git a/package/squid/squid.mk b/package/squid/squid.mk
index 0d09968bd3..34a463d80d 100644
--- a/package/squid/squid.mk
+++ b/package/squid/squid.mk
@@ -85,9 +85,6 @@ endef
 define SQUID_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/tools/systemd/squid.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/squid.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../..//usr/lib/systemd/system/squid.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/squid.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/sshguard/sshguard.mk b/package/sshguard/sshguard.mk
index 0f39974d46..ceff520693 100644
--- a/package/sshguard/sshguard.mk
+++ b/package/sshguard/sshguard.mk
@@ -25,9 +25,6 @@ endef
 define SSHGUARD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/examples/sshguard.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/sshguard.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/sshguard.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshguard.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/systemd-bootchart/systemd-bootchart.mk b/package/systemd-bootchart/systemd-bootchart.mk
index 62bc79539b..bcc3dbe22a 100644
--- a/package/systemd-bootchart/systemd-bootchart.mk
+++ b/package/systemd-bootchart/systemd-bootchart.mk
@@ -16,10 +16,4 @@ SYSTEMD_BOOTCHART_DEPENDENCIES = systemd
 
 SYSTEMD_BOOTCHART_CONF_OPTS = --disable-man
 
-define SYSTEMD_BOOTCHART_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-	ln -sf ../../../../lib/systemd/system/systemd-bootchart.service \
-		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-bootchart.service
-endef
-
 $(eval $(autotools-package))
diff --git a/package/transmission/transmission.mk b/package/transmission/transmission.mk
index 00652e7f4c..8fbda5eea3 100644
--- a/package/transmission/transmission.mk
+++ b/package/transmission/transmission.mk
@@ -66,9 +66,6 @@ endef
 define TRANSMISSION_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/daemon/transmission-daemon.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/transmission-daemon.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/transmission-daemon.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/transmission-daemon.service
 endef
 
 else
diff --git a/package/upmpdcli/upmpdcli.mk b/package/upmpdcli/upmpdcli.mk
index 6fa3ae3c5e..290cdcb1f2 100644
--- a/package/upmpdcli/upmpdcli.mk
+++ b/package/upmpdcli/upmpdcli.mk
@@ -27,9 +27,6 @@ endef
 define UPMPDCLI_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(@D)/systemd/upmpdcli.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/upmpdcli.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/upmpdcli.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/upmpdcli.service
 endef
 
 define UPMPDCLI_INSTALL_CONF_FILE
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (4 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 05/15] fix trivial cases, upstream-provided services Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:15   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 07/15] package/connman: " Jérémy Rosen
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

avahi was not enabled, we now need to disable it explicitely

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/avahi/50-avahi.preset | 3 +++
 package/avahi/avahi.mk        | 2 ++
 2 files changed, 5 insertions(+)
 create mode 100644 package/avahi/50-avahi.preset

diff --git a/package/avahi/50-avahi.preset b/package/avahi/50-avahi.preset
new file mode 100644
index 0000000000..998772ea96
--- /dev/null
+++ b/package/avahi/50-avahi.preset
@@ -0,0 +1,3 @@
+disable avahi-daemon.service
+disable avahi-daemon.socket
+disable avahi-dnsconfd.service
diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index 53021f6b6d..2df63c5273 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -198,6 +198,8 @@ endef
 endif
 
 define AVAHI_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/avahi/50-avahi.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-avahi.preset
 	$(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
 		$(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
 
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 07/15] package/connman: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (5 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:39   ` James Hilliard
  2019-11-09 22:11   ` Yann E. MORIN
  2019-11-03 16:56 ` [Buildroot] [PATCH 08/15] package/dante: " Jérémy Rosen
                   ` (7 subsequent siblings)
  14 siblings, 2 replies; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

connman has two services
* connman.service which is the real daemon
* connman-wait-online.service which is a sync point for network-online.target

Only the first one was enabled. This adaptation enables both.

Not enabling connman-wait-online.service is probably a bug

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/connman/connman.mk | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/package/connman/connman.mk b/package/connman/connman.mk
index 839bc7a0e2..d70eb1ac82 100644
--- a/package/connman/connman.mk
+++ b/package/connman/connman.mk
@@ -32,12 +32,6 @@ define CONNMAN_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman
 endef
 
-define CONNMAN_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/connman.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
-endef
-
 ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
 CONNMAN_CONF_OPTS += --enable-client
 CONNMAN_DEPENDENCIES += readline
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 08/15] package/dante: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (6 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 07/15] package/connman: " Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:17   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 09/15] package/linuxptp " Jérémy Rosen
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

dante was not enabled, we now need to disable it explicitely

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/dante/50-dante.preset | 1 +
 package/dante/dante.mk        | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 package/dante/50-dante.preset

diff --git a/package/dante/50-dante.preset b/package/dante/50-dante.preset
new file mode 100644
index 0000000000..9fc7ab171a
--- /dev/null
+++ b/package/dante/50-dante.preset
@@ -0,0 +1 @@
+disable dante.service
diff --git a/package/dante/dante.mk b/package/dante/dante.mk
index 0bd036d37e..82b7b9629f 100644
--- a/package/dante/dante.mk
+++ b/package/dante/dante.mk
@@ -31,6 +31,8 @@ DANTE_POST_INSTALL_TARGET_HOOKS += DANTE_INSTALL_CONFIG_FILE
 define DANTE_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dante/dante.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/dante.service
+	$(INSTALL) -D -m 644 package/dante/50-dante.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-dante.preset
 endef
 
 define DANTE_INSTALL_INIT_SYSV
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 09/15] package/linuxptp adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (7 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 08/15] package/dante: " Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:23   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 10/15] package/docker-engine: " Jérémy Rosen
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

linuxptp has two services
* linuxptp.service : the actual daemon
* linuxptp-system-clock.service : sync the linux clock to the phc clock

The first was enabled, the second was not
The second has an incorrect (though harmless) WantedBy : there is an
explicit Wants= in linuxptp.service

This keeps the compatibility, but I don't see the poit of not enabling the
second service.

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/linuxptp/50-linuxptp.preset            | 1 +
 package/linuxptp/linuxptp-system-clock.service | 1 -
 package/linuxptp/linuxptp.mk                   | 5 ++---
 3 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 package/linuxptp/50-linuxptp.preset

diff --git a/package/linuxptp/50-linuxptp.preset b/package/linuxptp/50-linuxptp.preset
new file mode 100644
index 0000000000..dd8dbb12d5
--- /dev/null
+++ b/package/linuxptp/50-linuxptp.preset
@@ -0,0 +1 @@
+disable linuxptp-system-clock.service
diff --git a/package/linuxptp/linuxptp-system-clock.service b/package/linuxptp/linuxptp-system-clock.service
index a4436a34a7..57beec4579 100644
--- a/package/linuxptp/linuxptp-system-clock.service
+++ b/package/linuxptp/linuxptp-system-clock.service
@@ -8,4 +8,3 @@ Restart=always
 
 [Install]
 WantedBy=multi-user.target
-WantedBy=linuxptp.service
diff --git a/package/linuxptp/linuxptp.mk b/package/linuxptp/linuxptp.mk
index c304ff6d6e..5b55322b0b 100644
--- a/package/linuxptp/linuxptp.mk
+++ b/package/linuxptp/linuxptp.mk
@@ -42,9 +42,8 @@ define LINUXPTP_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/linuxptp.service
 	$(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/linuxptp-system-clock.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/linuxptp-system-clock.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/linuxptp.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/linuxptp.service
+	$(INSTALL) -D -m 644 package/linuxptp/50-linuxptp.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-linuxptp.preset
 endef
 
 $(eval $(generic-package))
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 10/15] package/docker-engine: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (8 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 09/15] package/linuxptp " Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:25   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 11/15] package/network-manager: " Jérémy Rosen
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

docker-engine has two services:
* docker.service, if enabled: docker will start at boot
* docker.socket, if enabled: docker will start at first connection

buildroot currently enables only the service
this patch keeps it that way.

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/docker-engine/50-docker-engine.preset | 1 +
 package/docker-engine/docker-engine.mk        | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
 create mode 100644 package/docker-engine/50-docker-engine.preset

diff --git a/package/docker-engine/50-docker-engine.preset b/package/docker-engine/50-docker-engine.preset
new file mode 100644
index 0000000000..0d8cf35345
--- /dev/null
+++ b/package/docker-engine/50-docker-engine.preset
@@ -0,0 +1 @@
+disable docker.socket
diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
index 6a225ee5f0..8540cda9af 100644
--- a/package/docker-engine/docker-engine.mk
+++ b/package/docker-engine/docker-engine.mk
@@ -68,9 +68,8 @@ define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/docker.service
 	$(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.socket \
 		$(TARGET_DIR)/usr/lib/systemd/system/docker.socket
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
-	ln -fs ../../../../usr/lib/systemd/system/docker.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/docker.service
+	$(INSTALL) -D -m 644 package/docker-engine/50-docker-engine.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-docker-engine.preset
 endef
 
 define DOCKER_ENGINE_INSTALL_INIT_SYSV
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 11/15] package/network-manager: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (9 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 10/15] package/docker-engine: " Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:30   ` James Hilliard
  2019-11-09 22:14   ` Yann E. MORIN
  2019-11-03 16:56 ` [Buildroot] [PATCH 12/15] package/wpa_supplicant: adapt for preset-all Jérémy Rosen
                   ` (3 subsequent siblings)
  14 siblings, 2 replies; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

NM has three services
* NetworkManger.service : the main daemon
* NetworkManger-dispatcher.service : a daemon handling network callbacks
* NetworkManager-wait-online.service : sync of other services with network-online

Only the first two were activated. We now also enable
wait-online. Not enabling it was probably a bug.

Note that buildroot adds an alias dbus-org.freedesktop.NetworkManager
Adding an alias that is not known upstream is not clean,
but I left it for backward compatibility

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/network-manager/network-manager.mk | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/package/network-manager/network-manager.mk b/package/network-manager/network-manager.mk
index 6412d3a241..67e6a76774 100644
--- a/package/network-manager/network-manager.mk
+++ b/package/network-manager/network-manager.mk
@@ -88,16 +88,9 @@ define NETWORK_MANAGER_INSTALL_INIT_SYSV
 endef
 
 define NETWORK_MANAGER_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-
 	ln -sf /usr/lib/systemd/system/NetworkManager.service \
 		$(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
 
-	ln -sf /usr/lib/systemd/system/NetworkManager.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/NetworkManager.service
-
-	ln -sf /usr/lib/systemd/system/NetworkManager-dispatcher.service \
-		$(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
 endef
 
 $(eval $(autotools-package))
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 12/15] package/wpa_supplicant: adapt for preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (10 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 11/15] package/network-manager: " Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:32   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 13/15] package/sysklogd: adapt to preset-all Jérémy Rosen
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

all services were installed but not enabled.
This change keeps them that way.

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/wpa_supplicant/50-wpa_supplicant.preset | 5 +++++
 package/wpa_supplicant/wpa_supplicant.mk        | 2 ++
 2 files changed, 7 insertions(+)
 create mode 100644 package/wpa_supplicant/50-wpa_supplicant.preset

diff --git a/package/wpa_supplicant/50-wpa_supplicant.preset b/package/wpa_supplicant/50-wpa_supplicant.preset
new file mode 100644
index 0000000000..ddd339d82f
--- /dev/null
+++ b/package/wpa_supplicant/50-wpa_supplicant.preset
@@ -0,0 +1,5 @@
+disable wpa_supplicant.service
+disable wpa_supplicant at .service
+disable wpa_supplicant-nl80211 at .service
+disable wpa_supplicant-wired at .service
+
diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
index 9dcebca9bf..42b12b1fb4 100644
--- a/package/wpa_supplicant/wpa_supplicant.mk
+++ b/package/wpa_supplicant/wpa_supplicant.mk
@@ -227,6 +227,8 @@ define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-nl80211 at .service
 	$(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant-wired at .service \
 		$(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-wired at .service
+	$(INSTALL) -D -m 644 package/wpa_supplicant/50-wpa_supplicant.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-wpa_supplicant.preset
 endef
 
 $(eval $(generic-package))
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 13/15] package/sysklogd: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (11 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 12/15] package/wpa_supplicant: adapt for preset-all Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:33   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 14/15] package/targetcli-fb: " Jérémy Rosen
  2019-11-03 16:56 ` [Buildroot] [PATCH 15/15] package/tor: " Jérémy Rosen
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

sysklogd installs two services: syslogd and klogd
only syslogd is enabled, leave it that way

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/sysklogd/50-sysklogd.preset | 1 +
 package/sysklogd/sysklogd.mk        | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)
 create mode 100644 package/sysklogd/50-sysklogd.preset

diff --git a/package/sysklogd/50-sysklogd.preset b/package/sysklogd/50-sysklogd.preset
new file mode 100644
index 0000000000..2f9b19acb5
--- /dev/null
+++ b/package/sysklogd/50-sysklogd.preset
@@ -0,0 +1 @@
+disable klogd.service
diff --git a/package/sysklogd/sysklogd.mk b/package/sysklogd/sysklogd.mk
index 266c171170..c7846d4f50 100644
--- a/package/sysklogd/sysklogd.mk
+++ b/package/sysklogd/sysklogd.mk
@@ -30,11 +30,8 @@ define SYSKLOGD_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/syslogd.service
 	$(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/klogd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/klogd.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/syslogd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslogd.service
-	ln -sf ../../../usr/lib/systemd/system/syslogd.service \
-		$(TARGET_DIR)/etc/systemd/system/syslog.service
+	$(INSTALL) -D -m 644 package/sysklogd/50-sysklogd.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-sysklogd.preset
 endef
 
 $(eval $(autotools-package))
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 14/15] package/targetcli-fb: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (12 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 13/15] package/sysklogd: adapt to preset-all Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:34   ` James Hilliard
  2019-11-03 16:56 ` [Buildroot] [PATCH 15/15] package/tor: " Jérémy Rosen
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

the service was not enabled, we now need to disable it explicitely

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/targetcli-fb/50-targetcli-fb.preset | 1 +
 package/targetcli-fb/targetcli-fb.mk        | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 package/targetcli-fb/50-targetcli-fb.preset

diff --git a/package/targetcli-fb/50-targetcli-fb.preset b/package/targetcli-fb/50-targetcli-fb.preset
new file mode 100644
index 0000000000..572ee4fb93
--- /dev/null
+++ b/package/targetcli-fb/50-targetcli-fb.preset
@@ -0,0 +1 @@
+disable target.service.service
diff --git a/package/targetcli-fb/targetcli-fb.mk b/package/targetcli-fb/targetcli-fb.mk
index 75643446d2..5e50643bc9 100644
--- a/package/targetcli-fb/targetcli-fb.mk
+++ b/package/targetcli-fb/targetcli-fb.mk
@@ -21,6 +21,8 @@ endef
 define TARGETCLI_FB_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -m 0644 -D package/targetcli-fb/target.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/target.service
+	$(INSTALL) -D -m 644 package/targetcli-fb/50-targetcli-fb.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-targetcli-fb.preset
 endef
 
 # Targetcli stores its configuration in /etc/target/saveconfig.json
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 15/15] package/tor: adapt to preset-all
  2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
                   ` (13 preceding siblings ...)
  2019-11-03 16:56 ` [Buildroot] [PATCH 14/15] package/targetcli-fb: " Jérémy Rosen
@ 2019-11-03 16:56 ` Jérémy Rosen
  2019-11-03 17:31   ` James Hilliard
  14 siblings, 1 reply; 42+ messages in thread
From: Jérémy Rosen @ 2019-11-03 16:56 UTC (permalink / raw)
  To: buildroot

tor was not enabled, we now need to disable it explicitely

Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
---
 package/tor/50-tor.preset | 1 +
 package/tor/tor.mk        | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 package/tor/50-tor.preset

diff --git a/package/tor/50-tor.preset b/package/tor/50-tor.preset
new file mode 100644
index 0000000000..8664cb9ca5
--- /dev/null
+++ b/package/tor/50-tor.preset
@@ -0,0 +1 @@
+disable tor.service
diff --git a/package/tor/tor.mk b/package/tor/tor.mk
index 264d8d06da..2785c1a518 100644
--- a/package/tor/tor.mk
+++ b/package/tor/tor.mk
@@ -61,6 +61,8 @@ TOR_POST_INSTALL_TARGET_HOOKS += TOR_INSTALL_CONF
 define TOR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(@D)/contrib/dist/tor.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/tor.service
+	$(INSTALL) -D -m 644 package/tor/50-tor.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-tor.preset
 endef
 
 $(eval $(autotools-package))
-- 
2.24.0.rc1

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

* [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all Jérémy Rosen
@ 2019-11-03 17:15   ` James Hilliard
  2019-11-03 17:17     ` Jérémy ROSEN
  0 siblings, 1 reply; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:15 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> avahi was not enabled, we now need to disable it explicitly
Isn't avahi not being enabled a bug? Why do we want to have it disabled?
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/avahi/50-avahi.preset | 3 +++
>  package/avahi/avahi.mk        | 2 ++
>  2 files changed, 5 insertions(+)
>  create mode 100644 package/avahi/50-avahi.preset
>
> diff --git a/package/avahi/50-avahi.preset b/package/avahi/50-avahi.preset
> new file mode 100644
> index 0000000000..998772ea96
> --- /dev/null
> +++ b/package/avahi/50-avahi.preset
> @@ -0,0 +1,3 @@
> +disable avahi-daemon.service
> +disable avahi-daemon.socket
> +disable avahi-dnsconfd.service
> diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
> index 53021f6b6d..2df63c5273 100644
> --- a/package/avahi/avahi.mk
> +++ b/package/avahi/avahi.mk
> @@ -198,6 +198,8 @@ endef
>  endif
>
>  define AVAHI_INSTALL_INIT_SYSTEMD
> +       $(INSTALL) -D -m 644 package/avahi/50-avahi.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-avahi.preset
>         $(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
>                 $(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
>
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all
  2019-11-03 17:15   ` James Hilliard
@ 2019-11-03 17:17     ` Jérémy ROSEN
  2019-11-09 22:08       ` Yann E. MORIN
  0 siblings, 1 reply; 42+ messages in thread
From: Jérémy ROSEN @ 2019-11-03 17:17 UTC (permalink / raw)
  To: buildroot

that's probably correct, but I tried to be compatible.

Dropping that patch will do "the correct thing"

Le dim. 3 nov. 2019 ? 18:15, James Hilliard <james.hilliard1@gmail.com> a
?crit :

> On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr>
> wrote:
> >
> > avahi was not enabled, we now need to disable it explicitly
> Isn't avahi not being enabled a bug? Why do we want to have it disabled?
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > ---
> >  package/avahi/50-avahi.preset | 3 +++
> >  package/avahi/avahi.mk        | 2 ++
> >  2 files changed, 5 insertions(+)
> >  create mode 100644 package/avahi/50-avahi.preset
> >
> > diff --git a/package/avahi/50-avahi.preset
> b/package/avahi/50-avahi.preset
> > new file mode 100644
> > index 0000000000..998772ea96
> > --- /dev/null
> > +++ b/package/avahi/50-avahi.preset
> > @@ -0,0 +1,3 @@
> > +disable avahi-daemon.service
> > +disable avahi-daemon.socket
> > +disable avahi-dnsconfd.service
> > diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
> > index 53021f6b6d..2df63c5273 100644
> > --- a/package/avahi/avahi.mk
> > +++ b/package/avahi/avahi.mk
> > @@ -198,6 +198,8 @@ endef
> >  endif
> >
> >  define AVAHI_INSTALL_INIT_SYSTEMD
> > +       $(INSTALL) -D -m 644 package/avahi/50-avahi.preset \
> > +
>  $(TARGET_DIR)/usr/lib/systemd/system-preset/50-avahi.preset
> >         $(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
> >                 $(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
> >
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
[image: SMILE]  <http://www.smile.eu/>

20 rue des Jardins
92600 Asni?res-sur-Seine
*J?r?my ROSEN*
Architecte technique

[image: email] jeremy.rosen at smile.fr
[image: phone]  +33 6 88 25 87 42
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>

[image: D?couvrez l?univers Smile, rendez-vous sur smile.eu]
<https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191103/0bf60974/attachment.html>

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

* [Buildroot] [PATCH 08/15] package/dante: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 08/15] package/dante: " Jérémy Rosen
@ 2019-11-03 17:17   ` James Hilliard
  0 siblings, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:17 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> dante was not enabled, we now need to disable it explicitly
Isn't it a bug that dante was not enabled previously? Is there a
reason it should
not be enabled?
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/dante/50-dante.preset | 1 +
>  package/dante/dante.mk        | 2 ++
>  2 files changed, 3 insertions(+)
>  create mode 100644 package/dante/50-dante.preset
>
> diff --git a/package/dante/50-dante.preset b/package/dante/50-dante.preset
> new file mode 100644
> index 0000000000..9fc7ab171a
> --- /dev/null
> +++ b/package/dante/50-dante.preset
> @@ -0,0 +1 @@
> +disable dante.service
> diff --git a/package/dante/dante.mk b/package/dante/dante.mk
> index 0bd036d37e..82b7b9629f 100644
> --- a/package/dante/dante.mk
> +++ b/package/dante/dante.mk
> @@ -31,6 +31,8 @@ DANTE_POST_INSTALL_TARGET_HOOKS += DANTE_INSTALL_CONFIG_FILE
>  define DANTE_INSTALL_INIT_SYSTEMD
>         $(INSTALL) -D -m 644 package/dante/dante.service \
>                 $(TARGET_DIR)/usr/lib/systemd/system/dante.service
> +       $(INSTALL) -D -m 644 package/dante/50-dante.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-dante.preset
>  endef
>
>  define DANTE_INSTALL_INIT_SYSV
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 01/15] new recipe : host-systemd
  2019-11-03 16:56 ` [Buildroot] [PATCH 01/15] new recipe : host-systemd Jérémy Rosen
@ 2019-11-03 17:20   ` James Hilliard
  2019-11-04 17:02     ` Jérémy ROSEN
  2019-11-09 21:52     ` Yann E. MORIN
  2019-11-09 21:49   ` Yann E. MORIN
  1 sibling, 2 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:20 UTC (permalink / raw)
  To: buildroot

Does this depend on a minimum host kernel version? How should we be
handling that?

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> Add the infrastructure to build the host version of systemd
> * disable all optional features, they can be re-added when needed
> * systemd has creative way of dealing with cross compile
>   we build a "normal" host systemd, but install it in $HOST_DIR
>   we use systemctl --root to correctly act on TARGET_DIR
> * we need to adjust RPATH using patchelf because meson can't do it
>   correctly by itsel
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/Config.in.host         |  1 +
>  package/systemd/Config.in.host |  4 ++
>  package/systemd/systemd.mk     | 92 ++++++++++++++++++++++++++++++++++
>  3 files changed, 97 insertions(+)
>  create mode 100644 package/systemd/Config.in.host
>
> diff --git a/package/Config.in.host b/package/Config.in.host
> index c0ac4fbbcc..d4e31ade2d 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -69,6 +69,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/systemd/Config.in.host"
>         source "package/tegrarcm/Config.in.host"
>         source "package/ti-cgt-pru/Config.in.host"
>         source "package/uboot-tools/Config.in.host"
> diff --git a/package/systemd/Config.in.host b/package/systemd/Config.in.host
> new file mode 100644
> index 0000000000..09099752d2
> --- /dev/null
> +++ b/package/systemd/Config.in.host
> @@ -0,0 +1,4 @@
> +config BR2_PACKAGE_HOST_SYSTEMD
> +       bool "host systemd tools"
> +       help
> +         Systemd command-line tools for the host
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 94d5f703cd..1e4f706517 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -550,3 +550,95 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
>  SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
>
>  $(eval $(meson-package))
> +
> +
> +
> +#
> +# Host-systemd configuration
> +#
> +HOST_SYSTEMD_CONF_OPTS= \
> +       -Dsplit-bin=true \
> +       -Dsplit-usr=false \
> +       -Dutmp=false \
> +       -Dhibernate=false \
> +       -Dldconfig=false \
> +       -Dresolve=false \
> +       -Defi=false \
> +       -Dtpm=false \
> +       -Denvironment-d=false \
> +       -Dbinfmt=false \
> +       -Dcoredump=false \
> +       -Dpstore=false \
> +       -Dlogind=false \
> +       -Dhostnamed=false \
> +       -Dlocaled=false \
> +       -Dmachined=false \
> +       -Dportabled=false \
> +       -Dnetworkd=false \
> +       -Dtimedated=false \
> +       -Dtimesyncd=false \
> +       -Dremote=false \
> +       -Dcreate-log-dirs=false \
> +       -Dnss-myhostname=false \
> +       -Dnss-mymachines=false \
> +       -Dnss-resolve=false \
> +       -Dnss-systemd=false \
> +       -Dfirstboot=false \
> +       -Drandomseed=false \
> +       -Dbacklight=false \
> +       -Dvconsole=false \
> +       -Dquotacheck=false \
> +       -Dsysusers=false \
> +       -Dtmpfiles=false \
> +       -Dimportd=false \
> +       -Dhwdb=false \
> +       -Drfkill=false \
> +       -Dman=false \
> +       -Dhtml=false \
> +       -Dsmack=false \
> +       -Dpolkit=false \
> +       -Dblkid=false \
> +       -Didn=false \
> +       -Dadm-group=false \
> +       -Dwheel-group=false \
> +       -Dzlib=false \
> +       -Dgshadow=false \
> +       -Dima=false \
> +       -Dtests=false \
> +       -Dglib=false \
> +       -Dacl=false \
> +       -Dsysvinit-path='' \
> +       --prefix=/usr \
> +       --libdir=lib \
> +       --sysconfdir=/etc \
> +       --localstatedir=/var \
> +
> +
> +HOST_SYSTEMD_DEPENDENCIES = \
> +    host-util-linux \
> +    host-patchelf \
> +    host-libcap \
> +    host-gperf \
> +
> +# Fix RPATH After installation
> +# * systemd provides a install_rpath instruction to meson because the binaries need to link with
> +#   libsystemd which is not in a standard path
> +# * meson can only replace the RPATH, not append to it
> +# * the original rpatch is thus lost.
> +# * the original path had been tweaked by buildroot vial LD_FLAGS to add $(HOST_DIR)/lib
> +# * thus re-tweak rpath after the installation for all binaries that need it
> +#buildroot detects incorrect RPATH, so adding new binaries should be safe (it won't compile
> +#unless properly integrated).
> +HOST_SYSTEMD_HOST_TOOLS = \
> +    systemd-analyze  systemd-mount systemctl
> +
> +define HOST_SYSTEMD_FIX_RPATH
> +       $(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \
> +               $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f)
> +       )
> +endef
> +
> +HOST_SYSTEMD_POST_INSTALL_HOOKS +=  HOST_SYSTEMD_FIX_RPATH
> +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> +
> +$(eval $(host-meson-package))
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 09/15] package/linuxptp adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 09/15] package/linuxptp " Jérémy Rosen
@ 2019-11-03 17:23   ` James Hilliard
  0 siblings, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:23 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> linuxptp has two services
> * linuxptp.service : the actual daemon
> * linuxptp-system-clock.service : sync the linux clock to the phc clock
>
> The first was enabled, the second was not
> The second has an incorrect (though harmless) WantedBy : there is an
> explicit Wants= in linuxptp.service
>
> This keeps the compatibility, but I don't see the poit of not enabling the
> second service.
I agree, it not being enabled should be considered a bug.
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/linuxptp/50-linuxptp.preset            | 1 +
>  package/linuxptp/linuxptp-system-clock.service | 1 -
>  package/linuxptp/linuxptp.mk                   | 5 ++---
>  3 files changed, 3 insertions(+), 4 deletions(-)
>  create mode 100644 package/linuxptp/50-linuxptp.preset
>
> diff --git a/package/linuxptp/50-linuxptp.preset b/package/linuxptp/50-linuxptp.preset
> new file mode 100644
> index 0000000000..dd8dbb12d5
> --- /dev/null
> +++ b/package/linuxptp/50-linuxptp.preset
> @@ -0,0 +1 @@
> +disable linuxptp-system-clock.service
> diff --git a/package/linuxptp/linuxptp-system-clock.service b/package/linuxptp/linuxptp-system-clock.service
> index a4436a34a7..57beec4579 100644
> --- a/package/linuxptp/linuxptp-system-clock.service
> +++ b/package/linuxptp/linuxptp-system-clock.service
> @@ -8,4 +8,3 @@ Restart=always
>
>  [Install]
>  WantedBy=multi-user.target
> -WantedBy=linuxptp.service
> diff --git a/package/linuxptp/linuxptp.mk b/package/linuxptp/linuxptp.mk
> index c304ff6d6e..5b55322b0b 100644
> --- a/package/linuxptp/linuxptp.mk
> +++ b/package/linuxptp/linuxptp.mk
> @@ -42,9 +42,8 @@ define LINUXPTP_INSTALL_INIT_SYSTEMD
>                 $(TARGET_DIR)/usr/lib/systemd/system/linuxptp.service
>         $(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/linuxptp-system-clock.service \
>                 $(TARGET_DIR)/usr/lib/systemd/system/linuxptp-system-clock.service
> -       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> -       ln -sf ../../../../usr/lib/systemd/system/linuxptp.service \
> -               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/linuxptp.service
> +       $(INSTALL) -D -m 644 package/linuxptp/50-linuxptp.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-linuxptp.preset
>  endef
>
>  $(eval $(generic-package))
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 10/15] package/docker-engine: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 10/15] package/docker-engine: " Jérémy Rosen
@ 2019-11-03 17:25   ` James Hilliard
  2019-11-04 17:03     ` Jérémy ROSEN
  0 siblings, 1 reply; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:25 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> docker-engine has two services:
> * docker.service, if enabled: docker will start at boot
> * docker.socket, if enabled: docker will start at first connection
>
> buildroot currently enables only the service
> this patch keeps it that way.
The socket not being enabled looks to be a bug so I don't think it
should be disabled.
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/docker-engine/50-docker-engine.preset | 1 +
>  package/docker-engine/docker-engine.mk        | 5 ++---
>  2 files changed, 3 insertions(+), 3 deletions(-)
>  create mode 100644 package/docker-engine/50-docker-engine.preset
>
> diff --git a/package/docker-engine/50-docker-engine.preset b/package/docker-engine/50-docker-engine.preset
> new file mode 100644
> index 0000000000..0d8cf35345
> --- /dev/null
> +++ b/package/docker-engine/50-docker-engine.preset
> @@ -0,0 +1 @@
> +disable docker.socket
> diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
> index 6a225ee5f0..8540cda9af 100644
> --- a/package/docker-engine/docker-engine.mk
> +++ b/package/docker-engine/docker-engine.mk
> @@ -68,9 +68,8 @@ define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
>                 $(TARGET_DIR)/usr/lib/systemd/system/docker.service
>         $(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.socket \
>                 $(TARGET_DIR)/usr/lib/systemd/system/docker.socket
> -       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
> -       ln -fs ../../../../usr/lib/systemd/system/docker.service \
> -               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/docker.service
> +       $(INSTALL) -D -m 644 package/docker-engine/50-docker-engine.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-docker-engine.preset
>  endef
>
>  define DOCKER_ENGINE_INSTALL_INIT_SYSV
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 11/15] package/network-manager: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 11/15] package/network-manager: " Jérémy Rosen
@ 2019-11-03 17:30   ` James Hilliard
  2019-11-09 22:14   ` Yann E. MORIN
  1 sibling, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:30 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> NM has three services
> * NetworkManger.service : the main daemon
> * NetworkManger-dispatcher.service : a daemon handling network callbacks
> * NetworkManager-wait-online.service : sync of other services with network-online
>
> Only the first two were activated. We now also enable
> wait-online. Not enabling it was probably a bug.
>
> Note that buildroot adds an alias dbus-org.freedesktop.NetworkManager
> Adding an alias that is not known upstream is not clean,
> but I left it for backward compatibility
We should probably remove it unless there's something known to actually
depend on it.
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/network-manager/network-manager.mk | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/package/network-manager/network-manager.mk b/package/network-manager/network-manager.mk
> index 6412d3a241..67e6a76774 100644
> --- a/package/network-manager/network-manager.mk
> +++ b/package/network-manager/network-manager.mk
> @@ -88,16 +88,9 @@ define NETWORK_MANAGER_INSTALL_INIT_SYSV
>  endef
>
>  define NETWORK_MANAGER_INSTALL_INIT_SYSTEMD
> -       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> -
>         ln -sf /usr/lib/systemd/system/NetworkManager.service \
>                 $(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
>
> -       ln -sf /usr/lib/systemd/system/NetworkManager.service \
> -               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/NetworkManager.service
> -
> -       ln -sf /usr/lib/systemd/system/NetworkManager-dispatcher.service \
> -               $(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
>  endef
>
>  $(eval $(autotools-package))
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 15/15] package/tor: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 15/15] package/tor: " Jérémy Rosen
@ 2019-11-03 17:31   ` James Hilliard
  0 siblings, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:31 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> tor was not enabled, we now need to disable it explicitly
Tor not being enabled seems to be a bug so we should not disable it.
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/tor/50-tor.preset | 1 +
>  package/tor/tor.mk        | 2 ++
>  2 files changed, 3 insertions(+)
>  create mode 100644 package/tor/50-tor.preset
>
> diff --git a/package/tor/50-tor.preset b/package/tor/50-tor.preset
> new file mode 100644
> index 0000000000..8664cb9ca5
> --- /dev/null
> +++ b/package/tor/50-tor.preset
> @@ -0,0 +1 @@
> +disable tor.service
> diff --git a/package/tor/tor.mk b/package/tor/tor.mk
> index 264d8d06da..2785c1a518 100644
> --- a/package/tor/tor.mk
> +++ b/package/tor/tor.mk
> @@ -61,6 +61,8 @@ TOR_POST_INSTALL_TARGET_HOOKS += TOR_INSTALL_CONF
>  define TOR_INSTALL_INIT_SYSTEMD
>         $(INSTALL) -D -m 644 $(@D)/contrib/dist/tor.service \
>                 $(TARGET_DIR)/usr/lib/systemd/system/tor.service
> +       $(INSTALL) -D -m 644 package/tor/50-tor.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-tor.preset
>  endef
>
>  $(eval $(autotools-package))
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 12/15] package/wpa_supplicant: adapt for preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 12/15] package/wpa_supplicant: adapt for preset-all Jérémy Rosen
@ 2019-11-03 17:32   ` James Hilliard
  0 siblings, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:32 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> all services were installed but not enabled.
> This change keeps them that way.
These not being enabled looks to be a bug so we should not disable them.
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/wpa_supplicant/50-wpa_supplicant.preset | 5 +++++
>  package/wpa_supplicant/wpa_supplicant.mk        | 2 ++
>  2 files changed, 7 insertions(+)
>  create mode 100644 package/wpa_supplicant/50-wpa_supplicant.preset
>
> diff --git a/package/wpa_supplicant/50-wpa_supplicant.preset b/package/wpa_supplicant/50-wpa_supplicant.preset
> new file mode 100644
> index 0000000000..ddd339d82f
> --- /dev/null
> +++ b/package/wpa_supplicant/50-wpa_supplicant.preset
> @@ -0,0 +1,5 @@
> +disable wpa_supplicant.service
> +disable wpa_supplicant at .service
> +disable wpa_supplicant-nl80211 at .service
> +disable wpa_supplicant-wired at .service
> +
> diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
> index 9dcebca9bf..42b12b1fb4 100644
> --- a/package/wpa_supplicant/wpa_supplicant.mk
> +++ b/package/wpa_supplicant/wpa_supplicant.mk
> @@ -227,6 +227,8 @@ define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
>                 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-nl80211 at .service
>         $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant-wired at .service \
>                 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-wired at .service
> +       $(INSTALL) -D -m 644 package/wpa_supplicant/50-wpa_supplicant.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-wpa_supplicant.preset
>  endef
>
>  $(eval $(generic-package))
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 13/15] package/sysklogd: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 13/15] package/sysklogd: adapt to preset-all Jérémy Rosen
@ 2019-11-03 17:33   ` James Hilliard
  0 siblings, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:33 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> sysklogd installs two services: syslogd and klogd
> only syslogd is enabled, leave it that way
klogd not being enabled looks to be a bug so we should not disable it
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/sysklogd/50-sysklogd.preset | 1 +
>  package/sysklogd/sysklogd.mk        | 7 ++-----
>  2 files changed, 3 insertions(+), 5 deletions(-)
>  create mode 100644 package/sysklogd/50-sysklogd.preset
>
> diff --git a/package/sysklogd/50-sysklogd.preset b/package/sysklogd/50-sysklogd.preset
> new file mode 100644
> index 0000000000..2f9b19acb5
> --- /dev/null
> +++ b/package/sysklogd/50-sysklogd.preset
> @@ -0,0 +1 @@
> +disable klogd.service
> diff --git a/package/sysklogd/sysklogd.mk b/package/sysklogd/sysklogd.mk
> index 266c171170..c7846d4f50 100644
> --- a/package/sysklogd/sysklogd.mk
> +++ b/package/sysklogd/sysklogd.mk
> @@ -30,11 +30,8 @@ define SYSKLOGD_INSTALL_INIT_SYSTEMD
>                 $(TARGET_DIR)/usr/lib/systemd/system/syslogd.service
>         $(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/klogd.service \
>                 $(TARGET_DIR)/usr/lib/systemd/system/klogd.service
> -       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> -       ln -sf ../../../../usr/lib/systemd/system/syslogd.service \
> -               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslogd.service
> -       ln -sf ../../../usr/lib/systemd/system/syslogd.service \
> -               $(TARGET_DIR)/etc/systemd/system/syslog.service
> +       $(INSTALL) -D -m 644 package/sysklogd/50-sysklogd.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-sysklogd.preset
>  endef
>
>  $(eval $(autotools-package))
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 14/15] package/targetcli-fb: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 14/15] package/targetcli-fb: " Jérémy Rosen
@ 2019-11-03 17:34   ` James Hilliard
  0 siblings, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:34 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> the service was not enabled, we now need to disable it explicitly
Is there a reason we should not have this enabled? It not being enable looks to
be a bug.
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/targetcli-fb/50-targetcli-fb.preset | 1 +
>  package/targetcli-fb/targetcli-fb.mk        | 2 ++
>  2 files changed, 3 insertions(+)
>  create mode 100644 package/targetcli-fb/50-targetcli-fb.preset
>
> diff --git a/package/targetcli-fb/50-targetcli-fb.preset b/package/targetcli-fb/50-targetcli-fb.preset
> new file mode 100644
> index 0000000000..572ee4fb93
> --- /dev/null
> +++ b/package/targetcli-fb/50-targetcli-fb.preset
> @@ -0,0 +1 @@
> +disable target.service.service
> diff --git a/package/targetcli-fb/targetcli-fb.mk b/package/targetcli-fb/targetcli-fb.mk
> index 75643446d2..5e50643bc9 100644
> --- a/package/targetcli-fb/targetcli-fb.mk
> +++ b/package/targetcli-fb/targetcli-fb.mk
> @@ -21,6 +21,8 @@ endef
>  define TARGETCLI_FB_INSTALL_INIT_SYSTEMD
>         $(INSTALL) -m 0644 -D package/targetcli-fb/target.service \
>                 $(TARGET_DIR)/usr/lib/systemd/system/target.service
> +       $(INSTALL) -D -m 644 package/targetcli-fb/50-targetcli-fb.preset \
> +               $(TARGET_DIR)/usr/lib/systemd/system-preset/50-targetcli-fb.preset
>  endef
>
>  # Targetcli stores its configuration in /etc/target/saveconfig.json
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 07/15] package/connman: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 07/15] package/connman: " Jérémy Rosen
@ 2019-11-03 17:39   ` James Hilliard
  2019-11-09 22:11   ` Yann E. MORIN
  1 sibling, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:39 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> connman has two services
> * connman.service which is the real daemon
> * connman-wait-online.service which is a sync point for network-online.target
>
> Only the first one was enabled. This adaptation enables both.
>
> Not enabling connman-wait-online.service is probably a bug
Yes, that seems correct, I had sent in a patch to enable it manually:
https://patchwork.ozlabs.org/patch/1187651/
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/connman/connman.mk | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/package/connman/connman.mk b/package/connman/connman.mk
> index 839bc7a0e2..d70eb1ac82 100644
> --- a/package/connman/connman.mk
> +++ b/package/connman/connman.mk
> @@ -32,12 +32,6 @@ define CONNMAN_INSTALL_INIT_SYSV
>         $(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman
>  endef
>
> -define CONNMAN_INSTALL_INIT_SYSTEMD
> -       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> -       ln -fs ../../../../usr/lib/systemd/system/connman.service \
> -               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
> -endef
> -
>  ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
>  CONNMAN_CONF_OPTS += --enable-client
>  CONNMAN_DEPENDENCIES += readline
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 03/15] fix tty handling
  2019-11-03 16:56 ` [Buildroot] [PATCH 03/15] fix tty handling Jérémy Rosen
@ 2019-11-03 17:48   ` James Hilliard
  2019-11-04 17:08     ` Jérémy ROSEN
  0 siblings, 1 reply; 42+ messages in thread
From: James Hilliard @ 2019-11-03 17:48 UTC (permalink / raw)
  To: buildroot

On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
>
> Handling of tty is a bit tricky, we need to aggressively disable what
> systemd does with tty1 then update for what buildroot wants to do
>
> Rework the whole tty generation to work with presets
>
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  ...e-default-instance-of-getty-.service.patch | 27 +++++++++++++++++++
>  package/systemd/80-buildroot.preset           |  5 ++--
>  package/systemd/systemd.mk                    | 25 ++++++++++++-----
>  3 files changed, 48 insertions(+), 9 deletions(-)
>  create mode 100644 package/systemd/0002-remove-default-instance-of-getty-.service.patch
>
> diff --git a/package/systemd/0002-remove-default-instance-of-getty-.service.patch b/package/systemd/0002-remove-default-instance-of-getty-.service.patch
> new file mode 100644
> index 0000000000..b412620cbd
> --- /dev/null
> +++ b/package/systemd/0002-remove-default-instance-of-getty-.service.patch
> @@ -0,0 +1,27 @@
> +From 77384f2f107ca99fef6a9c0b9d54a3f2147a0d18 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr>
> +Date: Thu, 31 Oct 2019 16:24:02 +0100
> +Subject: [PATCH] remove default instance of getty at .service
> +
> +upstream assumes that tty1 is always a valid tty, this generally makes
> +sense but might not be the case for embedded devices. Having it as a
> +DefaultInstance makes it enabled by "systemctl preset-all"
> +
> +it is simpler for us to remove the DefaultInstance entirely and manually
> +link as needed
Can we make this suitable for inclusion in upstream systemd by making
the DefaultInstance
tty a meson config option instead?
> +---
> + units/getty at .service.m4 | 1 -
> + 1 file changed, 1 deletion(-)
> +
> +diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
> +index 80e793bb73..7060457cb1 100644
> +--- a/units/getty at .service.m4
> ++++ b/units/getty at .service.m4
> +@@ -57,4 +57,3 @@ UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETAR
> +
> + [Install]
> + WantedBy=getty.target
> +-DefaultInstance=tty1
> +--
> +2.24.0.rc1
> +
> diff --git a/package/systemd/80-buildroot.preset b/package/systemd/80-buildroot.preset
> index 4074901cbd..5dbae39173 100644
> --- a/package/systemd/80-buildroot.preset
> +++ b/package/systemd/80-buildroot.preset
> @@ -1,5 +1,4 @@
>  # Higher priority than systemd presets
>
> -# by default systemd enables a getty on tty1
> -# we don't want that because tty1 may not exist
> -disable getty at .service
> +# This file is currently empty, but is available for demonstration and future use
> +
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index d4680cd225..ed039de82b 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -428,22 +428,35 @@ ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
>  # systemd needs getty.service for VTs and serial-getty.service for serial ttys
>  # note that console-getty.service should be used on /dev/console as it should not have dependencies
>  # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
> +#
> +# systemd defaults to only have getty at tty.service enabled
> +# * DefaultInstance=tty1 in getty at service
> +# * no DefaultInstance in serial-getty at .service
> +# * WantedBy=getty.target in console-getty.service
> +# * console-getty is not enabled because of 90-systemd.preset
> +# We want "systemctl preset-all" to do the right thing, even when run on the target after boot
> +# * remove the default instance of getty at .service via a patch on systemd source
> +#   drop-ins cannot override DefaultInstance with an empty string
> +# * set a new DefaultInstance for getty at .service, if needed
> +# * set a new DefaultInstance for serial-getty at .service, if needed
> +# * override the systemd-provided preset for console-getty.service if needed
>  define SYSTEMD_INSTALL_SERVICE_TTY
>         if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
>         then \
>                 TARGET="console-getty.service"; \
> -               LINK_NAME="console-getty.service"; \
> +               echo enable console-getty.service > $(TARGET_DIR)/usr/lib/systemd/system-preset/81-buildroot-tty.preset;\
>         elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
>         then \
>                 TARGET="getty at .service"; \
> -               LINK_NAME="getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
> +               mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d;\
> +               echo [Install] > $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
> +               echo DefaultInstance=$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >> $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
>         else \
>                 TARGET="serial-getty at .service"; \
> -               LINK_NAME="serial-getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
> +               mkdir $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d;\
> +               echo [Install] > $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d/buildroot-console.conf;\
> +               echo DefaultInstance=$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >> $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d/buildroot-console.conf;\
>         fi; \
> -       mkdir -p $(TARGET_DIR)/etc/systemd/system/getty.target.wants/; \
> -       ln -fs ../../../../lib/systemd/system/$${TARGET} \
> -               $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${LINK_NAME}; \
>         if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
>         then \
>                 $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${TARGET}; \
> --
> 2.24.0.rc1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 01/15] new recipe : host-systemd
  2019-11-03 17:20   ` James Hilliard
@ 2019-11-04 17:02     ` Jérémy ROSEN
       [not found]       ` <CAJ4jsafSoX5ayztTZgOS38YPtVZbT7gYkk3FKHQ0U1FDG8u+bA@mail.gmail.com>
  2019-11-09 21:52     ` Yann E. MORIN
  1 sibling, 1 reply; 42+ messages in thread
From: Jérémy ROSEN @ 2019-11-04 17:02 UTC (permalink / raw)
  To: buildroot

I have to admit I have trouble testing/evaluationg the host-side
dependencies.
Systemd needs a kernel >= 3.13 according to the README.
Buildroot has no requirements for the host-side kernel right now, I'm not
really sure how to handle that. Advice welcomed.

Le dim. 3 nov. 2019 ? 18:20, James Hilliard <james.hilliard1@gmail.com> a
?crit :

> Does this depend on a minimum host kernel version? How should we be
> handling that?
>
> On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr>
> wrote:
> >
> > Add the infrastructure to build the host version of systemd
> > * disable all optional features, they can be re-added when needed
> > * systemd has creative way of dealing with cross compile
> >   we build a "normal" host systemd, but install it in $HOST_DIR
> >   we use systemctl --root to correctly act on TARGET_DIR
> > * we need to adjust RPATH using patchelf because meson can't do it
> >   correctly by itsel
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > ---
> >  package/Config.in.host         |  1 +
> >  package/systemd/Config.in.host |  4 ++
> >  package/systemd/systemd.mk     | 92 ++++++++++++++++++++++++++++++++++
> >  3 files changed, 97 insertions(+)
> >  create mode 100644 package/systemd/Config.in.host
> >
> > diff --git a/package/Config.in.host b/package/Config.in.host
> > index c0ac4fbbcc..d4e31ade2d 100644
> > --- a/package/Config.in.host
> > +++ b/package/Config.in.host
> > @@ -69,6 +69,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/systemd/Config.in.host"
> >         source "package/tegrarcm/Config.in.host"
> >         source "package/ti-cgt-pru/Config.in.host"
> >         source "package/uboot-tools/Config.in.host"
> > diff --git a/package/systemd/Config.in.host
> b/package/systemd/Config.in.host
> > new file mode 100644
> > index 0000000000..09099752d2
> > --- /dev/null
> > +++ b/package/systemd/Config.in.host
> > @@ -0,0 +1,4 @@
> > +config BR2_PACKAGE_HOST_SYSTEMD
> > +       bool "host systemd tools"
> > +       help
> > +         Systemd command-line tools for the host
> > diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> > index 94d5f703cd..1e4f706517 100644
> > --- a/package/systemd/systemd.mk
> > +++ b/package/systemd/systemd.mk
> > @@ -550,3 +550,95 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
> >  SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
> >
> >  $(eval $(meson-package))
> > +
> > +
> > +
> > +#
> > +# Host-systemd configuration
> > +#
> > +HOST_SYSTEMD_CONF_OPTS= \
> > +       -Dsplit-bin=true \
> > +       -Dsplit-usr=false \
> > +       -Dutmp=false \
> > +       -Dhibernate=false \
> > +       -Dldconfig=false \
> > +       -Dresolve=false \
> > +       -Defi=false \
> > +       -Dtpm=false \
> > +       -Denvironment-d=false \
> > +       -Dbinfmt=false \
> > +       -Dcoredump=false \
> > +       -Dpstore=false \
> > +       -Dlogind=false \
> > +       -Dhostnamed=false \
> > +       -Dlocaled=false \
> > +       -Dmachined=false \
> > +       -Dportabled=false \
> > +       -Dnetworkd=false \
> > +       -Dtimedated=false \
> > +       -Dtimesyncd=false \
> > +       -Dremote=false \
> > +       -Dcreate-log-dirs=false \
> > +       -Dnss-myhostname=false \
> > +       -Dnss-mymachines=false \
> > +       -Dnss-resolve=false \
> > +       -Dnss-systemd=false \
> > +       -Dfirstboot=false \
> > +       -Drandomseed=false \
> > +       -Dbacklight=false \
> > +       -Dvconsole=false \
> > +       -Dquotacheck=false \
> > +       -Dsysusers=false \
> > +       -Dtmpfiles=false \
> > +       -Dimportd=false \
> > +       -Dhwdb=false \
> > +       -Drfkill=false \
> > +       -Dman=false \
> > +       -Dhtml=false \
> > +       -Dsmack=false \
> > +       -Dpolkit=false \
> > +       -Dblkid=false \
> > +       -Didn=false \
> > +       -Dadm-group=false \
> > +       -Dwheel-group=false \
> > +       -Dzlib=false \
> > +       -Dgshadow=false \
> > +       -Dima=false \
> > +       -Dtests=false \
> > +       -Dglib=false \
> > +       -Dacl=false \
> > +       -Dsysvinit-path='' \
> > +       --prefix=/usr \
> > +       --libdir=lib \
> > +       --sysconfdir=/etc \
> > +       --localstatedir=/var \
> > +
> > +
> > +HOST_SYSTEMD_DEPENDENCIES = \
> > +    host-util-linux \
> > +    host-patchelf \
> > +    host-libcap \
> > +    host-gperf \
> > +
> > +# Fix RPATH After installation
> > +# * systemd provides a install_rpath instruction to meson because the
> binaries need to link with
> > +#   libsystemd which is not in a standard path
> > +# * meson can only replace the RPATH, not append to it
> > +# * the original rpatch is thus lost.
> > +# * the original path had been tweaked by buildroot vial LD_FLAGS to
> add $(HOST_DIR)/lib
> > +# * thus re-tweak rpath after the installation for all binaries that
> need it
> > +#buildroot detects incorrect RPATH, so adding new binaries should be
> safe (it won't compile
> > +#unless properly integrated).
> > +HOST_SYSTEMD_HOST_TOOLS = \
> > +    systemd-analyze  systemd-mount systemctl
> > +
> > +define HOST_SYSTEMD_FIX_RPATH
> > +       $(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \
> > +               $(HOST_DIR)/bin/patchelf --set-rpath
> $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f)
> > +       )
> > +endef
> > +
> > +HOST_SYSTEMD_POST_INSTALL_HOOKS +=  HOST_SYSTEMD_FIX_RPATH
> > +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> > +
> > +$(eval $(host-meson-package))
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
[image: SMILE]  <http://www.smile.eu/>

20 rue des Jardins
92600 Asni?res-sur-Seine
*J?r?my ROSEN*
Architecte technique

[image: email] jeremy.rosen at smile.fr
[image: phone]  +33 6 88 25 87 42
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>

[image: D?couvrez l?univers Smile, rendez-vous sur smile.eu]
<https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191104/6d253beb/attachment.html>

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

* [Buildroot] [PATCH 10/15] package/docker-engine: adapt to preset-all
  2019-11-03 17:25   ` James Hilliard
@ 2019-11-04 17:03     ` Jérémy ROSEN
  0 siblings, 0 replies; 42+ messages in thread
From: Jérémy ROSEN @ 2019-11-04 17:03 UTC (permalink / raw)
  To: buildroot

In that case, it's open to discussion. Enabling both means that it's
started at boot, and the socket enablement does nothing.

Adding the socket means that it would automatically restart, once stopped
on connexions.

Enabling both is harmless, so I'll follow your advice

Le dim. 3 nov. 2019 ? 18:25, James Hilliard <james.hilliard1@gmail.com> a
?crit :

> On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr>
> wrote:
> >
> > docker-engine has two services:
> > * docker.service, if enabled: docker will start at boot
> > * docker.socket, if enabled: docker will start at first connection
> >
> > buildroot currently enables only the service
> > this patch keeps it that way.
> The socket not being enabled looks to be a bug so I don't think it
> should be disabled.
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > ---
> >  package/docker-engine/50-docker-engine.preset | 1 +
> >  package/docker-engine/docker-engine.mk        | 5 ++---
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >  create mode 100644 package/docker-engine/50-docker-engine.preset
> >
> > diff --git a/package/docker-engine/50-docker-engine.preset
> b/package/docker-engine/50-docker-engine.preset
> > new file mode 100644
> > index 0000000000..0d8cf35345
> > --- /dev/null
> > +++ b/package/docker-engine/50-docker-engine.preset
> > @@ -0,0 +1 @@
> > +disable docker.socket
> > diff --git a/package/docker-engine/docker-engine.mk
> b/package/docker-engine/docker-engine.mk
> > index 6a225ee5f0..8540cda9af 100644
> > --- a/package/docker-engine/docker-engine.mk
> > +++ b/package/docker-engine/docker-engine.mk
> > @@ -68,9 +68,8 @@ define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
> >                 $(TARGET_DIR)/usr/lib/systemd/system/docker.service
> >         $(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.socket \
> >                 $(TARGET_DIR)/usr/lib/systemd/system/docker.socket
> > -       mkdir -p
> $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
> > -       ln -fs ../../../../usr/lib/systemd/system/docker.service \
> > -
>  $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/docker.service
> > +       $(INSTALL) -D -m 644
> package/docker-engine/50-docker-engine.preset \
> > +
>  $(TARGET_DIR)/usr/lib/systemd/system-preset/50-docker-engine.preset
> >  endef
> >
> >  define DOCKER_ENGINE_INSTALL_INIT_SYSV
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
[image: SMILE]  <http://www.smile.eu/>

20 rue des Jardins
92600 Asni?res-sur-Seine
*J?r?my ROSEN*
Architecte technique

[image: email] jeremy.rosen at smile.fr
[image: phone]  +33 6 88 25 87 42
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>

[image: D?couvrez l?univers Smile, rendez-vous sur smile.eu]
<https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191104/f8e9e11d/attachment.html>

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

* [Buildroot] [PATCH 03/15] fix tty handling
  2019-11-03 17:48   ` James Hilliard
@ 2019-11-04 17:08     ` Jérémy ROSEN
  0 siblings, 0 replies; 42+ messages in thread
From: Jérémy ROSEN @ 2019-11-04 17:08 UTC (permalink / raw)
  To: buildroot

I submitted a different patch for upstream (
https://github.com/systemd/systemd/pull/13920) which was just accepted, so
we will need to wait for v244 to use it

I am not sure changing that in meson would be accepted upstream:
* tty1 is the only default that makes sense and only embedded devices might
not have a tty1
* the generic case of "static enable of a getty" is pretty complicated
since it can be a tty, a serial-console or the kernel console.
I think overriding the upstream-provided default is the best way to go. But
that's a bit of a matter of taste...


Le dim. 3 nov. 2019 ? 18:48, James Hilliard <james.hilliard1@gmail.com> a
?crit :

> On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr>
> wrote:
> >
> > Handling of tty is a bit tricky, we need to aggressively disable what
> > systemd does with tty1 then update for what buildroot wants to do
> >
> > Rework the whole tty generation to work with presets
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > ---
> >  ...e-default-instance-of-getty-.service.patch | 27 +++++++++++++++++++
> >  package/systemd/80-buildroot.preset           |  5 ++--
> >  package/systemd/systemd.mk                    | 25 ++++++++++++-----
> >  3 files changed, 48 insertions(+), 9 deletions(-)
> >  create mode 100644
> package/systemd/0002-remove-default-instance-of-getty-.service.patch
> >
> > diff --git
> a/package/systemd/0002-remove-default-instance-of-getty-.service.patch
> b/package/systemd/0002-remove-default-instance-of-getty-.service.patch
> > new file mode 100644
> > index 0000000000..b412620cbd
> > --- /dev/null
> > +++
> b/package/systemd/0002-remove-default-instance-of-getty-.service.patch
> > @@ -0,0 +1,27 @@
> > +From 77384f2f107ca99fef6a9c0b9d54a3f2147a0d18 Mon Sep 17 00:00:00 2001
> > +From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr>
> > +Date: Thu, 31 Oct 2019 16:24:02 +0100
> > +Subject: [PATCH] remove default instance of getty at .service
> > +
> > +upstream assumes that tty1 is always a valid tty, this generally makes
> > +sense but might not be the case for embedded devices. Having it as a
> > +DefaultInstance makes it enabled by "systemctl preset-all"
> > +
> > +it is simpler for us to remove the DefaultInstance entirely and manually
> > +link as needed
> Can we make this suitable for inclusion in upstream systemd by making
> the DefaultInstance
> tty a meson config option instead?
> > +---
> > + units/getty at .service.m4 | 1 -
> > + 1 file changed, 1 deletion(-)
> > +
> > +diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
> > +index 80e793bb73..7060457cb1 100644
> > +--- a/units/getty at .service.m4
> > ++++ b/units/getty at .service.m4
> > +@@ -57,4 +57,3 @@ UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC
> LC_TIME LC_COLLATE LC_MONETAR
> > +
> > + [Install]
> > + WantedBy=getty.target
> > +-DefaultInstance=tty1
> > +--
> > +2.24.0.rc1
> > +
> > diff --git a/package/systemd/80-buildroot.preset
> b/package/systemd/80-buildroot.preset
> > index 4074901cbd..5dbae39173 100644
> > --- a/package/systemd/80-buildroot.preset
> > +++ b/package/systemd/80-buildroot.preset
> > @@ -1,5 +1,4 @@
> >  # Higher priority than systemd presets
> >
> > -# by default systemd enables a getty on tty1
> > -# we don't want that because tty1 may not exist
> > -disable getty at .service
> > +# This file is currently empty, but is available for demonstration and
> future use
> > +
> > diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> > index d4680cd225..ed039de82b 100644
> > --- a/package/systemd/systemd.mk
> > +++ b/package/systemd/systemd.mk
> > @@ -428,22 +428,35 @@ ifneq ($(call
> qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
> >  # systemd needs getty.service for VTs and serial-getty.service for
> serial ttys
> >  # note that console-getty.service should be used on /dev/console as it
> should not have dependencies
> >  # also patch the file to use the correct baud-rate, the default
> baudrate is 115200 so look for that
> > +#
> > +# systemd defaults to only have getty at tty.service enabled
> > +# * DefaultInstance=tty1 in getty at service
> > +# * no DefaultInstance in serial-getty at .service
> > +# * WantedBy=getty.target in console-getty.service
> > +# * console-getty is not enabled because of 90-systemd.preset
> > +# We want "systemctl preset-all" to do the right thing, even when run
> on the target after boot
> > +# * remove the default instance of getty at .service via a patch on
> systemd source
> > +#   drop-ins cannot override DefaultInstance with an empty string
> > +# * set a new DefaultInstance for getty at .service, if needed
> > +# * set a new DefaultInstance for serial-getty at .service, if needed
> > +# * override the systemd-provided preset for console-getty.service if
> needed
> >  define SYSTEMD_INSTALL_SERVICE_TTY
> >         if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
> >         then \
> >                 TARGET="console-getty.service"; \
> > -               LINK_NAME="console-getty.service"; \
> > +               echo enable console-getty.service >
> $(TARGET_DIR)/usr/lib/systemd/system-preset/81-buildroot-tty.preset;\
> >         elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q
> 'tty[0-9]*$$'; \
> >         then \
> >                 TARGET="getty at .service"; \
> > -               LINK_NAME="getty@$(call
> qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
> > +               mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty@
> .service.d;\
> > +               echo [Install] >
> $(TARGET_DIR)/usr/lib/systemd/system/getty@
> .service.d/buildroot-console.conf;\
> > +               echo DefaultInstance=$(call
> qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >>
> $(TARGET_DIR)/usr/lib/systemd/system/getty@
> .service.d/buildroot-console.conf;\
> >         else \
> >                 TARGET="serial-getty at .service"; \
> > -               LINK_NAME="serial-getty@$(call
> qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
> > +               mkdir $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@
> .service.d;\
> > +               echo [Install] >
> $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@
> .service.d/buildroot-console.conf;\
> > +               echo DefaultInstance=$(call
> qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >>
> $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@
> .service.d/buildroot-console.conf;\
> >         fi; \
> > -       mkdir -p $(TARGET_DIR)/etc/systemd/system/getty.target.wants/; \
> > -       ln -fs ../../../../lib/systemd/system/$${TARGET} \
> > -
>  $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${LINK_NAME}; \
> >         if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ]
> ; \
> >         then \
> >                 $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),'
> $(TARGET_DIR)/lib/systemd/system/$${TARGET}; \
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
[image: SMILE]  <http://www.smile.eu/>

20 rue des Jardins
92600 Asni?res-sur-Seine
*J?r?my ROSEN*
Architecte technique

[image: email] jeremy.rosen at smile.fr
[image: phone]  +33 6 88 25 87 42
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>

[image: D?couvrez l?univers Smile, rendez-vous sur smile.eu]
<https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191104/b631f738/attachment.html>

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

* [Buildroot] [PATCH 01/15] new recipe : host-systemd
       [not found]         ` <CAFvCimWyMdTTZDxv3EyKDaHGXhrzOd2brLSe+BgbuU9oxJ3S8A@mail.gmail.com>
@ 2019-11-04 20:40           ` Carlos Santos
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos Santos @ 2019-11-04 20:40 UTC (permalink / raw)
  To: buildroot

[adding back the list to the conversation]

On Mon, Nov 4, 2019 at 3:53 PM J?r?my ROSEN <jeremy.rosen@smile.fr> wrote:
>
> Does systemd have a general policy with regard to that ?
>
> How old is the limit for the build system itself ?

I don't know for sure but given the versions of host patch and
coreutils that are still supported (check commits
bef2a36d1f2f49bb50de33affea5a18b0b0b68d7 and
ef60ef83c9e27899666c3c093007208c1203b3e1) I guess Debian 7 and Ubuntu
14.04 are still used.

>
> Le lun. 4 nov. 2019 ? 19:40, Carlos Santos <unixmania@gmail.com> a ?crit :
>>
>> On Mon, Nov 4, 2019 at 2:02 PM J?r?my ROSEN <jeremy.rosen@smile.fr> wrote:
>> >
>> > I have to admit I have trouble testing/evaluationg the host-side dependencies.
>> > Systemd needs a kernel >= 3.13 according to the README.
>> > Buildroot has no requirements for the host-side kernel right now, I'm not really sure how to handle that. Advice welcomed.
>> >
>>
>> [flipping to plain text email]
>>
>> Requiring a kernel >= 3.13 will prevent building on RHEL/CentOS 7,
>> which may be a too drastic restriction.
>>
>> --
>> Carlos Santos <unixmania@gmail.com>
>

-- 
Carlos Santos <unixmania@gmail.com>

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

* [Buildroot] [PATCH 01/15] new recipe : host-systemd
  2019-11-03 16:56 ` [Buildroot] [PATCH 01/15] new recipe : host-systemd Jérémy Rosen
  2019-11-03 17:20   ` James Hilliard
@ 2019-11-09 21:49   ` Yann E. MORIN
  2019-11-10 10:43     ` Jérémy ROSEN
  1 sibling, 1 reply; 42+ messages in thread
From: Yann E. MORIN @ 2019-11-09 21:49 UTC (permalink / raw)
  To: buildroot

J?r?my, All,

On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> Add the infrastructure to build the host version of systemd
> * disable all optional features, they can be re-added when needed
> * systemd has creative way of dealing with cross compile
>   we build a "normal" host systemd, but install it in $HOST_DIR
>   we use systemctl --root to correctly act on TARGET_DIR
> * we need to adjust RPATH using patchelf because meson can't do it
>   correctly by itsel
> 
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
[--SNIP--]
> diff --git a/package/systemd/Config.in.host b/package/systemd/Config.in.host
> new file mode 100644
> index 0000000000..09099752d2
> --- /dev/null
> +++ b/package/systemd/Config.in.host
> @@ -0,0 +1,4 @@
> +config BR2_PACKAGE_HOST_SYSTEMD
> +	bool "host systemd tools"
> +	help
> +	  Systemd command-line tools for the host

I don;t think we (at the current point) need a user-visible option.

This host-systemd is initially a way to get systemctl only, and this is
just internal to how Buildroot will enable the units (by using systemctl
preset-all or so).

Later, if/when it becomes possible to build extra utilities for users to
manually run (or in a post-build/image script), then we can expose a
user-visible host-systemd option.

But for now, it is not needed.

> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 94d5f703cd..1e4f706517 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -550,3 +550,95 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
>  SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
>  
>  $(eval $(meson-package))
> +
> +
> +

Too many empty lines. Run 'make check-package'.

> +#
> +# Host-systemd configuration
> +#
> +HOST_SYSTEMD_CONF_OPTS= \
> +	-Dsplit-bin=true \
> +	-Dsplit-usr=false \
> +	-Dutmp=false \
> +	-Dhibernate=false \
> +	-Dldconfig=false \
> +	-Dresolve=false \
[--SNIP--]
> +	-Dsysvinit-path='' \
> +	--prefix=/usr \
> +	--libdir=lib \
> +	--sysconfdir=/etc \
> +	--localstatedir=/var \

This list will be difficult to maintain on each version bump... :-(
Can't we push for upstream to implement a simple switch:
--disable-all-that-is-not-explicitly-enabled-please-and-i-d-like-a-pony-too-pretty-please

> +
> +HOST_SYSTEMD_DEPENDENCIES = \
> +    host-util-linux \
> +    host-patchelf \
> +    host-libcap \
> +    host-gperf \
> +
> +# Fix RPATH After installation
> +# * systemd provides a install_rpath instruction to meson because the binaries need to link with
> +#   libsystemd which is not in a standard path
> +# * meson can only replace the RPATH, not append to it
> +# * the original rpatch is thus lost. 
> +# * the original path had been tweaked by buildroot vial LD_FLAGS to add $(HOST_DIR)/lib
> +# * thus re-tweak rpath after the installation for all binaries that need it
> +#buildroot detects incorrect RPATH, so adding new binaries should be safe (it won't compile 
> +#unless properly integrated).
> +HOST_SYSTEMD_HOST_TOOLS = \
> +    systemd-analyze  systemd-mount systemctl

Once again, I think we should just keep systemctl for now: remove
everything else. We just need systemctl for now.

We can then *later* add those (esp. analyse).

> +define HOST_SYSTEMD_FIX_RPATH
> +	$(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \
> +		$(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f)

It is not possible to make an RPATH longer than it previously was. How
can we ensure that the rpath that is set by meson will be big enough to
later cary our own rpath?

Regards,
Yann E. MORIN.

> +	)
> +endef
> +
> +HOST_SYSTEMD_POST_INSTALL_HOOKS +=  HOST_SYSTEMD_FIX_RPATH
> +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> +
> +$(eval $(host-meson-package))
> -- 
> 2.24.0.rc1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 01/15] new recipe : host-systemd
  2019-11-03 17:20   ` James Hilliard
  2019-11-04 17:02     ` Jérémy ROSEN
@ 2019-11-09 21:52     ` Yann E. MORIN
  1 sibling, 0 replies; 42+ messages in thread
From: Yann E. MORIN @ 2019-11-09 21:52 UTC (permalink / raw)
  To: buildroot

James, J?r?my, All,

On 2019-11-03 12:20 -0500, James Hilliard spake thusly:
> Does this depend on a minimum host kernel version? How should we be
> handling that?

So I mulled over that one for a little while...

AFAIK, the headers version is especially usfull for a few things in
systemd that we are not interested in and do not build (or need not
build) for our host-systemd:
  - udevd
  - the spwaning of services in namespaces and control groups nad
    whatnot
  - maybe a few other things.

But systemctl should be exempt from any such requirement.

So, as long as we can do a very trimmed-down build, we should not have
to worry too much about the host kernel headers...

(Famous Last Words (TM))

Regards,
Yann E. MORIN.

> On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen <jeremy.rosen@smile.fr> wrote:
> >
> > Add the infrastructure to build the host version of systemd
> > * disable all optional features, they can be re-added when needed
> > * systemd has creative way of dealing with cross compile
> >   we build a "normal" host systemd, but install it in $HOST_DIR
> >   we use systemctl --root to correctly act on TARGET_DIR
> > * we need to adjust RPATH using patchelf because meson can't do it
> >   correctly by itsel
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > ---
> >  package/Config.in.host         |  1 +
> >  package/systemd/Config.in.host |  4 ++
> >  package/systemd/systemd.mk     | 92 ++++++++++++++++++++++++++++++++++
> >  3 files changed, 97 insertions(+)
> >  create mode 100644 package/systemd/Config.in.host
> >
> > diff --git a/package/Config.in.host b/package/Config.in.host
> > index c0ac4fbbcc..d4e31ade2d 100644
> > --- a/package/Config.in.host
> > +++ b/package/Config.in.host
> > @@ -69,6 +69,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/systemd/Config.in.host"
> >         source "package/tegrarcm/Config.in.host"
> >         source "package/ti-cgt-pru/Config.in.host"
> >         source "package/uboot-tools/Config.in.host"
> > diff --git a/package/systemd/Config.in.host b/package/systemd/Config.in.host
> > new file mode 100644
> > index 0000000000..09099752d2
> > --- /dev/null
> > +++ b/package/systemd/Config.in.host
> > @@ -0,0 +1,4 @@
> > +config BR2_PACKAGE_HOST_SYSTEMD
> > +       bool "host systemd tools"
> > +       help
> > +         Systemd command-line tools for the host
> > diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> > index 94d5f703cd..1e4f706517 100644
> > --- a/package/systemd/systemd.mk
> > +++ b/package/systemd/systemd.mk
> > @@ -550,3 +550,95 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
> >  SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
> >
> >  $(eval $(meson-package))
> > +
> > +
> > +
> > +#
> > +# Host-systemd configuration
> > +#
> > +HOST_SYSTEMD_CONF_OPTS= \
> > +       -Dsplit-bin=true \
> > +       -Dsplit-usr=false \
> > +       -Dutmp=false \
> > +       -Dhibernate=false \
> > +       -Dldconfig=false \
> > +       -Dresolve=false \
> > +       -Defi=false \
> > +       -Dtpm=false \
> > +       -Denvironment-d=false \
> > +       -Dbinfmt=false \
> > +       -Dcoredump=false \
> > +       -Dpstore=false \
> > +       -Dlogind=false \
> > +       -Dhostnamed=false \
> > +       -Dlocaled=false \
> > +       -Dmachined=false \
> > +       -Dportabled=false \
> > +       -Dnetworkd=false \
> > +       -Dtimedated=false \
> > +       -Dtimesyncd=false \
> > +       -Dremote=false \
> > +       -Dcreate-log-dirs=false \
> > +       -Dnss-myhostname=false \
> > +       -Dnss-mymachines=false \
> > +       -Dnss-resolve=false \
> > +       -Dnss-systemd=false \
> > +       -Dfirstboot=false \
> > +       -Drandomseed=false \
> > +       -Dbacklight=false \
> > +       -Dvconsole=false \
> > +       -Dquotacheck=false \
> > +       -Dsysusers=false \
> > +       -Dtmpfiles=false \
> > +       -Dimportd=false \
> > +       -Dhwdb=false \
> > +       -Drfkill=false \
> > +       -Dman=false \
> > +       -Dhtml=false \
> > +       -Dsmack=false \
> > +       -Dpolkit=false \
> > +       -Dblkid=false \
> > +       -Didn=false \
> > +       -Dadm-group=false \
> > +       -Dwheel-group=false \
> > +       -Dzlib=false \
> > +       -Dgshadow=false \
> > +       -Dima=false \
> > +       -Dtests=false \
> > +       -Dglib=false \
> > +       -Dacl=false \
> > +       -Dsysvinit-path='' \
> > +       --prefix=/usr \
> > +       --libdir=lib \
> > +       --sysconfdir=/etc \
> > +       --localstatedir=/var \
> > +
> > +
> > +HOST_SYSTEMD_DEPENDENCIES = \
> > +    host-util-linux \
> > +    host-patchelf \
> > +    host-libcap \
> > +    host-gperf \
> > +
> > +# Fix RPATH After installation
> > +# * systemd provides a install_rpath instruction to meson because the binaries need to link with
> > +#   libsystemd which is not in a standard path
> > +# * meson can only replace the RPATH, not append to it
> > +# * the original rpatch is thus lost.
> > +# * the original path had been tweaked by buildroot vial LD_FLAGS to add $(HOST_DIR)/lib
> > +# * thus re-tweak rpath after the installation for all binaries that need it
> > +#buildroot detects incorrect RPATH, so adding new binaries should be safe (it won't compile
> > +#unless properly integrated).
> > +HOST_SYSTEMD_HOST_TOOLS = \
> > +    systemd-analyze  systemd-mount systemctl
> > +
> > +define HOST_SYSTEMD_FIX_RPATH
> > +       $(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \
> > +               $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f)
> > +       )
> > +endef
> > +
> > +HOST_SYSTEMD_POST_INSTALL_HOOKS +=  HOST_SYSTEMD_FIX_RPATH
> > +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> > +
> > +$(eval $(host-meson-package))
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all
  2019-11-03 17:17     ` Jérémy ROSEN
@ 2019-11-09 22:08       ` Yann E. MORIN
  0 siblings, 0 replies; 42+ messages in thread
From: Yann E. MORIN @ 2019-11-09 22:08 UTC (permalink / raw)
  To: buildroot

J?r?my, All,

On 2019-11-03 18:17 +0100, J?r?my ROSEN spake thusly:
> that's probably correct, but I tried to be compatible.
> Dropping that patch will do "the correct thing"

I understand your position, and it is sensible.

However, doing it after the patch that calls systemctl preset-all. means
that from patch 2 to 5, avahi is enabled at boot.

So, we have two options here:

 1. move this avahi patch before using systemctl preset-all
 2. consider that systemctl prest-all is also a fix for incorrectly
    registered service files, and thus in patch 2 add a blurb in the
    commit log: "And this also properly registers services installed
    by other packages".

I am fine with either option, but I'd favour (2): if the user has
enabled a package, that's not for the size increase alone; it is most
probably because it needs the features of that package, so it makes
sense to enable the services.

So, I would be in favour if dropping that patch, indeed.

Regards,
Yann E. MORIN.

> Le?dim. 3 nov. 2019 ??18:15, James Hilliard < [1]james.hilliard1@gmail.com> a ?crit?:
> 
>   On Sun, Nov 3, 2019 at 11:57 AM J?r?my Rosen < [2]jeremy.rosen@smile.fr> wrote:
>   >
>   > avahi was not enabled, we now need to disable it explicitly
>   Isn't avahi not being enabled a bug? Why do we want to have it disabled?
>   >
>   > Signed-off-by: J?r?my Rosen < [3]jeremy.rosen@smile.fr>
>   > ---
>   >? package/avahi/50-avahi.preset | 3 +++
>   >? package/avahi/ [4]avahi.mk? ? ? ? | 2 ++
>   >? 2 files changed, 5 insertions(+)
>   >? create mode 100644 package/avahi/50-avahi.preset
>   >
>   > diff --git a/package/avahi/50-avahi.preset b/package/avahi/50-avahi.preset
>   > new file mode 100644
>   > index 0000000000..998772ea96
>   > --- /dev/null
>   > +++ b/package/avahi/50-avahi.preset
>   > @@ -0,0 +1,3 @@
>   > +disable avahi-daemon.service
>   > +disable avahi-daemon.socket
>   > +disable avahi-dnsconfd.service
>   > diff --git a/package/avahi/ [5]avahi.mk b/package/avahi/ [6]avahi.mk
>   > index 53021f6b6d..2df63c5273 100644
>   > --- a/package/avahi/ [7]avahi.mk
>   > +++ b/package/avahi/ [8]avahi.mk
>   > @@ -198,6 +198,8 @@ endef
>   >? endif
>   >
>   >? define AVAHI_INSTALL_INIT_SYSTEMD
>   > +? ? ? ?$(INSTALL) -D -m 644 package/avahi/50-avahi.preset \
>   > +? ? ? ? ? ? ? ?$(TARGET_DIR)/usr/lib/systemd/system-preset/50-avahi.preset
>   >? ? ? ? ?$(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
>   >? ? ? ? ? ? ? ? ?$(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
>   >
>   > --
>   > 2.24.0.rc1
>   >
>   > _______________________________________________
>   > buildroot mailing list
>   > [9]buildroot at busybox.net
>   > [10]http://lists.busybox.net/mailman/listinfo/buildroot
> 
> --
> 
> +-----------------------------------------------------------------------------------------------------------------------+
> |                               | J?r?my ROSEN                                                                |
> | [11]3D"SMILE"[12] ?      | Architecte technique                                                                  |
> |                               | [13]3D"email" ? [14]jeremy.rosen at smile.fr?                                  |
> | 20 rue des Jardins            | [15]3D"phone" ? +33 6 88 25 87 42?                                          |
> | 92600 Asni?res-sur-Seine | [16]3D"url" ? [17]http://www.smile.eu                                            |
> |                               | [18]3D"Twitter" ? [19]3D"Facebook" ? [20]3D"LinkedIn" ? [21]3D"Github" |
> +-----------------------------------------------------------------------------------------------------------------------+
> 
> [22]3D"D?couvrez
> 
> Links:
> 1. mailto:james.hilliard1 at gmail.com
> 2. mailto:jeremy.rosen at smile.fr
> 3. mailto:jeremy.rosen at smile.fr
> 4. http://avahi.mk
> 5. http://avahi.mk
> 6. http://avahi.mk
> 7. http://avahi.mk
> 8. http://avahi.mk
> 9. mailto:buildroot at busybox.net
> 10. http://lists.busybox.net/mailman/listinfo/buildroot
> 11. http://www.smile.eu/
> 12. http://www.smile.eu/
> 13. Image: http://ftp.smile.fr/client/Communication/signature/img/mail.png
> 14. mailto:jeremy.rosen at smile.fr
> 15. Image: http://ftp.smile.fr/client/Communication/signature/img/phone.png
> 16. Image: http://ftp.smile.fr/client/Communication/signature/img/web.png
> 17. http://www.smile.eu/
> 18. https://twitter.com/GroupeSmile
> 19. https://www.facebook.com/smileopensource
> 20. https://www.linkedin.com/company/smile
> 21. https://github.com/Smile-SA
> 22. https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature

> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot


-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 07/15] package/connman: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 07/15] package/connman: " Jérémy Rosen
  2019-11-03 17:39   ` James Hilliard
@ 2019-11-09 22:11   ` Yann E. MORIN
  2019-11-09 22:36     ` James Hilliard
  1 sibling, 1 reply; 42+ messages in thread
From: Yann E. MORIN @ 2019-11-09 22:11 UTC (permalink / raw)
  To: buildroot

J?r?my, All,

On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> connman has two services
> * connman.service which is the real daemon
> * connman-wait-online.service which is a sync point for network-online.target
> 
> Only the first one was enabled. This adaptation enables both.
> 
> Not enabling connman-wait-online.service is probably a bug

Actually no, that's not a bug; not enabling it is a privacy feature.
Some people are concerned about the phone-home-alike that check-online
may do.

Regards,
Yann E. MORIN.

> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/connman/connman.mk | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/package/connman/connman.mk b/package/connman/connman.mk
> index 839bc7a0e2..d70eb1ac82 100644
> --- a/package/connman/connman.mk
> +++ b/package/connman/connman.mk
> @@ -32,12 +32,6 @@ define CONNMAN_INSTALL_INIT_SYSV
>  	$(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman
>  endef
>  
> -define CONNMAN_INSTALL_INIT_SYSTEMD
> -	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> -	ln -fs ../../../../usr/lib/systemd/system/connman.service \
> -		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
> -endef
> -
>  ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
>  CONNMAN_CONF_OPTS += --enable-client
>  CONNMAN_DEPENDENCIES += readline
> -- 
> 2.24.0.rc1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 11/15] package/network-manager: adapt to preset-all
  2019-11-03 16:56 ` [Buildroot] [PATCH 11/15] package/network-manager: " Jérémy Rosen
  2019-11-03 17:30   ` James Hilliard
@ 2019-11-09 22:14   ` Yann E. MORIN
  2019-11-09 22:25     ` James Hilliard
  1 sibling, 1 reply; 42+ messages in thread
From: Yann E. MORIN @ 2019-11-09 22:14 UTC (permalink / raw)
  To: buildroot

J?r?my, All,

On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> NM has three services
> * NetworkManger.service : the main daemon
> * NetworkManger-dispatcher.service : a daemon handling network callbacks
> * NetworkManager-wait-online.service : sync of other services with network-online
> 
> Only the first two were activated. We now also enable
> wait-online. Not enabling it was probably a bug.

Same as for connman: it was intentional that this was not enabled.

And besides the privacy concerns, some devices are never exposed to the
real internet, and always only ever stay on closed networkd, so
wait-online could not phone home to detect connectivity anyway.

Regards,
Yann E. MORIN.

> Note that buildroot adds an alias dbus-org.freedesktop.NetworkManager
> Adding an alias that is not known upstream is not clean,
> but I left it for backward compatibility
> 
> Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> ---
>  package/network-manager/network-manager.mk | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/package/network-manager/network-manager.mk b/package/network-manager/network-manager.mk
> index 6412d3a241..67e6a76774 100644
> --- a/package/network-manager/network-manager.mk
> +++ b/package/network-manager/network-manager.mk
> @@ -88,16 +88,9 @@ define NETWORK_MANAGER_INSTALL_INIT_SYSV
>  endef
>  
>  define NETWORK_MANAGER_INSTALL_INIT_SYSTEMD
> -	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> -
>  	ln -sf /usr/lib/systemd/system/NetworkManager.service \
>  		$(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
>  
> -	ln -sf /usr/lib/systemd/system/NetworkManager.service \
> -		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/NetworkManager.service
> -
> -	ln -sf /usr/lib/systemd/system/NetworkManager-dispatcher.service \
> -		$(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
>  endef
>  
>  $(eval $(autotools-package))
> -- 
> 2.24.0.rc1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 11/15] package/network-manager: adapt to preset-all
  2019-11-09 22:14   ` Yann E. MORIN
@ 2019-11-09 22:25     ` James Hilliard
  0 siblings, 0 replies; 42+ messages in thread
From: James Hilliard @ 2019-11-09 22:25 UTC (permalink / raw)
  To: buildroot

On Sat, Nov 9, 2019 at 3:14 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> J?r?my, All,
>
> On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> > NM has three services
> > * NetworkManger.service : the main daemon
> > * NetworkManger-dispatcher.service : a daemon handling network callbacks
> > * NetworkManager-wait-online.service : sync of other services with network-online
> >
> > Only the first two were activated. We now also enable
> > wait-online. Not enabling it was probably a bug.
>
> Same as for connman: it was intentional that this was not enabled.
>
> And besides the privacy concerns, some devices are never exposed to the
> real internet, and always only ever stay on closed networkd, so
> wait-online could not phone home to detect connectivity anyway.
I don't think that is actually how it works, AFAICT it just waits for
networkmanager startup, see here:
https://github.com/NetworkManager/NetworkManager/blob/1.20.6/data/NetworkManager-wait-online.service.in#L10
per nm-online help:
-s, --wait-for-startup      Wait for NetworkManager startup instead of
a connection
>
> Regards,
> Yann E. MORIN.
>
> > Note that buildroot adds an alias dbus-org.freedesktop.NetworkManager
> > Adding an alias that is not known upstream is not clean,
> > but I left it for backward compatibility
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > ---
> >  package/network-manager/network-manager.mk | 7 -------
> >  1 file changed, 7 deletions(-)
> >
> > diff --git a/package/network-manager/network-manager.mk b/package/network-manager/network-manager.mk
> > index 6412d3a241..67e6a76774 100644
> > --- a/package/network-manager/network-manager.mk
> > +++ b/package/network-manager/network-manager.mk
> > @@ -88,16 +88,9 @@ define NETWORK_MANAGER_INSTALL_INIT_SYSV
> >  endef
> >
> >  define NETWORK_MANAGER_INSTALL_INIT_SYSTEMD
> > -     mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> > -
> >       ln -sf /usr/lib/systemd/system/NetworkManager.service \
> >               $(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
> >
> > -     ln -sf /usr/lib/systemd/system/NetworkManager.service \
> > -             $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/NetworkManager.service
> > -
> > -     ln -sf /usr/lib/systemd/system/NetworkManager-dispatcher.service \
> > -             $(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
> >  endef
> >
> >  $(eval $(autotools-package))
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 07/15] package/connman: adapt to preset-all
  2019-11-09 22:11   ` Yann E. MORIN
@ 2019-11-09 22:36     ` James Hilliard
  2019-11-10 10:19       ` Jérémy ROSEN
  0 siblings, 1 reply; 42+ messages in thread
From: James Hilliard @ 2019-11-09 22:36 UTC (permalink / raw)
  To: buildroot

On Sat, Nov 9, 2019 at 3:11 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> J?r?my, All,
>
> On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> > connman has two services
> > * connman.service which is the real daemon
> > * connman-wait-online.service which is a sync point for network-online.target
> >
> > Only the first one was enabled. This adaptation enables both.
> >
> > Not enabling connman-wait-online.service is probably a bug
>
> Actually no, that's not a bug; not enabling it is a privacy feature.
> Some people are concerned about the phone-home-alike that check-online
> may do.
I don't think connman-wait-online.service phones home, it appears to wait for
an interface to be live which should not impact privacy.
See:
https://git.kernel.org/pub/scm/network/connman/connman.git/tree/src/connman-wait-online.service.in?h=1.37&id=caf6895ee2ea3b6ed58213ca8bacd0ec32f7e31c#n11
https://git.kernel.org/pub/scm/network/connman/connman.git/tree/src/connmand-wait-online.c
According to: https://01.org/connman/blogs/pflykt/2015/connman-1.31
connmand-wait-online works exactly like systemd-networkd-wait-online
which does not appear to phone home per:
https://www.freedesktop.org/software/systemd/man/systemd-networkd-wait-online.service.html
but rather waits until the interface is online.
>
> Regards,
> Yann E. MORIN.
>
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > ---
> >  package/connman/connman.mk | 6 ------
> >  1 file changed, 6 deletions(-)
> >
> > diff --git a/package/connman/connman.mk b/package/connman/connman.mk
> > index 839bc7a0e2..d70eb1ac82 100644
> > --- a/package/connman/connman.mk
> > +++ b/package/connman/connman.mk
> > @@ -32,12 +32,6 @@ define CONNMAN_INSTALL_INIT_SYSV
> >       $(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman
> >  endef
> >
> > -define CONNMAN_INSTALL_INIT_SYSTEMD
> > -     mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> > -     ln -fs ../../../../usr/lib/systemd/system/connman.service \
> > -             $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
> > -endef
> > -
> >  ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
> >  CONNMAN_CONF_OPTS += --enable-client
> >  CONNMAN_DEPENDENCIES += readline
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 07/15] package/connman: adapt to preset-all
  2019-11-09 22:36     ` James Hilliard
@ 2019-11-10 10:19       ` Jérémy ROSEN
  0 siblings, 0 replies; 42+ messages in thread
From: Jérémy ROSEN @ 2019-11-10 10:19 UTC (permalink / raw)
  To: buildroot

Yes, the whole "*-wait-online" mechanism is a boot synchronisation thing.

The point is to delay starting of all network-facing daemon until
* either the network is up (DHCP dialog is done)
* or the network has failed (and won't be brought up at all during boot)

The exact implementation depends on your network-manager, so it might be
different
for NetworkManager, connman or systemd-networkd.

That being said, I have never heard of any of those "phoning home" They
just wait for the
end of the network configuration.

Moreover, since sysV, network-facing daemons have always been delayed after
the
network was up (through unit.d file ordering) and changing that might break
things in
subtle ways.

I'm pretty sure it's a bug, I'll leave them enable for v2, but we can
discuss it some more if you want...


Le sam. 9 nov. 2019 ? 23:36, James Hilliard <james.hilliard1@gmail.com> a
?crit :

> On Sat, Nov 9, 2019 at 3:11 PM Yann E. MORIN <yann.morin.1998@free.fr>
> wrote:
> >
> > J?r?my, All,
> >
> > On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> > > connman has two services
> > > * connman.service which is the real daemon
> > > * connman-wait-online.service which is a sync point for
> network-online.target
> > >
> > > Only the first one was enabled. This adaptation enables both.
> > >
> > > Not enabling connman-wait-online.service is probably a bug
> >
> > Actually no, that's not a bug; not enabling it is a privacy feature.
> > Some people are concerned about the phone-home-alike that check-online
> > may do.
> I don't think connman-wait-online.service phones home, it appears to wait
> for
> an interface to be live which should not impact privacy.
> See:
>
> https://git.kernel.org/pub/scm/network/connman/connman.git/tree/src/connman-wait-online.service.in?h=1.37&id=caf6895ee2ea3b6ed58213ca8bacd0ec32f7e31c#n11
>
> https://git.kernel.org/pub/scm/network/connman/connman.git/tree/src/connmand-wait-online.c
> According to: https://01.org/connman/blogs/pflykt/2015/connman-1.31
> connmand-wait-online
> <https://01.org/connman/blogs/pflykt/2015/connman-1.31connmand-wait-online>
> works exactly like systemd-networkd-wait-online
> which does not appear to phone home per:
>
> https://www.freedesktop.org/software/systemd/man/systemd-networkd-wait-online.service.html
> but rather waits until the interface is online.
> >
> > Regards,
> > Yann E. MORIN.
> >
> > > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> > > ---
> > >  package/connman/connman.mk | 6 ------
> > >  1 file changed, 6 deletions(-)
> > >
> > > diff --git a/package/connman/connman.mk b/package/connman/connman.mk
> > > index 839bc7a0e2..d70eb1ac82 100644
> > > --- a/package/connman/connman.mk
> > > +++ b/package/connman/connman.mk
> > > @@ -32,12 +32,6 @@ define CONNMAN_INSTALL_INIT_SYSV
> > >       $(INSTALL) -m 0755 -D package/connman/S45connman
> $(TARGET_DIR)/etc/init.d/S45connman
> > >  endef
> > >
> > > -define CONNMAN_INSTALL_INIT_SYSTEMD
> > > -     mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> > > -     ln -fs ../../../../usr/lib/systemd/system/connman.service \
> > > -
>  $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
> > > -endef
> > > -
> > >  ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
> > >  CONNMAN_CONF_OPTS += --enable-client
> > >  CONNMAN_DEPENDENCIES += readline
> > > --
> > > 2.24.0.rc1
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot at busybox.net
> > > http://lists.busybox.net/mailman/listinfo/buildroot
> >
> > --
> >
> .-----------------.--------------------.------------------.--------------------.
> > |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> > | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>        |
> > | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There
> is no  |
> > | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
> >
> '------------------------------^-------^------------------^--------------------'
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
[image: SMILE]  <http://www.smile.eu/>

20 rue des Jardins
92600 Asni?res-sur-Seine
*J?r?my ROSEN*
Architecte technique

[image: email] jeremy.rosen at smile.fr
[image: phone]  +33 6 88 25 87 42
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>

[image: D?couvrez l?univers Smile, rendez-vous sur smile.eu]
<https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191110/6ec8e8ac/attachment.html>

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

* [Buildroot] [PATCH 01/15] new recipe : host-systemd
  2019-11-09 21:49   ` Yann E. MORIN
@ 2019-11-10 10:43     ` Jérémy ROSEN
  0 siblings, 0 replies; 42+ messages in thread
From: Jérémy ROSEN @ 2019-11-10 10:43 UTC (permalink / raw)
  To: buildroot

Le sam. 9 nov. 2019 ? 22:49, Yann E. MORIN <yann.morin.1998@free.fr> a
?crit :

> J?r?my, All,
>
> On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> > Add the infrastructure to build the host version of systemd
> > * disable all optional features, they can be re-added when needed
> > * systemd has creative way of dealing with cross compile
> >   we build a "normal" host systemd, but install it in $HOST_DIR
> >   we use systemctl --root to correctly act on TARGET_DIR
> > * we need to adjust RPATH using patchelf because meson can't do it
> >   correctly by itsel
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@smile.fr>
> [--SNIP--]
> > diff --git a/package/systemd/Config.in.host
> b/package/systemd/Config.in.host
> > new file mode 100644
> > index 0000000000..09099752d2
> > --- /dev/null
> > +++ b/package/systemd/Config.in.host
> > @@ -0,0 +1,4 @@
> > +config BR2_PACKAGE_HOST_SYSTEMD
> > +     bool "host systemd tools"
> > +     help
> > +       Systemd command-line tools for the host
>
> I don;t think we (at the current point) need a user-visible option.
>
> This host-systemd is initially a way to get systemctl only, and this is
> just internal to how Buildroot will enable the units (by using systemctl
> preset-all or so).
>
> Later, if/when it becomes possible to build extra utilities for users to
> manually run (or in a post-build/image script), then we can expose a
> user-visible host-systemd option.
>
> But for now, it is not needed.
>

Ok, will do...

The host-tools are pretty usefull, but I don't see any use-cases where you
would want the host-side tool without systemd on the target anyway...


> > diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> > index 94d5f703cd..1e4f706517 100644
> > --- a/package/systemd/systemd.mk
> > +++ b/package/systemd/systemd.mk
> > @@ -550,3 +550,95 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
> >  SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
> >
> >  $(eval $(meson-package))
> > +
> > +
> > +
>
> Too many empty lines. Run 'make check-package'.
>
> done

> > +#
> > +# Host-systemd configuration
> > +#
> > +HOST_SYSTEMD_CONF_OPTS= \
> > +     -Dsplit-bin=true \
> > +     -Dsplit-usr=false \
> > +     -Dutmp=false \
> > +     -Dhibernate=false \
> > +     -Dldconfig=false \
> > +     -Dresolve=false \
> [--SNIP--]
> > +     -Dsysvinit-path='' \
> > +     --prefix=/usr \
> > +     --libdir=lib \
> > +     --sysconfdir=/etc \
> > +     --localstatedir=/var \
>
> This list will be difficult to maintain on each version bump... :-(
> Can't we push for upstream to implement a simple switch:
>
> --disable-all-that-is-not-explicitly-enabled-please-and-i-d-like-a-pony-too-pretty-please
>
> That's not the kind of stuff upstream would accept... we might have more
chance if we
provided a "make host-tools" target or something like that, but my
meson-knowledge is too
low to do that. so... not right now.

I have split the options in two blocks, the ones we tweak and the long list
of "=false" options,
that might help readability


> > +
> > +HOST_SYSTEMD_DEPENDENCIES = \
> > +    host-util-linux \
> > +    host-patchelf \
> > +    host-libcap \
> > +    host-gperf \
> > +
> > +# Fix RPATH After installation
> > +# * systemd provides a install_rpath instruction to meson because the
> binaries need to link with
> > +#   libsystemd which is not in a standard path
> > +# * meson can only replace the RPATH, not append to it
> > +# * the original rpatch is thus lost.
> > +# * the original path had been tweaked by buildroot vial LD_FLAGS to
> add $(HOST_DIR)/lib
> > +# * thus re-tweak rpath after the installation for all binaries that
> need it
> > +#buildroot detects incorrect RPATH, so adding new binaries should be
> safe (it won't compile
> > +#unless properly integrated).
> > +HOST_SYSTEMD_HOST_TOOLS = \
> > +    systemd-analyze  systemd-mount systemctl
>
> Once again, I think we should just keep systemctl for now: remove
> everything else. We just need systemctl for now.
>
>
This is already the minimal set... I can't reduce it more without patching
upstream
There are actually more binaries generated than those (we do build a PID1,
after all)
Those are the ones that need to be tweaked because of libsystemd. The
others are fine.

Again, an upstream patch to build on a tool per tool basis could be
usefull, but beyond the scope
of this patch

We can then *later* add those (esp. analyse).
>
> > +define HOST_SYSTEMD_FIX_RPATH
> > +     $(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \
> > +             $(HOST_DIR)/bin/patchelf --set-rpath
> $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f)
>
> It is not possible to make an RPATH longer than it previously was. How
> can we ensure that the rpath that is set by meson will be big enough to
> later cary our own rpath?
>
> I just checked the source and patchelf does increase the side of the
section to fit the new
size.... so we are good

Cheers
J?r?my


> Regards,
> Yann E. MORIN.
>
> > +     )
> > +endef
> > +
> > +HOST_SYSTEMD_POST_INSTALL_HOOKS +=  HOST_SYSTEMD_FIX_RPATH
> > +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> > +
> > +$(eval $(host-meson-package))
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>      |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>


-- 
[image: SMILE]  <http://www.smile.eu/>

20 rue des Jardins
92600 Asni?res-sur-Seine
*J?r?my ROSEN*
Architecte technique

[image: email] jeremy.rosen at smile.fr
[image: phone]  +33 6 88 25 87 42
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>

[image: D?couvrez l?univers Smile, rendez-vous sur smile.eu]
<https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191110/535641cb/attachment.html>

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

end of thread, other threads:[~2019-11-10 10:43 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 01/15] new recipe : host-systemd Jérémy Rosen
2019-11-03 17:20   ` James Hilliard
2019-11-04 17:02     ` Jérémy ROSEN
     [not found]       ` <CAJ4jsafSoX5ayztTZgOS38YPtVZbT7gYkk3FKHQ0U1FDG8u+bA@mail.gmail.com>
     [not found]         ` <CAFvCimWyMdTTZDxv3EyKDaHGXhrzOd2brLSe+BgbuU9oxJ3S8A@mail.gmail.com>
2019-11-04 20:40           ` Carlos Santos
2019-11-09 21:52     ` Yann E. MORIN
2019-11-09 21:49   ` Yann E. MORIN
2019-11-10 10:43     ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 02/15] use host-systemctl preset all to enable units Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 03/15] fix tty handling Jérémy Rosen
2019-11-03 17:48   ` James Hilliard
2019-11-04 17:08     ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 04/15] fix trivial packages with buildroot-provided services Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 05/15] fix trivial cases, upstream-provided services Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all Jérémy Rosen
2019-11-03 17:15   ` James Hilliard
2019-11-03 17:17     ` Jérémy ROSEN
2019-11-09 22:08       ` Yann E. MORIN
2019-11-03 16:56 ` [Buildroot] [PATCH 07/15] package/connman: " Jérémy Rosen
2019-11-03 17:39   ` James Hilliard
2019-11-09 22:11   ` Yann E. MORIN
2019-11-09 22:36     ` James Hilliard
2019-11-10 10:19       ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 08/15] package/dante: " Jérémy Rosen
2019-11-03 17:17   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 09/15] package/linuxptp " Jérémy Rosen
2019-11-03 17:23   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 10/15] package/docker-engine: " Jérémy Rosen
2019-11-03 17:25   ` James Hilliard
2019-11-04 17:03     ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 11/15] package/network-manager: " Jérémy Rosen
2019-11-03 17:30   ` James Hilliard
2019-11-09 22:14   ` Yann E. MORIN
2019-11-09 22:25     ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 12/15] package/wpa_supplicant: adapt for preset-all Jérémy Rosen
2019-11-03 17:32   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 13/15] package/sysklogd: adapt to preset-all Jérémy Rosen
2019-11-03 17:33   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 14/15] package/targetcli-fb: " Jérémy Rosen
2019-11-03 17:34   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 15/15] package/tor: " Jérémy Rosen
2019-11-03 17:31   ` James Hilliard

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.