Skip to contentSkip to conversation

use host-systemd to enable units

PATCH Superseded Jérémy Rosen 3 participants 20 messages Dec 16, 2019 – May 22, 2020 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

v5 cover use host-systemd to enable units

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

version 5:
* rework all commit messages
* minor typos in systemd.mk
* removal of host_eudev is now in patch #2
* add a big explanation of the RPATH trick in patch #1

J?r?my Rosen (13):
package/systemd: add host variant
package/systemd: use host-systemctl preset all to enable units package/systemd: fix tty handling
package: rely on systemctl preset-all for buildroot-provided services
package: rely on systemctl preset-all for upstream-provided services package/connman: adapt to systemctl preset-all package/linuxptp adapt to systemctl preset-all package/network-manager: adapt to systemctl preset-all package/wpa_supplicant: adapt to systemctl preset-all package/sysrepo: adapt to systemctl preset-all package/syslog-ng: implement systemd enablement using DefaultInstance package/rauc: add a WantedBy section to the systemd unit file package/alsa-utils: add a WantedBy section to the systemd unit file

 docs/manual/adding-packages-generic.txt       |   4 +
 package/Config.in.host                        |   1 +
 package/acpid/acpid.mk                        |   3 -
 package/alsa-utils/alsa-utils.mk              |   9 +-
 package/apache/apache.mk                      |   3 -
 package/audit/audit.mk                        |   4 -
 package/avahi/avahi.mk                        |   8 -
 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/darkhttpd/darkhttpd.mk                |   3 -
 package/dcron/dcron.mk                        |   3 -
 package/dhcp/dhcp.mk                          |   5 -
 package/dhcpcd/dhcpcd.mk                      |   3 -
 package/docker-engine/docker-engine.mk        |   3 -
 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/iputils/iputils.mk                    |  16 --
 package/irqbalance/irqbalance.mk              |   3 -
 package/iucode-tool/iucode-tool.mk            |   3 -
 package/kodi/kodi.mk                          |   5 -
 package/lighttpd/lighttpd.mk                  |   6 -
 .../linuxptp/linuxptp-system-clock.service    |   1 -
 package/linuxptp/linuxptp.mk                  |   3 -
 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/rauc/rauc.mk                          |   5 +-
 package/redis/redis.mk                        |   3 -
 package/rng-tools/rng-tools.mk                |   3 -
 package/rpcbind/rpcbind.mk                    |   3 -
 package/rsyslog/rsyslog.mk                    |  14 --
 package/rygel/rygel.mk                        |   3 -
 package/samba4/samba4.mk                      |   7 -
 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/sysklogd.mk                  |   5 -
 package/syslog-ng/syslog-ng.mk                |   7 +-
 package/sysrepo/sysrepo.mk                    |  10 +-
 .../systemd-bootchart/systemd-bootchart.mk    |   6 -
 package/systemd/80-buildroot.preset           |   4 +
 package/systemd/Config.in                     |   2 +-
 package/systemd/Config.in.host                |   3 +
 package/systemd/systemd.mk                    | 225 ++++++++++--------
 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/transmission/transmission.mk          |   3 -
 package/triggerhappy/triggerhappy.mk          |   3 -
 package/upmpdcli/upmpdcli.mk                  |   3 -
 .../wpa_supplicant/50-wpa_supplicant.preset   |   4 +
 package/wpa_supplicant/wpa_supplicant.mk      |   2 +
 99 files changed, 155 insertions(+), 484 deletions(-)
 create mode 100644 package/systemd/80-buildroot.preset
 create mode 100644 package/systemd/Config.in.host
 create mode 100644 package/wpa_supplicant/50-wpa_supplicant.preset
Signature · 1 line
2.24.0
#1 lore raw

PATCH v5 1/13 package/systemd: add host variant

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

Explanation of Yann E.MORIN about the RPATH trick
-------------------

The first question is: why do we use --prefix=/usr ?

systemd will store its --prefix in all the executables it generates. As such, systemctl will have a hardcoded 'prefix', where it will manipulate and create files/symlinks in. When called natively, this is nice and shinny.

However, for cross-setup, that does not work obviously.

So, systemd has its tools know about the 'root' directory where this prefix should be related to. We can call systemctl --root=$(TARGET_DIR) and systemctl wil do the links and such in there.

However, it does so by appending its known prefix to it.

So, if we were to configure host-systemd as we usually do, with --prefix=$(HOST_DIR), then when we would call host systemctl --root=$(TARGET_DIR) it would look for files in $(TARGET_DIR)/$(HOST_DIR), which is wrong.

Calling the host systemctl without --root is also wrong, as it would look for files in $(HOST_DIR)

So, there is no satisfying official support for this case.

The trick then, is to configure systemd with the prefix it would expect at runtime (on the target!), that is with /usr, but install out-of-tree.

That was it for the first part of the question: why do we use --prefix.

Now, the second question is: why do we need to muck up with the rpath after installation?
Well, this boils down to meson (and not systemd itself). When it installs executables, meson will handily insert whatever rpath the package meson.build would tell it to use. systemd installs libs in $(prefix)/lib/systemd and as a NEEDED to those libs, so it uses an RPATH to find those libs, and meson does introduce that RPATH. However, we Buildroot also want to insert our own RPATH, because systemd uses util-linux' libs and libcap, so it needs our RPATH. However, meson can not extend the RPATH from the LDFLAGS in the environment; meson can only set the RPATH from what it knows about from the package's meson.build.

That, in addition to the --prefix=/usr issue above, means that the executables installed by host-systemd have an RPATH set to /usr/lib/systemd. when we would want it to be set to $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd

That;s what is done in the post-install hook: set the RPATH to the appropriate values.

---
 package/Config.in.host         |  1 +
 package/systemd/Config.in.host |  3 ++
 package/systemd/systemd.mk     | 94 ++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100644 package/systemd/Config.in.host
package/Config.in.host +1 -0
index 758c268e00..62e860d7c3 100644
@@ -70,6 +70,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"
package/systemd/Config.in.host new file +3 -0
new file mode 100644
index 0000000000..219f24239e
@@ -0,0 +1,3 @@
+# Select this if you need host systemd tools (e.g. systemctl)
+config BR2_PACKAGE_HOST_SYSTEMD
+	bool
package/systemd/systemd.mk +94 -0

98 lines not on this page · raw message

Signature · 1 line
2.24.0
#2 lore raw

PATCH v5 2/13 package/systemd: use host-systemctl preset all to enable units

In reply to Jérémy Rosen

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.

Most packages will not be affected by this change, but a few packages were installing units without manually enabling them. Those packages will now be automatically enabled.

The fact that those packages were not enabled is almost certainly a bug, but it is a change of behaviour that needs to be reported

This also means that systemd builds udevadm for the host. As a consequence we now conflict wit host-eudev instead of needing to to build the hwdb database. This patch thus removes the dependency

---
 docs/manual/adding-packages-generic.txt |   4 +
 package/systemd/80-buildroot.preset     |   5 ++
 package/systemd/Config.in               |   2 +-
 package/systemd/systemd.mk              | 108 ++++--------------------
 4 files changed, 27 insertions(+), 92 deletions(-)
 create mode 100644 package/systemd/80-buildroot.preset
docs/manual/adding-packages-generic.txt +4 -0
index 86300e7460..f7f3e447f1 100644
@@ -550,6 +550,10 @@ different steps of the build process.
   is when openrc is chosen as init system and +LIBFOO_INSTALL_INIT_OPENRC+
   has not been set, in such situation +LIBFOO_INSTALL_INIT_SYSV+ will
   be called, since openrc supports sysv init scripts.
+  When systemd is used as the init system, buildroot will automatically enable
+  all services using the +systemctl preset-all+ command in the final phase of
+  image building. You can add preset files to prevent a particular unit from
+  being automatically enabled by buildroot.
 
 * +LIBFOO_HELP_CMDS+ lists the actions to print the package help, which
   is included to the main +make help+ output. These commands can print
package/systemd/80-buildroot.preset new file +5 -0
new file mode 100644
index 0000000000..4074901cbd
@@ -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
package/systemd/Config.in +1 -1
index 8f1d6fc0c0..c727082a1a 100644
@@ -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 # for systemctl preset-all, during target-finalize
 	help
 	  systemd is a system and service manager for Linux,
 	  compatible with SysV and LSB init scripts. systemd provides
@@ -199,7 +200,6 @@ config BR2_PACKAGE_SYSTEMD_HOSTNAMED
 config BR2_PACKAGE_SYSTEMD_HWDB
 	bool "enable hwdb installation"
 	default y
-	select BR2_PACKAGE_HOST_EUDEV # for udevadm, during target-finalize
 	help
 	  Enables hardware database installation to /usr/lib/udev/hwdb.d
 
package/systemd/systemd.mk +17 -91

192 lines not on this page · raw message

Signature · 1 line
2.24.0
#3 lore raw

PATCH v5 3/13 package/systemd: fix tty handling

In reply to Jérémy Rosen

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

---
 package/systemd/80-buildroot.preset |  5 ++---
 package/systemd/systemd.mk          | 25 +++++++++++++++++--------
 2 files changed, 19 insertions(+), 11 deletions(-)
package/systemd/80-buildroot.preset +2 -3
index 4074901cbd..5dbae39173 100644
@@ -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
+
package/systemd/systemd.mk +17 -8
index 057a4eb9e5..6adf3adca4 100644
@@ -433,22 +433,33 @@ 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 drop-in in /usr/lib
+# * set a new DefaultInstance for getty at .service instead, 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
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d;\
+	printf '[Install]\nDefaultInstance=\n' > $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
 	if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
 	then \
 		TARGET="console-getty.service"; \
-		LINK_NAME="console-getty.service"; \
+		printf 'enable console-getty.service\n' > $(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"; \
+		printf '[Install]\nDefaultInstance=%s\n' $(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;\
+		printf '[Install]\nDefaultInstance=%s\n' $(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}; \
@@ -456,7 +467,6 @@ define SYSTEMD_INSTALL_SERVICE_TTY
 endef
 endif
 
-
 define SYSTEMD_INSTALL_PRESET
 	$(INSTALL) -D -m 644 $(SYSTEMD_PKGDIR)/80-buildroot.preset $(TARGET_DIR)/usr/lib/systemd/system-preset/80-buildroot.preset
 endef
@@ -472,7 +482,6 @@ define SYSTEMD_PRESET_ALL
 endef
 SYSTEMD_TARGET_FINALIZE_HOOKS += SYSTEMD_PRESET_ALL
 
-
 SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
 SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
 
Signature · 1 line
2.24.0
#4 lore raw

PATCH v5 3/13 package/systemd: fix tty handling

Hello J?r?my,

Quoted 22 lines · On Mon, 16 Dec 2019 11:30:42 +0100 J?r?my Rosen <[email protected]> wrote:
package/systemd/systemd.mk +13 -2
+# 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 drop-in in /usr/lib
+# * set a new DefaultInstance for getty at .service instead, 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
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d;\
+	printf '[Install]\nDefaultInstance=\n' > $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
 	if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
 	then \
 		TARGET="console-getty.service"; \
-		LINK_NAME="console-getty.service"; \
+		printf 'enable console-getty.service\n' > $(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"; \

package/systemd/systemd.mk ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),) · line 451

Quoted 10 lines
package/systemd/systemd.mk +3 -4
+		printf '[Install]\nDefaultInstance=%s\n' $(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;\
+		printf '[Install]\nDefaultInstance=%s\n' $(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}; \

I am not sure exactly if it is this change causing the issue, but there is an issue in this code. See the bug report at:

https://bugs.busybox.net/show_bug.cgi?id=12786

I must say now that I read the comment on top of this code, I don't understand at all what is being explained. Could you give a bit more details about what we are trying to do here, and hopefully help resolve bug 12786 ?

Thanks!

Thomas

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

PATCH v5 3/13 package/systemd: fix tty handling

Hey Thomas
This seems definitely related to my patch, I'll try to have a look at it ASAP, but I can't really promise when ASAP will be...

Sorry about that
Jeremy

Le sam. 16 mai 2020 ? 16:28, Thomas Petazzoni <[email protected]> a ?crit :

Quoted 73 lines

Hello J?r?my,

package/systemd/systemd.mk ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)

Quoted 6 lines · On Mon, 16 Dec 2019 11:30:42 +0100 J?r?my Rosen <[email protected]> wrote:
package/systemd/systemd.mk +6 -0
+# 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

Quoted 1 line

+# * remove the default instance of getty at .service via a drop-in in

/usr/lib

package/systemd/systemd.mk ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)

Quoted 3 lines
package/systemd/systemd.mk +3 -0
+# * set a new DefaultInstance for getty at .service instead, if needed
+# * set a new DefaultInstance for serial-getty at .service, if needed
+# * override the systemd-provided preset for console-getty.service if

needed

Review

Quoted 3 lines

define SYSTEMD_INSTALL_SERVICE_TTY

(quoted diff) +2 -0
+     mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d;\
+     printf '[Install]\nDefaultInstance=\n' >

$(TARGET_DIR)/usr/lib/systemd/system/getty@
.service.d/buildroot-console.conf;\

Review

Quoted 5 lines
      if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
      then \
              TARGET="console-getty.service"; \
(quoted diff) +1 -1
-             LINK_NAME="console-getty.service"; \
+             printf 'enable console-getty.service\n' >

$(TARGET_DIR)/usr/lib/systemd/system-preset/81-buildroot-tty.preset;\

Quoted 1 line
      elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q

'tty[0-9]*$$'; \

Quoted 3 lines
      then \
              TARGET="getty at .service"; \

- LINK_NAME="getty@$(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \

Quoted 1 line

+ printf '[Install]\nDefaultInstance=%s\n' $(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >
$(TARGET_DIR)/usr/lib/systemd/system/getty@
.service.d/buildroot-console.conf;\

Quoted 3 lines
      else \
              TARGET="serial-getty at .service"; \

- LINK_NAME="serial-getty@$(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \

Quoted 1 line

+ mkdir $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@

.service.d;\

Quoted 1 line

+ printf '[Install]\nDefaultInstance=%s\n' $(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) > $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@ .service.d/buildroot-console.conf;\

package/systemd/systemd.mk ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)

Quoted 4 lines
      fi; \
package/systemd/systemd.mk +0 -3
-     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}; \

I am not sure exactly if it is this change causing the issue, but there is an issue in this code. See the bug report at:

https://bugs.busybox.net/show_bug.cgi?id=12786

I must say now that I read the comment on top of this code, I don't understand at all what is being explained. Could you give a bit more details about what we are trying to do here, and hopefully help resolve bug 12786 ?

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Signature · 21 lines
[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/20200518/4bede8ea/attachment.html>
#6 lore raw

PATCH v5 3/13 package/systemd: fix tty handling

Ok, I found the cause and sent a patch (separate email thread)

I tried to clarify the comment too, while I was at it

Regards
J?r?my

Le lun. 18 mai 2020 ? 09:12, J?r?my ROSEN <[email protected]> a ?crit :

Quoted 106 lines

Hey Thomas
This seems definitely related to my patch, I'll try to have a look at it ASAP, but I can't really promise when ASAP will be...

Sorry about that
Jeremy

Le sam. 16 mai 2020 ? 16:28, Thomas Petazzoni <
thomas.petazzoni at bootlin.com> a ?crit :

Quoted 65 lines

Hello J?r?my,

package/systemd/systemd.mk ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)

Quoted 6 lines · On Mon, 16 Dec 2019 11:30:42 +0100 J?r?my Rosen <[email protected]> wrote:
package/systemd/systemd.mk +6 -0
+# 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

Quoted 1 line

+# * remove the default instance of getty at .service via a drop-in in

/usr/lib

package/systemd/systemd.mk ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)

Quoted 3 lines
package/systemd/systemd.mk +3 -0
+# * set a new DefaultInstance for getty at .service instead, if needed
+# * set a new DefaultInstance for serial-getty at .service, if needed
+# * override the systemd-provided preset for console-getty.service if

needed

Review

Quoted 3 lines

define SYSTEMD_INSTALL_SERVICE_TTY

(quoted diff) +2 -0
+     mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d;\
+     printf '[Install]\nDefaultInstance=\n' >

$(TARGET_DIR)/usr/lib/systemd/system/getty@
.service.d/buildroot-console.conf;\

Review

Quoted 5 lines
      if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
      then \
              TARGET="console-getty.service"; \
(quoted diff) +1 -1
-             LINK_NAME="console-getty.service"; \
+             printf 'enable console-getty.service\n' >

$(TARGET_DIR)/usr/lib/systemd/system-preset/81-buildroot-tty.preset;\

Quoted 1 line
      elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q

'tty[0-9]*$$'; \

Quoted 3 lines
      then \
              TARGET="getty at .service"; \

- LINK_NAME="getty@$(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \

Quoted 1 line

+ printf '[Install]\nDefaultInstance=%s\n' $(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) >
$(TARGET_DIR)/usr/lib/systemd/system/getty@
.service.d/buildroot-console.conf;\

Quoted 3 lines
      else \
              TARGET="serial-getty at .service"; \

- LINK_NAME="serial-getty@$(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \

Quoted 1 line

+ mkdir $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@

.service.d;\

Quoted 1 line

+ printf '[Install]\nDefaultInstance=%s\n' $(call

qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) > $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@ .service.d/buildroot-console.conf;\

package/systemd/systemd.mk ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)

Quoted 4 lines
      fi; \
package/systemd/systemd.mk +0 -3
-     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}; \

I am not sure exactly if it is this change causing the issue, but there is an issue in this code. See the bug report at:

https://bugs.busybox.net/show_bug.cgi?id=12786

I must say now that I read the comment on top of this code, I don't understand at all what is being explained. Could you give a bit more details about what we are trying to do here, and hopefully help resolve bug 12786 ?

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

--
[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>

Signature · 21 lines
[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/20200522/d30167e8/attachment.html>
#7 lore raw

PATCH v5 4/13 package: rely on systemctl preset-all for buildroot-provided services

In reply to Jérémy Rosen

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

---
 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/rygel/rygel.mk                           | 3 ---
 package/sane-backends/sane-backends.mk           | 6 ------
 package/supervisor/supervisor.mk                 | 3 ---
 package/suricata/suricata.mk                     | 3 ---
 package/sysklogd/sysklogd.mk                     | 5 -----
 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, 208 deletions(-)
package/acpid/acpid.mk +0 -3
index 20295aa5a4..ff6e62b5cd 100644
@@ -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
package/apache/apache.mk +0 -3
index 1d62538b19..22e7be8832 100644
@@ -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))
package/babeld/babeld.mk +0 -5
index 5fbfa65485..f864b5db26 100644
@@ -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))
package/bandwidthd/bandwidthd.mk +0 -5
index e9bc871a6a..990d8c5d8f 100644
@@ -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))
package/bind/bind.mk +0 -5
index 2d75f58b3f..89d83d4d54 100644
@@ -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
package/brltty/brltty.mk +0 -4
index 3ae8b899b8..11b8c0d35f 100644
@@ -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))
package/chrony/chrony.mk +0 -3
index 379745022c..d7f5c05183 100644
@@ -67,9 +67,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))
package/collectd/collectd.mk +0 -3
index 9ff29fcbea..fd27443755 100644
@@ -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))
package/darkhttpd/darkhttpd.mk +0 -3
index df80899371..f4831a9426 100644
@@ -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
package/dcron/dcron.mk +0 -3
index 2ee0709af5..51ebb18745 100644
@@ -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))
package/dhcp/dhcp.mk +0 -5
index 5e0bcca71f..335c631119 100644
@@ -100,11 +100,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
package/dhcpcd/dhcpcd.mk +0 -3
index cd20d8f9f3..63dbbee86c 100644
@@ -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
 
package/domoticz/domoticz.mk +0 -3
index c0568c61c6..ab560ba05f 100644
@@ -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))
package/dropbear/dropbear.mk +0 -3
index 7cbc16bc3d..23e5e3f600 100644
@@ -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)
package/exim/exim.mk +0 -3
index 014565c85b..040b292a87 100644
@@ -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))
package/freescale-imx/imx-uuc/imx-uuc.mk +0 -3
index 040d7bd874..2ed910cb84 100644
@@ -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))
package/haveged/haveged.mk +0 -3
index 05b59a1685..cc834304df 100644
@@ -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))
package/i2pd/i2pd.mk +0 -3
index 5fa815c21d..de975d66a4 100644
@@ -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))
package/ifupdown-scripts/ifupdown-scripts.mk +0 -3
index 17364aed03..abb4575777 100644
@@ -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))
package/igd2-for-linux/igd2-for-linux.mk +0 -3
index 38170b4f57..478c353997 100644
@@ -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))
package/inadyn/inadyn.mk +0 -3
index 96a37d4768..5f67849252 100644
@@ -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))
package/input-event-daemon/input-event-daemon.mk +0 -3
index 632c9eeecb..dbe2d4bfb2 100644
@@ -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))
package/irqbalance/irqbalance.mk +0 -3
index b01eba96c8..16967aa8c0 100644
@@ -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))
package/iucode-tool/iucode-tool.mk +0 -3
index e900888d7d..bddc37295c 100644
@@ -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))
package/kodi/kodi.mk +0 -5
index ceab5d5c0b..9ea170ff6b 100644
@@ -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))
package/mariadb/mariadb.mk +0 -3
index 82e3c16daf..f76a974d65 100644
@@ -120,9 +120,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
 
package/mender/mender.mk +0 -3
index fded7fa943..87fdc45268 100644
@@ -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
package/mini-snmpd/mini-snmpd.mk +0 -3
index f2480e3168..698402bc51 100644
@@ -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))
package/minidlna/minidlna.mk +0 -5
index 262480cbff..c66e97b073 100644
@@ -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))
package/minissdpd/minissdpd.mk +0 -3
index 31d942eac5..d97eece680 100644
@@ -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))
package/motion/motion.mk +0 -3
index 165e402fc8..ae58c54935 100644
@@ -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))
package/netplug/netplug.mk +0 -3
index 9363a71811..b5083120f1 100644
@@ -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))
package/nginx/nginx.mk +0 -5
index 7ab656fd8b..f895b78779 100644
@@ -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
package/nss-pam-ldapd/nss-pam-ldapd.mk +0 -3
index 15b3c4b95e..223a9eeaec 100644
@@ -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
package/ntp/ntp.mk +0 -3
index d53fcc5d0b..fb138a8fba 100644
@@ -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
 
package/olsr/olsr.mk +0 -3
index faff2533d9..766b1432c1 100644
@@ -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))
package/openntpd/openntpd.mk +0 -3
index f5a5690479..f2eaee7efd 100644
@@ -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
package/openssh/openssh.mk +0 -3
index 47a724d839..0411133bdc 100644
@@ -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
 
package/openvmtools/openvmtools.mk +0 -3
index fc56bb5ee0..68afa17078 100644
@@ -72,9 +72,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))
package/oracle-mysql/oracle-mysql.mk +0 -3
index 326fbcc040..8a8613a3d1 100644
@@ -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
package/postgresql/postgresql.mk +0 -3
index 858cd6975e..7d8bef643b 100644
@@ -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))
package/proftpd/proftpd.mk +0 -3
index da1c07b410..2c3e0a6877 100644
@@ -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)
package/psplash/psplash.mk +0 -6
index 4a2e0de5ce..3dd2f4d579 100644
@@ -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))
package/ptpd/ptpd.mk +0 -3
index dad8ccfe10..49587231e0 100644
@@ -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))
package/ptpd2/ptpd2.mk +0 -3
index f4a70760ad..0de336464d 100644
@@ -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))
package/pulseaudio/pulseaudio.mk +0 -3
index b833d4ad27..0e78724634 100644
@@ -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
package/python-web2py/python-web2py.mk +0 -3
index 0b86fb148e..8706c87968 100644
@@ -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
package/rabbitmq-server/rabbitmq-server.mk +0 -5
index 6df770793a..f9c28e6677 100644
@@ -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
package/redis/redis.mk +0 -3
index 1729afe165..b85de1dfed 100644
@@ -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))
package/rng-tools/rng-tools.mk +0 -3
index c5f3051aea..274079044c 100644
@@ -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))
package/rpcbind/rpcbind.mk +0 -3
index 46e5b27d35..cce84cfa88 100644
@@ -27,9 +27,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
package/rygel/rygel.mk +0 -3
index 1bf3ab4350..5ffb6a9400 100644
@@ -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))
package/sane-backends/sane-backends.mk +0 -6
index 092123e194..52e03da518 100644
@@ -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))
package/supervisor/supervisor.mk +0 -3
index e99a9b18ce..424f46a7c2 100644
@@ -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))
package/suricata/suricata.mk +0 -3
index 56eb6a706f..7dc38d30cb 100644
@@ -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))
package/sysklogd/sysklogd.mk +0 -5
index 266c171170..1bd1ec51b5 100644
@@ -30,11 +30,6 @@ 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
 endef
 
 $(eval $(autotools-package))
package/tcf-agent/tcf-agent.mk +0 -3
index 5a0a991b1d..2b8a61b66f 100644
@@ -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
package/thttpd/thttpd.mk +0 -3
index 6cf86e4b95..fe96f7df65 100644
@@ -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))
package/ti-gfx/ti-gfx.mk +0 -3
index 9fad553780..2728572776 100644
@@ -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
package/tinyhttpd/tinyhttpd.mk +0 -3
index 058f6bd186..6b3ba5f305 100644
@@ -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))
package/triggerhappy/triggerhappy.mk +0 -3
index 7c4bf40476..f83a557804 100644
@@ -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))
Signature · 1 line
2.24.0
#8 lore raw

PATCH v5 5/13 package: rely on systemctl preset-all for upstream-provided services

In reply to Jérémy Rosen

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

---
 package/audit/audit.mk                         |  4 ----
 package/avahi/avahi.mk                         |  8 --------
 package/bluez5_utils/bluez5_utils.mk           |  8 --------
 package/boinc/boinc.mk                         |  5 -----
 package/docker-engine/docker-engine.mk         |  3 ---
 package/fail2ban/fail2ban.mk                   |  3 ---
 package/gerbera/gerbera.mk                     |  6 ------
 package/iputils/iputils.mk                     | 16 ----------------
 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/samba4/samba4.mk                       |  7 -------
 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 ---
 22 files changed, 138 deletions(-)
package/audit/audit.mk +0 -4
index 1e05688f45..03967ee650 100644
@@ -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
package/avahi/avahi.mk +0 -8
index baffe3cb69..53021f6b6d 100644
@@ -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
 
package/bluez5_utils/bluez5_utils.mk +0 -8
index 7c5202b717..8f9249454d 100644
@@ -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))
package/boinc/boinc.mk +0 -5
index 5a29214f46..60aa5d1521 100644
@@ -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))
package/docker-engine/docker-engine.mk +0 -3
index 6a225ee5f0..c6a0442570 100644
@@ -68,9 +68,6 @@ 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
 endef
 
 define DOCKER_ENGINE_INSTALL_INIT_SYSV
package/fail2ban/fail2ban.mk +0 -3
index 16fa63c147..a0325dffc5 100644
@@ -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
package/gerbera/gerbera.mk +0 -6
index 2579b8f2e4..80026e8cf8 100644
@@ -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))
package/iputils/iputils.mk +0 -16
index daceb192f2..5b20d4f99e 100644
@@ -62,11 +62,6 @@ ifeq ($(IPUTILS_NINFOD),n)
 IPUTILS_CONF_OPTS += -DBUILD_NINFOD=false
 else
 IPUTILS_CONF_OPTS += -DBUILD_NINFOD=true
-define IPUTILS_INSTALL_SERVICE_NINFOD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../lib/systemd/system/ninfod.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ninfod.service
-endef
 endif
 
 ifeq ($(BR2_SYSTEM_ENABLE_NLS),y)
@@ -118,15 +113,4 @@ define IPUTILS_PERMISSIONS
 endef
 endif
 
-define IPUTILS_INSTALL_SERVICE_RDISC
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../lib/systemd/system/rdisc.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rdisc.service
-endef
-
-define IPUTILS_INSTALL_INIT_SYSTEMD
-	$(IPUTILS_INSTALL_SERVICE_NINFOD)
-	$(IPUTILS_INSTALL_SERVICE_RDISC)
-endef
-
 $(eval $(meson-package))
package/lighttpd/lighttpd.mk +0 -6
index 449b4b4de2..d7622ad822 100644
@@ -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
package/lldpd/lldpd.mk +0 -6
index 5569e409dd..264323a879 100644
@@ -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))
package/mosquitto/mosquitto.mk +0 -3
index d0ffffd1d6..2c3bd18d5e 100644
@@ -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
package/nfs-utils/nfs-utils.mk +0 -16
index cb2caa03f0..a3484286d1 100644
@@ -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
 
package/ofono/ofono.mk +0 -6
index 0765ff97c1..797e30bd43 100644
@@ -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
package/pcsc-lite/pcsc-lite.mk +0 -6
index e819a93910..08aab466fc 100644
@@ -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))
package/php/php.mk +0 -3
index 1f3972c413..be35ed4456 100644
@@ -338,9 +338,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
package/rsyslog/rsyslog.mk +0 -14
index 1d535fc26b..c4446c210d 100644
@@ -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
package/samba4/samba4.mk +0 -7
index 201328fe4b..bf9636f6e8 100644
@@ -174,13 +174,6 @@ SAMBA4_DEPENDENCIES += systemd
 endif
 
 define SAMBA4_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/nmb.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmb.service
-	ln -sf ../../../../usr/lib/systemd/system/smb.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/smb.service
-	ln -sf ../../../../usr/lib/systemd/system/winbind.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/winbind.service
 	$(INSTALL) -D -m 644 $(@D)/packaging/systemd/samba.conf.tmp \
 		$(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
 	printf "d /var/log/samba  755 root root\n" >>$(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
package/squid/squid.mk +0 -3
index 0d09968bd3..34a463d80d 100644
@@ -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))
package/sshguard/sshguard.mk +0 -3
index 0f39974d46..ceff520693 100644
@@ -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))
package/systemd-bootchart/systemd-bootchart.mk +0 -6
index 62bc79539b..bcc3dbe22a 100644
@@ -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))
package/transmission/transmission.mk +0 -3
index 00652e7f4c..8fbda5eea3 100644
@@ -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
package/upmpdcli/upmpdcli.mk +0 -3
index 6fa3ae3c5e..290cdcb1f2 100644
@@ -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
Signature · 1 line
2.24.0
#9 lore raw

PATCH v5 6/13 package/connman: adapt to systemctl preset-all

In reply to Jérémy Rosen

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

---
 package/connman/connman.mk | 6 ------
 1 file changed, 6 deletions(-)
package/connman/connman.mk +0 -6
index 7ca49726dd..2cbf3fe752 100644
@@ -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_LICENSE += , GPL-2.0+ (client)
 CONNMAN_CONF_OPTS += --enable-client
Signature · 1 line
2.24.0
#10 lore raw

PATCH v5 7/13 package/linuxptp adapt to systemctl preset-all

In reply to Jérémy Rosen

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, we now enable both

The second has an incorrect (though harmless) WantedBy : there is an explicit Wants= in linuxptp.service

---
 package/linuxptp/linuxptp-system-clock.service | 1 -
 package/linuxptp/linuxptp.mk                   | 3 ---
 2 files changed, 4 deletions(-)
package/linuxptp/linuxptp-system-clock.service +0 -1
index a4436a34a7..57beec4579 100644
@@ -8,4 +8,3 @@ Restart=always
 
 [Install]
 WantedBy=multi-user.target
-WantedBy=linuxptp.service
package/linuxptp/linuxptp.mk +0 -3
index c304ff6d6e..97e4af7be7 100644
@@ -42,9 +42,6 @@ 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
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.24.0
#11 lore raw

PATCH v5 8/13 package/network-manager: adapt to systemctl preset-all

In reply to Jérémy Rosen

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

---
 package/network-manager/network-manager.mk | 7 -------
 1 file changed, 7 deletions(-)
package/network-manager/network-manager.mk +0 -7
index 7de2c220fe..56b768cdef 100644
@@ -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))
Signature · 1 line
2.24.0
#12 lore raw

PATCH v5 9/13 package/wpa_supplicant: adapt to systemctl preset-all

In reply to Jérémy Rosen

all services were installed but not enabled.
This change enables the non-templated service
but disables the templated ones

Enabling the templates creates weird links which are probably an upstream bug.

---
 package/wpa_supplicant/50-wpa_supplicant.preset | 4 ++++
 package/wpa_supplicant/wpa_supplicant.mk        | 2 ++
 2 files changed, 6 insertions(+)
 create mode 100644 package/wpa_supplicant/50-wpa_supplicant.preset
package/wpa_supplicant/50-wpa_supplicant.preset new file +4 -0
new file mode 100644
index 0000000000..9af8562c0e
@@ -0,0 +1,4 @@
+disable wpa_supplicant at .service
+disable wpa_supplicant-nl80211 at .service
+disable wpa_supplicant-wired at .service
+
package/wpa_supplicant/wpa_supplicant.mk +2 -0
index 9dcebca9bf..4f95ea6276 100644
@@ -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 $(WPA_SUPPLICANT_PKGDIR)/50-wpa_supplicant.preset \
+		$(TARGET_DIR)/usr/lib/systemd/system-preset/50-wpa_supplicant.preset
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.24.0
#13 lore raw

PATCH v5 10/13 package/sysrepo: adapt to systemctl preset-all

In reply to Jérémy Rosen

sysrepo provides it's own services so just remove the section

Also fix sysrepo not installing the files in the correct directory

---
 package/sysrepo/sysrepo.mk | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
package/sysrepo/sysrepo.mk +1 -9
index 216e517526..f693ff70da 100644
@@ -24,7 +24,7 @@ SYSREPO_CONF_OPTS = \
 	-DCALL_SYSREPOCFG_BIN=$(HOST_DIR)/bin/sysrepocfg \
 	-DBUILD_EXAMPLES=$(if $(BR2_PACKAGE_SYSREPO_EXAMPLES),ON,OFF) \
 	$(if $(BR2_INIT_SYSTEMD),-DWITH_SYSTEMD=ON) \
-	$(if $(BR2_INIT_SYSTEMD),-DSYSTEMD_UNIT_DIR=usr/lib/systemd/system)
+	$(if $(BR2_INIT_SYSTEMD),-DSYSTEMD_UNIT_DIR=/usr/lib/systemd/system)
 
 # On ARM, this is needed to prevent unaligned memory access with an optimized
 # build .. https://github.com/sysrepo/sysrepo/issues/947
@@ -41,14 +41,6 @@ define SYSREPO_INSTALL_INIT_SYSV
 		$(TARGET_DIR)/etc/init.d/S51sysrepo-plugind
 endef
 
-define SYSREPO_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/sysrepod.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/sysrepo-plugind.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-endef
-
 HOST_SYSREPO_CONF_OPTS = \
 	-DGEN_PYTHON2_TESTS=OFF \
 	-DENABLE_TESTS=OFF \
Signature · 1 line
2.24.0
#14 lore raw

PATCH v5 11/13 package/syslog-ng: implement systemd enablement using DefaultInstance

In reply to Jérémy Rosen

Instead of using a manual symlink we use add a DefaultInstance= to the config file

This is how upstream wants us to do it and allows systemctl preset to correctly restore it if needed

---
 package/syslog-ng/syslog-ng.mk | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
package/syslog-ng/syslog-ng.mk +2 -5
index fc44777d16..98b5a38deb 100644
@@ -105,11 +105,8 @@ endef
 # By default syslog-ng installs a .service that requires a config file at
 # /etc/default, so provide one with the default values.
 define SYSLOG_NG_INSTALL_INIT_SYSTEMD
-	$(INSTALL) -m 0644 -D package/syslog-ng/syslog-ng at default \
-		$(TARGET_DIR)/etc/default/syslog-ng at default
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../usr/lib/systemd/system/syslog-ng at .service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslog-ng at default.service
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/syslog-ng at .service.d;\
+	printf '[Install]\nDefaultInstance=default\n' > $(TARGET_DIR)/usr/lib/systemd/system/syslog-ng at .service.d/buildroot-default-instance.conf;
 endef
 
 # By default syslog-ng installs a number of sample configuration
Signature · 1 line
2.24.0
#15 lore raw

PATCH v5 12/13 package/rauc: add a WantedBy section to the systemd unit file

In reply to Jérémy Rosen

upstream-provided service has no WantedBy, which means that rauc won't be enabled by default

Add a WantedBy instead of manually creating the symlink so the user can enable/disable the unit properly

---
 package/rauc/rauc.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
package/rauc/rauc.mk +2 -3
index f3434e9c9a..7b35154f56 100644
@@ -31,9 +31,8 @@ RAUC_DEPENDENCIES += systemd
 endif
 
 define RAUC_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -sf ../../../../lib/systemd/system/rauc.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rauc.service
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/rauc.service.d;\
+	printf '[Install]\nWantedBy=multi-user.target\n' > $(TARGET_DIR)/usr/lib/systemd/system/rauc.service.d/buildroot-enable.conf;
 endef
 
 HOST_RAUC_DEPENDENCIES = \
Signature · 1 line
2.24.0
#16 lore raw

PATCH v5 13/13 package/alsa-utils: add a WantedBy section to the systemd unit file

In reply to Jérémy Rosen

This allows the user to enable/disable manually the unit. It is enabled by default

---
 package/alsa-utils/alsa-utils.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
package/alsa-utils/alsa-utils.mk +4 -5
index 52022e32ab..84f6db3784 100644
@@ -90,11 +90,10 @@ define ALSA_UTILS_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service
 	$(INSTALL) -D -m 0644 $(@D)/alsactl/alsa-state.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/sound.target.wants
-	ln -sf ../../../../lib/systemd/system/alsa-restore.service \
-		$(TARGET_DIR)/etc/systemd/system/sound.target.wants/alsa-restore.service
-	ln -sf ../../../../lib/systemd/system/alsa-state.service \
-		$(TARGET_DIR)/etc/systemd/system/sound.target.wants/alsa-state.service
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d;\
+	printf '[Install]\nWantedBy=multi-user.target\n' > $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d/buildroot-enable.conf;\
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d;\
+	printf '[Install]\nWantedBy=multi-user.target\n' > $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d/buildroot-enable.conf;
 endef
 endif
 
Signature · 1 line
2.24.0
#17 lore raw

v5 cover use host-systemd to enable units

In reply to Jérémy Rosen

J?r?my, All,

On 2019-12-16 11:30 +0100, J?r?my Rosen spake thusly:

Quoted 8 lines

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.

Thanks for working this difficult series. I have it all applied to master now. :-)

However, I did quite a few changes:

35c11a027c package/systemd: add host variant
- reformatting in commit log
- declare host variant after target variant
- simplify comments
- slight reordering of variable (HOST_SYSTEMD_NINJA_ENV moved)
- reformatting for mutli-line variable (HOST_SYSTEMD_HOST_TOOLS)
- don't split HOST_SYSTEMD_CONF_OPTS in two sets

873e6573d3 package/sysrepo: fix install path for systemd units
- split into its own commit
- expand commit log

231ad359bc package/systemd: use host-systemctl preset all to enable units
- also remove the hwdb sources on fs generation
- fix check-package errors
- few typoes and reformatting in commit log

6c3944a057 package/systemd: fix tty handling
- fold long lines
- drop spurious empty lines removals

3e092163e5 package: rely on systemctl preset-all for buildroot-provided services
[untouched]

1640fca208 package: rely on systemctl preset-all for upstream-provided services
- fix check-package errors

f7869ef30f package/connman: adapt to systemctl preset-all
- fix check-package errors

c561bcbf5f package/linuxptp adapt to systemctl preset-all eb075916f4 package/network-manager: adapt to systemctl preset-all
[untouched]

54ea03ccd7 package/syslog-ng: implement systemd enablement using DefaultInstance
- split long line
- no need for continued line (no use for ';\' )

c27708e148 package/wpa_supplicant: adapt to systemctl preset-all
[untouched]

583cb5b6e6 package/rauc: add a WantedBy section to the systemd unit file
- split long line
- no need for continued line (no use for ';\' )

4974f7941f package/alsa-utils: add a WantedBy section to the systemd unit file
- split logn lines
- no need for continued line (no use for ';\' )

Please review the whole new set, and watch the autobuilders now! ;-)

Thanks!

Regards,
Yann E. MORIN.

Quoted 144 lines

* 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

version 5:
* rework all commit messages
* minor typos in systemd.mk
* removal of host_eudev is now in patch #2
* add a big explanation of the RPATH trick in patch #1

J?r?my Rosen (13):
package/systemd: add host variant
package/systemd: use host-systemctl preset all to enable units package/systemd: fix tty handling
package: rely on systemctl preset-all for buildroot-provided services
package: rely on systemctl preset-all for upstream-provided services package/connman: adapt to systemctl preset-all package/linuxptp adapt to systemctl preset-all package/network-manager: adapt to systemctl preset-all package/wpa_supplicant: adapt to systemctl preset-all package/sysrepo: adapt to systemctl preset-all package/syslog-ng: implement systemd enablement using DefaultInstance package/rauc: add a WantedBy section to the systemd unit file package/alsa-utils: add a WantedBy section to the systemd unit file

 docs/manual/adding-packages-generic.txt       |   4 +
 package/Config.in.host                        |   1 +
 package/acpid/acpid.mk                        |   3 -
 package/alsa-utils/alsa-utils.mk              |   9 +-
 package/apache/apache.mk                      |   3 -
 package/audit/audit.mk                        |   4 -
 package/avahi/avahi.mk                        |   8 -
 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/darkhttpd/darkhttpd.mk                |   3 -
 package/dcron/dcron.mk                        |   3 -
 package/dhcp/dhcp.mk                          |   5 -
 package/dhcpcd/dhcpcd.mk                      |   3 -
 package/docker-engine/docker-engine.mk        |   3 -
 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/iputils/iputils.mk                    |  16 --
 package/irqbalance/irqbalance.mk              |   3 -
 package/iucode-tool/iucode-tool.mk            |   3 -
 package/kodi/kodi.mk                          |   5 -
 package/lighttpd/lighttpd.mk                  |   6 -
 .../linuxptp/linuxptp-system-clock.service    |   1 -
 package/linuxptp/linuxptp.mk                  |   3 -
 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/rauc/rauc.mk                          |   5 +-
 package/redis/redis.mk                        |   3 -
 package/rng-tools/rng-tools.mk                |   3 -
 package/rpcbind/rpcbind.mk                    |   3 -
 package/rsyslog/rsyslog.mk                    |  14 --
 package/rygel/rygel.mk                        |   3 -
 package/samba4/samba4.mk                      |   7 -
 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/sysklogd.mk                  |   5 -
 package/syslog-ng/syslog-ng.mk                |   7 +-
 package/sysrepo/sysrepo.mk                    |  10 +-
 .../systemd-bootchart/systemd-bootchart.mk    |   6 -
 package/systemd/80-buildroot.preset           |   4 +
 package/systemd/Config.in                     |   2 +-
 package/systemd/Config.in.host                |   3 +
 package/systemd/systemd.mk                    | 225 ++++++++++--------
 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/transmission/transmission.mk          |   3 -
 package/triggerhappy/triggerhappy.mk          |   3 -
 package/upmpdcli/upmpdcli.mk                  |   3 -
 .../wpa_supplicant/50-wpa_supplicant.preset   |   4 +
 package/wpa_supplicant/wpa_supplicant.mk      |   2 +
 99 files changed, 155 insertions(+), 484 deletions(-)
 create mode 100644 package/systemd/80-buildroot.preset
 create mode 100644 package/systemd/Config.in.host
 create mode 100644 package/wpa_supplicant/50-wpa_supplicant.preset
Signature · 6 lines
2.24.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#18 lore raw

v5 cover use host-systemd to enable units

Ok, my bad for having you work on it that much, I have still lot to learn about all
those conventions

One specific point I don't agree with below, but it's just a detail at this point

Quoted 9 lines

35c11a027c package/systemd: add host variant
- reformatting in commit log
- declare host variant after target variant
- simplify comments
- slight reordering of variable (HOST_SYSTEMD_NINJA_ENV moved)
- reformatting for mutli-line variable (HOST_SYSTEMD_HOST_TOOLS)
- don't split HOST_SYSTEMD_CONF_OPTS in two sets

well, it's applied now, but I did that in a very specific way

* Variables I specifically set were in the first set
* Disabling all optional features was in the second set

The point was to help maintainability.

Apart from that, nothing suspicious on my side
thx a lot

Signature · 21 lines
[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/20191219/23d99010/attachment.html>
#19 lore raw

v5 cover use host-systemd to enable units

J?r?my, All,

On 2019-12-19 14:50 +0100, J?r?my ROSEN spake thusly:

Quoted 2 lines

Ok, my bad for having you work on it that much, I have still lot to learn about all? those conventions?

Well, what I did was mostly cosmetics, so that did not warrant a respin.

Quoted 10 lines

One specific point I don't agree with below, but it's just a detail at this point

35c11a027c package/systemd: add host variant
? ? ? - reformatting in commit log
? ? ? - declare host variant after target variant
? ? ? - simplify comments
? ? ? - slight reordering of variable (HOST_SYSTEMD_NINJA_ENV moved) ? ? ? - reformatting for mutli-line variable (HOST_SYSTEMD_HOST_TOOLS) ? ? ? - don't split HOST_SYSTEMD_CONF_OPTS in two sets

Quoted 4 lines

well, it's applied now, but I did that in a very specific way
* Variables I specifically set were in the first set
* Disabling all optional features was in the second set The point was to help maintainability.

We almost never do that in Buildroot (I was about to say 'never', but we may or may not have a few cases), but overall, it is not needed. We only do additive settings for those parts that are conditional, which is not the case here.

Still, the two sets are properly separated, with all the =yes first, and the =false last.

Quoted 1 line

Apart from that, nothing suspicious on my side

Thanks! :-)

Regards,
Yann E. MORIN.

Quoted 27 lines

thx a lot
--

+---------------------------------------------------------------------------------------------------------------------+
|                               | J?r?my ROSEN                                                              |
| [1]3D"SMILE"[2] ?        | Architecte technique                                                                |
|                               | [3]3D"email" ? [4]jeremy.rosen at smile.fr?                                  |
| 20 rue des Jardins            | [5]3D"phone" ? +33 6 88 25 87 42?                                         |
| 92600 Asni?res-sur-Seine | [6]3D"url" ? [7]http://www.smile.eu                                            |
|                               | [8]3D"Twitter" ? [9]3D"Facebook" ? [10]3D"LinkedIn" ? [11]3D"Github" |
+---------------------------------------------------------------------------------------------------------------------+

[12]3D"D?couvrez

Links:
1. http://www.smile.eu/
2. http://www.smile.eu/
3. Image: http://ftp.smile.fr/client/Communication/signature/img/mail.png
4. mailto:jeremy.rosen at smile.fr
5. Image: http://ftp.smile.fr/client/Communication/signature/img/phone.png
6. Image: http://ftp.smile.fr/client/Communication/signature/img/web.png
7. http://www.smile.eu/
8. https://twitter.com/GroupeSmile
9. https://www.facebook.com/smileopensource
10. https://www.linkedin.com/company/smile
11. https://github.com/Smile-SA
12. https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'