Skip to contentSkip to conversation

RFC: systemd and service files cleanup

Buildroot New Mike Williams 5 participants 57 messages Mar 19, 2015 – Mar 20, 2015

lore
Share & tools
lore
#0 lore raw

All,

Currently, package service files for systemd are installed by buildroot in a variety of locations: /etc, /lib, and /usr/lib. For systemd, split /lib is deprecated and only checked if a split /lib and /usr/lib is enabled. /etc is meant for local customizations to the default service files. It is my opinion that buildroot should install all upstream package and buildroot-provided service files in /usr/lib, and this series cleans up our packages to do exactly that. Enabling them by default by linking them to /etc/systemd/system/multi-user.target.wants has been preserved.

Upstream systemd's standard installation directory for its binaries is /usr/lib. It appears that historically, buildroot's systemd installation location has been switched between /lib and /usr/lib multiple times. I couldn't find any particular reason for this, so I've moved it back to /usr/lib along with its service files.

Anyway, please send comments :).

Mike Williams

#1 lore raw

PATCH 1/15 ntp: move systemd service file to /usr/lib

---
 package/ntp/ntp.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/ntp/ntp.mk +2 -2
index 7d5644a..0e42f15 100644
@@ -71,9 +71,9 @@ define NTP_INSTALL_INIT_SYSV
 endef
 
 define NTP_INSTALL_INIT_SYSTEMD
-	$(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/etc/systemd/system/ntpd.service
+	$(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 ../ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
+	ln -fs /usr/lib/systemd/system/ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
 endef
 endif
 
Signature · 1 line
2.1.0
#2 lore raw

PATCH 1/15 ntp: move systemd service file to /usr/lib

Quoted 1 line · Mike Williams
Quoted 20 lines
---
 package/ntp/ntp.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/ntp/ntp.mk +2 -2
index 7d5644a..0e42f15 100644
@@ -71,9 +71,9 @@ define NTP_INSTALL_INIT_SYSV
 endef
 
 define NTP_INSTALL_INIT_SYSTEMD
-       $(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/etc/systemd/system/ntpd.service
+       $(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 ../ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
+       ln -fs /usr/lib/systemd/system/ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
 endef
 endif
 
#4 lore raw

PATCH 2/15 openvmtools: move systemd service to /usr/lib

In reply to Mike Williams
---
 package/openvmtools/openvmtools.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/openvmtools/openvmtools.mk +2 -2
index e0ec6d6..84d9a81 100644
@@ -67,9 +67,9 @@ endef
 
 define OPENVMTOOLS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/openvmtools/vmtoolsd.service \
-		$(TARGET_DIR)/etc/systemd/system/vmtoolsd.service
+		$(TARGET_DIR)/usr/lib/systemd/system/vmtoolsd.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../vmtoolsd.service \
+	ln -fs /usr/lib/systemd/system/vmtoolsd.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vmtoolsd.service
 endef
 
Signature · 1 line
2.1.0
#5 lore raw

PATCH 2/15 openvmtools: move systemd service to /usr/lib

Quoted 1 line · Mike Williams
Quoted 27 lines
---
 package/openvmtools/openvmtools.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/openvmtools/openvmtools.mk +2 -3
index e0ec6d6..84d9a81 100644
@@ -67,9 +67,9 @@ endef
 
 define OPENVMTOOLS_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/openvmtools/vmtoolsd.service \
-               $(TARGET_DIR)/etc/systemd/system/vmtoolsd.service
+               $(TARGET_DIR)/usr/lib/systemd/system/vmtoolsd.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs ../vmtoolsd.service \
+       ln -fs /usr/lib/systemd/system/vmtoolsd.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vmtoolsd.service
 endef
 
--

2.1.0

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

#7 lore raw

PATCH 3/15 psplash: move systemd service files to /usr/lib

In reply to Mike Williams
---
 package/psplash/psplash.mk | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
package/psplash/psplash.mk +5 -5
index 5901547..866aa9f 100644
@@ -11,15 +11,15 @@ PSPLASH_AUTORECONF = YES
 
 define PSPLASH_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/psplash/psplash-start.service \
-		$(TARGET_DIR)/etc/systemd/system/psplash-start.service
-	$(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-	ln -sf  ../psplash-start.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/psplash-start.service
+	$(INSTALL) -d $(TARGET_DIR)/usr/lib/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)/etc/systemd/system/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  ../psplash-quit.service \
+	ln -sf  /usr/lib/systemd/system/psplash-quit.service \
 		 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
 endef
 
Signature · 1 line
2.1.0
#8 lore raw

PATCH 3/15 psplash: move systemd service files to /usr/lib

Quoted 1 line · Mike Williams
Quoted 36 lines
---
 package/psplash/psplash.mk | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
package/psplash/psplash.mk +5 -6
index 5901547..866aa9f 100644
@@ -11,15 +11,15 @@ PSPLASH_AUTORECONF = YES
 
 define PSPLASH_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/psplash/psplash-start.service \
-               $(TARGET_DIR)/etc/systemd/system/psplash-start.service
-       $(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-       ln -sf  ../psplash-start.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/psplash-start.service
+       $(INSTALL) -d $(TARGET_DIR)/usr/lib/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)/etc/systemd/system/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  ../psplash-quit.service \
+       ln -sf  /usr/lib/systemd/system/psplash-quit.service \
                 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
 endef
 
--

2.1.0

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

#10 lore raw

PATCH 4/15 openntpd: move systemd service files to /usr/lib

In reply to Mike Williams
---
 package/openntpd/openntpd.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/openntpd/openntpd.mk +2 -2
index 60f025c..dcd7c7f 100644
@@ -11,9 +11,9 @@ OPENNTPD_LICENSE_FILES = COPYING
 
 define OPENNTPD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/openntpd/ntpd.service \
-		$(TARGET_DIR)/etc/systemd/system/ntpd.service
+		$(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../ntpd.service \
+	ln -fs /usr/lib/systemd/system/ntpd.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
 endef
 
Signature · 1 line
2.1.0
#11 lore raw

PATCH 4/15 openntpd: move systemd service files to /usr/lib

Quoted 1 line · Mike Williams
Quoted 27 lines
---
 package/openntpd/openntpd.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/openntpd/openntpd.mk +2 -3
index 60f025c..dcd7c7f 100644
@@ -11,9 +11,9 @@ OPENNTPD_LICENSE_FILES = COPYING
 
 define OPENNTPD_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 0644 package/openntpd/ntpd.service \
-               $(TARGET_DIR)/etc/systemd/system/ntpd.service
+               $(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs ../ntpd.service \
+       ln -fs /usr/lib/systemd/system/ntpd.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
 endef
 
--

2.1.0

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

#13 lore raw

PATCH 5/15 dbus: move systemd service files to /usr/lib

In reply to Mike Williams
---
 package/dbus/dbus.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/dbus/dbus.mk +1 -1
index 200084f..c810800 100644
@@ -54,7 +54,7 @@ endif
 ifeq ($(BR2_INIT_SYSTEMD),y)
 DBUS_CONF_OPTS += \
 	--enable-systemd \
-	--with-systemdsystemunitdir=/lib/systemd/system
+	--with-systemdsystemunitdir=/usr/lib/systemd/system
 DBUS_DEPENDENCIES += systemd
 else
 DBUS_CONF_OPTS += --disable-systemd
Signature · 1 line
2.1.0
#14 lore raw

PATCH 5/15 dbus: move systemd service files to /usr/lib

Quoted 1 line · Mike Williams
Quoted 24 lines
---
 package/dbus/dbus.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/dbus/dbus.mk +1 -2
index 200084f..c810800 100644
@@ -54,7 +54,7 @@ endif
 ifeq ($(BR2_INIT_SYSTEMD),y)
 DBUS_CONF_OPTS += \
        --enable-systemd \
-       --with-systemdsystemunitdir=/lib/systemd/system
+       --with-systemdsystemunitdir=/usr/lib/systemd/system
 DBUS_DEPENDENCIES += systemd
 else
 DBUS_CONF_OPTS += --disable-systemd
--

2.1.0

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

#16 lore raw

PATCH 6/15 avahi: systemd cleanups

In reply to Mike Williams

* Move service files to /usr/lib/systemd/system/
* Only disable systemd support on non-systemd systems

---
 package/avahi/0002-disable-systemd-support.patch | 22 ----------------------
 package/avahi/avahi.mk                           |  8 ++++++--
 2 files changed, 6 insertions(+), 24 deletions(-)
 delete mode 100644 package/avahi/0002-disable-systemd-support.patch
package/avahi/0002-disable-systemd-support.patch deleted +0 -22
deleted file mode 100644
index 909795a..0000000
@@ -1,22 +0,0 @@
-[PATCH] avahi-daemon: disable systemd support
-
-Disable systemd support as it isn't needed for BR, and uses SOCK_CLOEXEC
-which isn't available on uClibc.
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- avahi-daemon/sd-daemon.h |    1 +
- 1 file changed, 1 insertion(+)
-
-Index: avahi-0.6.27/avahi-daemon/sd-daemon.h
-===================================================================
---- avahi-0.6.27.orig/avahi-daemon/sd-daemon.h
-+++ avahi-0.6.27/avahi-daemon/sd-daemon.h
-@@ -66,6 +66,7 @@ extern "C" {
- 
-   See sd-daemon(7) for more information.
- */
-+#define DISABLE_SYSTEMD /* no systemd support in BR */
- 
- #if __GNUC__ >= 4
- #define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
package/avahi/avahi.mk +6 -2
index 10c9915..3f0cbe9 100644
@@ -88,6 +88,10 @@ AVAHI_DEPENDENCIES = \
 	$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) host-intltool \
 	host-pkgconf host-gettext
 
+ifneq ($(BR2_PACKAGE_SYSTEMD),y)
+AVAHI_EXTRA_CFLAGS += -DDISABLE_SYSTEMD
+endif
+
 ifneq ($(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_AVAHI_AUTOIPD),)
 AVAHI_DEPENDENCIES += libdaemon
 else
@@ -185,10 +189,10 @@ ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
 define AVAHI_INSTALL_INIT_SYSTEMD
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
-	ln -fs /lib/systemd/system/avahi-daemon.service \
+	ln -fs /usr/lib/systemd/system/avahi-daemon.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
 
-	ln -fs /lib/systemd/system/avahi-dnsconfd.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 \
Signature · 1 line
2.1.0
#17 lore raw

PATCH 6/15 avahi: systemd cleanups

Quoted 4 lines · Mike Williams

* Move service files to /usr/lib/systemd/system/
* Only disable systemd support on non-systemd systems

Quoted 69 lines
---
 package/avahi/0002-disable-systemd-support.patch | 22 ----------------------
 package/avahi/avahi.mk                           |  8 ++++++--
 2 files changed, 6 insertions(+), 24 deletions(-)
 delete mode 100644 package/avahi/0002-disable-systemd-support.patch
package/avahi/0002-disable-systemd-support.patch deleted +0 -22
deleted file mode 100644
index 909795a..0000000
@@ -1,22 +0,0 @@
-[PATCH] avahi-daemon: disable systemd support
-
-Disable systemd support as it isn't needed for BR, and uses SOCK_CLOEXEC
-which isn't available on uClibc.
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- avahi-daemon/sd-daemon.h |    1 +
- 1 file changed, 1 insertion(+)
-
-Index: avahi-0.6.27/avahi-daemon/sd-daemon.h
-===================================================================
---- avahi-0.6.27.orig/avahi-daemon/sd-daemon.h
-+++ avahi-0.6.27/avahi-daemon/sd-daemon.h
-@@ -66,6 +66,7 @@ extern "C" {
-
-   See sd-daemon(7) for more information.
- */
-+#define DISABLE_SYSTEMD /* no systemd support in BR */
-
- #if __GNUC__ >= 4
- #define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
package/avahi/avahi.mk +6 -3
index 10c9915..3f0cbe9 100644
@@ -88,6 +88,10 @@ AVAHI_DEPENDENCIES = \
        $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) host-intltool \
        host-pkgconf host-gettext
 
+ifneq ($(BR2_PACKAGE_SYSTEMD),y)
+AVAHI_EXTRA_CFLAGS += -DDISABLE_SYSTEMD
+endif
+
 ifneq ($(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_AVAHI_AUTOIPD),)
 AVAHI_DEPENDENCIES += libdaemon
 else
@@ -185,10 +189,10 @@ ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
 define AVAHI_INSTALL_INIT_SYSTEMD
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
-       ln -fs /lib/systemd/system/avahi-daemon.service \
+       ln -fs /usr/lib/systemd/system/avahi-daemon.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
 
-       ln -fs /lib/systemd/system/avahi-dnsconfd.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 \
--

2.1.0

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

#19 lore raw

PATCH 6/15 avahi: systemd cleanups

In reply to Mike Williams

Dear Mike Williams,

package/avahi/avahi.mk AVAHI_DEPENDENCIES = \ · line 93

Quoted 3 lines · Mike Williams
package/avahi/avahi.mk +3 -0
+ifneq ($(BR2_PACKAGE_SYSTEMD),y)
+AVAHI_EXTRA_CFLAGS += -DDISABLE_SYSTEMD
+endif

This cannot work, since AVAHI_EXTRA_CFLAGS is not used by anything.

I'm surprised you got a Reviewed-by from Samuel and Steven with this big issue.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#20 lore raw

PATCH 6/15 avahi: systemd cleanups

Quoted 4 lines · Thomas Petazzoni

Dear Mike Williams,

On Thu, 19 Mar 2015 13:56:38 -0400, Mike Williams wrote:

Quoted 8 lines

package/avahi/avahi.mk AVAHI_DEPENDENCIES = \ · line 93

Quoted 3 lines
package/avahi/avahi.mk +3 -0
+ifneq ($(BR2_PACKAGE_SYSTEMD),y)
+AVAHI_EXTRA_CFLAGS += -DDISABLE_SYSTEMD
+endif

This cannot work, since AVAHI_EXTRA_CFLAGS is not used by anything.

I'm surprised you got a Reviewed-by from Samuel and Steven with this big issue.

argh! right! I missed that :-s

Signature · 1 line
Samuel
#21 lore raw

PATCH 7/15 irqbalance: move systemd service file to /usr/lib

In reply to Mike Williams
---
 package/irqbalance/irqbalance.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/irqbalance/irqbalance.mk +2 -2
index e3ef0bb..536d0e0 100644
@@ -26,9 +26,9 @@ endef
 
 define IRQBALANCE_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/irqbalance/irqbalance.service \
-		$(TARGET_DIR)/etc/systemd/system/irqbalance.service
+		$(TARGET_DIR)/usr/lib/systemd/system/irqbalance.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../irqbalance.service \
+	ln -fs /usr/lib/systemd/system/irqbalance.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/irqbalance.service
 endef
 
Signature · 1 line
2.1.0
#22 lore raw

PATCH 7/15 irqbalance: move systemd service file to /usr/lib

Quoted 1 line · Mike Williams
Quoted 27 lines
---
 package/irqbalance/irqbalance.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/irqbalance/irqbalance.mk +2 -3
index e3ef0bb..536d0e0 100644
@@ -26,9 +26,9 @@ endef
 
 define IRQBALANCE_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/irqbalance/irqbalance.service \
-               $(TARGET_DIR)/etc/systemd/system/irqbalance.service
+               $(TARGET_DIR)/usr/lib/systemd/system/irqbalance.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs ../irqbalance.service \
+       ln -fs /usr/lib/systemd/system/irqbalance.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/irqbalance.service
 endef
 
--

2.1.0

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

#24 lore raw

PATCH 8/15 openssh: move systemd service files to /usr/lib

In reply to Mike Williams
---
 package/openssh/openssh.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/openssh/openssh.mk +3 -3
index 08f3fa0..eccfad1 100644
@@ -36,10 +36,10 @@ endif
 
 define OPENSSH_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/openssh/sshd.service \
-		$(TARGET_DIR)/etc/systemd/system/sshd.service
+		$(TARGET_DIR)/usr/lib/systemd/system/sshd.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../sshd.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshd.service
+	ln -fs /usr/lib/systemd/system/sshd.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/sshd.service
 endef
 
 define OPENSSH_INSTALL_INIT_SYSV
Signature · 1 line
2.1.0
#25 lore raw

PATCH 8/15 openssh: move systemd service files to /usr/lib

Quoted 1 line · Mike Williams
Quoted 29 lines
---
 package/openssh/openssh.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/openssh/openssh.mk +3 -4
index 08f3fa0..eccfad1 100644
@@ -36,10 +36,10 @@ endif
 
 define OPENSSH_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/openssh/sshd.service \
-               $(TARGET_DIR)/etc/systemd/system/sshd.service
+               $(TARGET_DIR)/usr/lib/systemd/system/sshd.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs ../sshd.service \
-               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshd.service
+       ln -fs /usr/lib/systemd/system/sshd.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/sshd.service
 endef
 
 define OPENSSH_INSTALL_INIT_SYSV
--

2.1.0

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

#27 lore raw

PATCH 9/15 rsyslog: move systemd service file to /usr/lib

In reply to Mike Williams
---
 package/rsyslog/rsyslog.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/rsyslog/rsyslog.mk +1 -1
index c6758eb..7bc6a67 100644
@@ -65,7 +65,7 @@ define RSYSLOG_INSTALL_INIT_SYSV
 endef
 
 define RSYSLOG_INSTALL_INIT_SYSTEMD
-	ln -sf /lib/systemd/system/rsyslog.service \
+	ln -sf /usr/lib/systemd/system/rsyslog.service \
 		$(TARGET_DIR)/etc/systemd/system/syslog.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 	ln -sf ../syslog.service \
Signature · 1 line
2.1.0
#28 lore raw

PATCH 9/15 rsyslog: move systemd service file to /usr/lib

Quoted 10 lines · Mike Williams
---
 package/rsyslog/rsyslog.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/rsyslog/rsyslog.mk +0 -0
index c6758eb..7bc6a67 100644

package/rsyslog/rsyslog.mk define RSYSLOG_INSTALL_INIT_SYSV · line 69

Quoted 6 lines
package/rsyslog/rsyslog.mk +1 -1
@@ -65,7 +65,7 @@ define RSYSLOG_INSTALL_INIT_SYSV
 endef
 
 define RSYSLOG_INSTALL_INIT_SYSTEMD
-       ln -sf /lib/systemd/system/rsyslog.service \
+       ln -sf /usr/lib/systemd/system/rsyslog.service \
                $(TARGET_DIR)/etc/systemd/system/syslog.service

Nothing needs to change in rsyslog to make it install the unit to this location?

Quoted 9 lines
package/rsyslog/rsyslog.mk +0 -1
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
        ln -sf ../syslog.service \
--

2.1.0

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

#29 lore raw

PATCH 9/15 rsyslog: move systemd service file to /usr/lib

In reply to Mike Williams

Hi Mike,

Quoted 10 lines · Mike Williams
---
 package/rsyslog/rsyslog.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/rsyslog/rsyslog.mk +0 -0
index c6758eb..7bc6a67 100644

package/rsyslog/rsyslog.mk define RSYSLOG_INSTALL_INIT_SYSV · line 71

Quoted 8 lines
package/rsyslog/rsyslog.mk +1 -1
@@ -65,7 +65,7 @@ define RSYSLOG_INSTALL_INIT_SYSV
 endef
 
 define RSYSLOG_INSTALL_INIT_SYSTEMD
-       ln -sf /lib/systemd/system/rsyslog.service \
+       ln -sf /usr/lib/systemd/system/rsyslog.service \
                $(TARGET_DIR)/etc/systemd/system/syslog.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
        ln -sf ../syslog.service \

You also need to update the symlink target here.

Regards,

Signature · 1 line
Samuel
#30 lore raw

PATCH 10/15 dropbear: move systemd service file to /usr/lib

In reply to Mike Williams
---
 package/dropbear/dropbear.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/dropbear/dropbear.mk +2 -2
index f2ae403..760fff2 100644
@@ -53,9 +53,9 @@ endef
 
 define DROPBEAR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
-		$(TARGET_DIR)/lib/systemd/system/dropbear.service
+		$(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs /lib/systemd/system/dropbear.service \
+	ln -fs /usr/lib/systemd/system/dropbear.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dropbear.service
 endef
 
Signature · 1 line
2.1.0
#31 lore raw

PATCH 10/15 dropbear: move systemd service file to /usr/lib

Quoted 1 line · Mike Williams
Quoted 27 lines
---
 package/dropbear/dropbear.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/dropbear/dropbear.mk +2 -3
index f2ae403..760fff2 100644
@@ -53,9 +53,9 @@ endef
 
 define DROPBEAR_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
-               $(TARGET_DIR)/lib/systemd/system/dropbear.service
+               $(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs /lib/systemd/system/dropbear.service \
+       ln -fs /usr/lib/systemd/system/dropbear.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dropbear.service
 endef
 
--

2.1.0

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

#33 lore raw

PATCH 11/15 postgresql: move systemd service file to /usr/lib

In reply to Mike Williams
---
 package/postgresql/postgresql.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/postgresql/postgresql.mk +2 -2
index 7dc3f0b..e904760 100644
@@ -85,9 +85,9 @@ endef
 
 define POSTGRESQL_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/postgresql/postgresql.service \
-		$(TARGET_DIR)/etc/systemd/system/postgresql.service
+		$(TARGET_DIR)/usr/lib/systemd/system/postgresql.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../postgresql.service \
+	ln -fs /usr/lib/systemd/system/postgresql.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
 endef
 
Signature · 1 line
2.1.0
#34 lore raw

PATCH 11/15 postgresql: move systemd service file to /usr/lib

Quoted 1 line · Mike Williams
Quoted 27 lines
---
 package/postgresql/postgresql.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/postgresql/postgresql.mk +2 -3
index 7dc3f0b..e904760 100644
@@ -85,9 +85,9 @@ endef
 
 define POSTGRESQL_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/postgresql/postgresql.service \
-               $(TARGET_DIR)/etc/systemd/system/postgresql.service
+               $(TARGET_DIR)/usr/lib/systemd/system/postgresql.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs ../postgresql.service \
+       ln -fs /usr/lib/systemd/system/postgresql.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
 endef
 
--

2.1.0

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

#36 lore raw

PATCH 12/15 libiio: move systemd service file to /usr/lib

In reply to Mike Williams
---
 package/libiio/libiio.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/libiio/libiio.mk +2 -2
index abcddba..a821892 100644
@@ -41,8 +41,8 @@ endef
 define LIBIIO_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 	$(INSTALL) -D -m 0644 $(@D)/debian/iiod.service \
-		$(TARGET_DIR)/lib/systemd/system/iiod.service
-	ln -fs /lib/systemd/system/iiod.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/iiod.service
+	ln -fs /usr/lib/systemd/system/iiod.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/iiod.service
 endef
 endif
Signature · 1 line
2.1.0
#37 lore raw

PATCH 12/15 libiio: move systemd service file to /usr/lib

Quoted 1 line · Mike Williams
Quoted 26 lines
---
 package/libiio/libiio.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/libiio/libiio.mk +2 -3
index abcddba..a821892 100644
@@ -41,8 +41,8 @@ endef
 define LIBIIO_INSTALL_INIT_SYSTEMD
        $(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
        $(INSTALL) -D -m 0644 $(@D)/debian/iiod.service \
-               $(TARGET_DIR)/lib/systemd/system/iiod.service
-       ln -fs /lib/systemd/system/iiod.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/iiod.service
+       ln -fs /usr/lib/systemd/system/iiod.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/iiod.service
 endef
 endif
--

2.1.0

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

#39 lore raw

PATCH 13/15 dhcp: move systemd service file to /usr/lib

In reply to Mike Williams
---
 package/dhcp/dhcp.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/dhcp/dhcp.mk +2 -2
index f01a5fa..85acfbf 100644
@@ -78,11 +78,11 @@ endef
 ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
 define DHCP_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dhcp/dhcpd.service \
-		$(TARGET_DIR)/lib/systemd/system/dhcpd.service
+		$(TARGET_DIR)/usr/lib/systemd/system/dhcpd.service
 
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
-	ln -sf ../../../../lib/systemd/system/dhcpd.service \
+	ln -sf /usr/lib/systemd/system/dhcpd.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpd.service
 
 	echo "d /var/lib/dhcp 0755 - - - -" > \
Signature · 1 line
2.1.0
#40 lore raw

PATCH 13/15 dhcp: move systemd service file to /usr/lib

Quoted 1 line · Mike Williams
Quoted 29 lines
---
 package/dhcp/dhcp.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/dhcp/dhcp.mk +2 -3
index f01a5fa..85acfbf 100644
@@ -78,11 +78,11 @@ endef
 ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
 define DHCP_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/dhcp/dhcpd.service \
-               $(TARGET_DIR)/lib/systemd/system/dhcpd.service
+               $(TARGET_DIR)/usr/lib/systemd/system/dhcpd.service
 
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
-       ln -sf ../../../../lib/systemd/system/dhcpd.service \
+       ln -sf /usr/lib/systemd/system/dhcpd.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpd.service
 
        echo "d /var/lib/dhcp 0755 - - - -" > \
--

2.1.0

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

#42 lore raw

PATCH 14/15 kodi: move systemd service file to /usr/lib

In reply to Mike Williams
---
 package/kodi/kodi.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/kodi/kodi.mk +2 -2
index f40fc31..7ad4988 100644
@@ -256,11 +256,11 @@ endef
 
 define KODI_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/kodi/kodi.service \
-		$(TARGET_DIR)/etc/systemd/system/kodi.service
+		$(TARGET_DIR)/usr/lib/systemd/system/kodi.service
 
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
-	ln -fs ../kodi.service \
+	ln -fs /usr/lib/systemd/system/kodi.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service
 endef
 
Signature · 1 line
2.1.0
#43 lore raw

PATCH 14/15 kodi: move systemd service file to /usr/lib

Quoted 1 line · Mike Williams
Quoted 29 lines
---
 package/kodi/kodi.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/kodi/kodi.mk +2 -3
index f40fc31..7ad4988 100644
@@ -256,11 +256,11 @@ endef
 
 define KODI_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/kodi/kodi.service \
-               $(TARGET_DIR)/etc/systemd/system/kodi.service
+               $(TARGET_DIR)/usr/lib/systemd/system/kodi.service
 
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
-       ln -fs ../kodi.service \
+       ln -fs /usr/lib/systemd/system/kodi.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service
 endef
 
--

2.1.0

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

#45 lore raw

PATCH 15/15 systemd: change install path to /usr/lib

In reply to Mike Williams

/usr/lib is the default path for upstream systemd.

---
 package/systemd/systemd.mk | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
package/systemd/systemd.mk +12 -14
index 98bda02..3ec124c 100644
@@ -27,8 +27,6 @@ SYSTEMD_DEPENDENCIES += busybox
 endif
 
 SYSTEMD_CONF_OPTS += \
-	--with-rootprefix= \
-	--with-rootlibdir=/lib \
 	--enable-static=no \
 	--disable-manpages \
 	--disable-selinux \
@@ -100,16 +98,16 @@ endif
 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
 SYSTEMD_CONF_OPTS += --enable-networkd
 define SYSTEMD_INSTALL_RESOLVCONF_HOOK
-	ln -sf ../run/systemd/resolve/resolv.conf \
+	ln -sf /run/systemd/resolve/resolv.conf \
 		$(TARGET_DIR)/etc/resolv.conf
 endef
 else
 SYSTEMD_CONF_OPTS += --disable-networkd
 define SYSTEMD_INSTALL_SERVICE_NETWORK
 	$(INSTALL) -D -m 644 package/systemd/network.service \
-		$(TARGET_DIR)/etc/systemd/system/network.service
+		$(TARGET_DIR)/usr/lib/systemd/system/network.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../network.service \
+	ln -fs /usr/lib/systemd/system/network.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
 endef
 endif
@@ -118,7 +116,7 @@ ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
 SYSTEMD_CONF_OPTS += --enable-timesyncd
 define SYSTEMD_INSTALL_SERVICE_TIMESYNC
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-	ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
+	ln -sf /usr/lib/systemd/system/systemd-timesyncd.service \
 		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
 endef
 else
@@ -144,12 +142,12 @@ SYSTEMD_MAKE_OPTS += LIBS=-lrt
 SYSTEMD_MAKE_OPTS += LDFLAGS+=-ldl
 
 define SYSTEMD_INSTALL_INIT_HOOK
-	ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
-	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
-	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
-	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
+	ln -fs /usr/lib/systemd/systemd $(TARGET_DIR)/sbin/init
+	ln -fs /usr/bin/systemctl $(TARGET_DIR)/sbin/halt
+	ln -fs /usr/bin/systemctl $(TARGET_DIR)/sbin/poweroff
+	ln -fs /usr/bin/systemctl $(TARGET_DIR)/sbin/reboot
 
-	ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
+	ln -fs /usr/lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
 endef
 
 define SYSTEMD_INSTALL_MACHINEID_HOOK
@@ -157,14 +155,14 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
 endef
 
 define SYSTEMD_SANITIZE_PATH_IN_UNITS
-	find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
+	find $(TARGET_DIR)/usr/lib/systemd/system -name '*.service' \
 		-exec $(SED) 's,$(HOST_DIR),,g' {} \;
 endef
 
 # Disable ldconfig.service, as /sbin/ldconfig is not available when the
 # target is built with a glibc-based toolchain.
 define SYSTEMD_DISABLE_LDCONFIG_SERVICE_HOOK
-	rm -f $(TARGET_DIR)/lib/systemd/system/sysinit.target.wants/ldconfig.service
+	rm -f $(TARGET_DIR)/usr/lib/systemd/system/sysinit.target.wants/ldconfig.service
 endef
 
 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
@@ -199,7 +197,7 @@ define SYSTEMD_INSTALL_SERVICE_TTY
 	else \
 		SERVICE="serial-getty"; \
 	fi; \
-	ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
+	ln -fs /usr/lib/systemd/system/$${SERVICE}@.service \
 		$(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
 endef
 endif
Signature · 1 line
2.1.0
#46 lore raw

PATCH 15/15 systemd: change install path to /usr/lib

Quoted 3 lines · Mike Williams

/usr/lib is the default path for upstream systemd.

Quoted 97 lines
---
 package/systemd/systemd.mk | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
package/systemd/systemd.mk +12 -15
index 98bda02..3ec124c 100644
@@ -27,8 +27,6 @@ SYSTEMD_DEPENDENCIES += busybox
 endif
 
 SYSTEMD_CONF_OPTS += \
-       --with-rootprefix= \
-       --with-rootlibdir=/lib \
        --enable-static=no \
        --disable-manpages \
        --disable-selinux \
@@ -100,16 +98,16 @@ endif
 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
 SYSTEMD_CONF_OPTS += --enable-networkd
 define SYSTEMD_INSTALL_RESOLVCONF_HOOK
-       ln -sf ../run/systemd/resolve/resolv.conf \
+       ln -sf /run/systemd/resolve/resolv.conf \
                $(TARGET_DIR)/etc/resolv.conf
 endef
 else
 SYSTEMD_CONF_OPTS += --disable-networkd
 define SYSTEMD_INSTALL_SERVICE_NETWORK
        $(INSTALL) -D -m 644 package/systemd/network.service \
-               $(TARGET_DIR)/etc/systemd/system/network.service
+               $(TARGET_DIR)/usr/lib/systemd/system/network.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs ../network.service \
+       ln -fs /usr/lib/systemd/system/network.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
 endef
 endif
@@ -118,7 +116,7 @@ ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
 SYSTEMD_CONF_OPTS += --enable-timesyncd
 define SYSTEMD_INSTALL_SERVICE_TIMESYNC
        mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
-       ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
+       ln -sf /usr/lib/systemd/system/systemd-timesyncd.service \
                $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
 endef
 else
@@ -144,12 +142,12 @@ SYSTEMD_MAKE_OPTS += LIBS=-lrt
 SYSTEMD_MAKE_OPTS += LDFLAGS+=-ldl
 
 define SYSTEMD_INSTALL_INIT_HOOK
-       ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
-       ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
-       ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
-       ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
+       ln -fs /usr/lib/systemd/systemd $(TARGET_DIR)/sbin/init
+       ln -fs /usr/bin/systemctl $(TARGET_DIR)/sbin/halt
+       ln -fs /usr/bin/systemctl $(TARGET_DIR)/sbin/poweroff
+       ln -fs /usr/bin/systemctl $(TARGET_DIR)/sbin/reboot
 
-       ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
+       ln -fs /usr/lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
 endef
 
 define SYSTEMD_INSTALL_MACHINEID_HOOK
@@ -157,14 +155,14 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
 endef
 
 define SYSTEMD_SANITIZE_PATH_IN_UNITS
-       find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
+       find $(TARGET_DIR)/usr/lib/systemd/system -name '*.service' \
                -exec $(SED) 's,$(HOST_DIR),,g' {} \;
 endef
 
 # Disable ldconfig.service, as /sbin/ldconfig is not available when the
 # target is built with a glibc-based toolchain.
 define SYSTEMD_DISABLE_LDCONFIG_SERVICE_HOOK
-       rm -f $(TARGET_DIR)/lib/systemd/system/sysinit.target.wants/ldconfig.service
+       rm -f $(TARGET_DIR)/usr/lib/systemd/system/sysinit.target.wants/ldconfig.service
 endef
 
 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
@@ -199,7 +197,7 @@ define SYSTEMD_INSTALL_SERVICE_TTY
        else \
                SERVICE="serial-getty"; \
        fi; \
-       ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
+       ln -fs /usr/lib/systemd/system/$${SERVICE}@.service \
                $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
 endef
 endif
--

2.1.0

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

#48 lore raw
In reply to Mike Williams
Quoted 8 lines · Mike Williams

All,

Currently, package service files for systemd are installed by buildroot in a variety of locations: /etc, /lib, and /usr/lib. For systemd, split /lib is deprecated and only checked if a split /lib and /usr/lib is enabled. /etc is meant for local customizations to the default service files. It is my opinion that buildroot should install all upstream package and buildroot-provided service files in /usr/lib, and this series cleans up our packages to do exactly that. Enabling them by default by linking them to /etc/systemd/system/multi-user.target.wants has been preserved.

Upstream systemd's standard installation directory for its binaries is /usr/lib. It appears that historically, buildroot's systemd installation location has been switched between /lib and /usr/lib multiple times. I couldn't find any particular reason for this, so I've moved it back to /usr/lib along with its service files.

Anyway, please send comments :).

Nice. Basically any systemd units installed by Buildroot should be in /usr/lib/systemd/system and nothing from Buildroot should be installed to /etc/systemd/system, so I agree with this series as a whole in terms of direction.

Also, I have a related patch set, but it has only had very light testing on my end:

http://git.uplinklabs.net/snoonan/projects/buildroot.git/log/?h=unified-bin

I come from the Arch Linux world, so I made a new skeleton that matches the Arch base filesystem layout: with /bin, /sbin, /usr/bin, and /usr/sbin all unified (likewise with /lib and /usr/lib). I haven't convinced myself to post the series because I can't think of a particularly good justification for it in the Buildroot context.

#49 lore raw
Quoted 5 lines

I come from the Arch Linux world, so I made a new skeleton that matches the Arch base filesystem layout: with /bin, /sbin, /usr/bin, and /usr/sbin all unified (likewise with /lib and /usr/lib). I haven't convinced myself to post the series because I can't think of a particularly good justification for it in the Buildroot context.

I'm working that way myself, I don't know what use cases in Buildroot still require the split.

#50 lore raw
Quoted 8 lines · Mike Williams
Quoted 5 lines

I come from the Arch Linux world, so I made a new skeleton that matches the Arch base filesystem layout: with /bin, /sbin, /usr/bin, and /usr/sbin all unified (likewise with /lib and /usr/lib). I haven't convinced myself to post the series because I can't think of a particularly good justification for it in the Buildroot context.

I'm working that way myself, I don't know what use cases in Buildroot still require the split.

We could consider offering it as an experimental alternative to the default skeleton (just add another "choice" in kconfig, as I did in my patch series). And open a discussion about unifying the directory structure. It's certainly possible to support both use cases, though it does require more testing.

#51 lore raw
Quoted 7 lines · Steven Noonan
Quoted 6 lines · Mike Williams
Quoted 5 lines

I come from the Arch Linux world, so I made a new skeleton that matches the Arch base filesystem layout: with /bin, /sbin, /usr/bin, and /usr/sbin all unified (likewise with /lib and /usr/lib). I haven't convinced myself to post the series because I can't think of a particularly good justification for it in the Buildroot context.

Quoted 8 lines
Quoted 2 lines

I'm working that way myself, I don't know what use cases in Buildroot still require the split.

We could consider offering it as an experimental alternative to the default skeleton (just add another "choice" in kconfig, as I did in my patch series). And open a discussion about unifying the directory structure. It's certainly possible to support both use cases, though it does require more testing.

I've also started using a unified /bin /sbin /usr/bin /usr/sbin and unified
/lib /usr/lib /lib64 /usr/lib64, and it really simplifies things a lot. I yet have to find a disadvantage.

Make it it a choice sounds like a great idea! Please Cc me on the patch :-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#52 lore raw

All,

Quoted 17 lines · Arnout Vandecappelle
Quoted 7 lines · Steven Noonan
Quoted 6 lines · Mike Williams
Quoted 5 lines

I come from the Arch Linux world, so I made a new skeleton that matches the Arch base filesystem layout: with /bin, /sbin, /usr/bin, and /usr/sbin all unified (likewise with /lib and /usr/lib). I haven't convinced myself to post the series because I can't think of a particularly good justification for it in the Buildroot context.

Quoted 8 lines
Quoted 2 lines

I'm working that way myself, I don't know what use cases in Buildroot still require the split.

We could consider offering it as an experimental alternative to the default skeleton (just add another "choice" in kconfig, as I did in my patch series). And open a discussion about unifying the directory structure. It's certainly possible to support both use cases, though it does require more testing.

Quoted 3 lines

I've also started using a unified /bin /sbin /usr/bin /usr/sbin and unified
/lib /usr/lib /lib64 /usr/lib64, and it really simplifies things a lot. I yet have to find a disadvantage.

Working through this systemd cleanup, I'm now finding that some packages install udev rules to /lib/udev/rules.d by default. The udev documentation states that:

"The udev rules are read from the files located in the system rules directory /usr/lib/udev/rules.d, the volatile runtime directory /run/udev/rules.d and the local administration directory /etc/udev/rules.d." I can verify that systemd's udev does not check /lib/udev/rules.d, even with --enable-split-usr (our current setup). I'm not sure what eudev does.

https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html

It makes me wonder how many upstream developers are already using a merged /usr system, and are not noticing the technically wrong defaults for split systems. Likewise, apparently many of buildroot's systemd users have merged /usr already, they won't notice this breakage in their testing either.

Mike

#53 lore raw
In reply to Mike Williams

Hi Mike, all,

Quoted 7 lines · Mike Williams

All,

Currently, package service files for systemd are installed by buildroot in a variety of locations: /etc, /lib, and /usr/lib. For systemd, split /lib is deprecated and only checked if a split /lib and /usr/lib is enabled. /etc is meant for local customizations to the default service files. It is my opinion that buildroot should install all upstream package and buildroot-provided service files in /usr/lib, and this series cleans up our packages to do exactly that. Enabling them by default by linking them to /etc/systemd/system/multi-user.target.wants has been preserved.

Upstream systemd's standard installation directory for its binaries is /usr/lib. It appears that historically, buildroot's systemd installation location has been switched between /lib and /usr/lib multiple times. I couldn't find any particular reason for this, so I've moved it back to /usr/lib along with its service files.

Anyway, please send comments :).

Thanks for helping improving this point. :)

Just one global comment:
In the series, you change all relative symlink with absolute one. We use to use relative symlink to avoid confusing people looking at the target tree because they are still right.

I don't have strong opinion about this, so let's see what others think about it.

Regards,

Signature · 1 line
Samuel
#54 lore raw
In reply to Mike Williams

Dear Mike Williams,

Adding Steven in Cc.

Quoted 10 lines · Mike Williams

Currently, package service files for systemd are installed by buildroot in a variety of locations: /etc, /lib, and /usr/lib. For systemd, split /lib is deprecated and only checked if a split /lib and /usr/lib is enabled. /etc is meant for local customizations to the default service files. It is my opinion that buildroot should install all upstream package and buildroot-provided service files in /usr/lib, and this series cleans up our packages to do exactly that. Enabling them by default by linking them
to /etc/systemd/system/multi-user.target.wants has been preserved.

Quoted 5 lines

Upstream systemd's standard installation directory for its binaries is /usr/lib. It appears that historically, buildroot's systemd installation location has been switched between /lib and /usr/lib multiple times. I couldn't find any particular reason for this, so I've moved it back to /usr/lib along with its service files.

I am generally fine with the proposed changes, especially since other systemd users looked at them.

However, there's one thing I'm not sure about: you're changing all the relative symbolic links to absolute symbolic links:

- ln -fs ../ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
+ ln -fs /usr/lib/systemd/system/ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service

While it causes no problem on the target, it means that when looking at output/target/ on your build machine, now all those symbolic links are broken. I find it quite nice when relative symlinks are used, since it allows to have things in output/target looking somewhat sensible.

Is there any strong reason for switching to absolute symbolic links?

Also, there are *lots* of systemd related patches sitting in patchwork. Could you and Steven have a look at those pending patches, and let me know which ones can be applied, which ones cannot?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#55 lore raw

Thomas,

Quoted 31 lines · Thomas Petazzoni

Dear Mike Williams,

Adding Steven in Cc.

Quoted 10 lines · Mike Williams

Currently, package service files for systemd are installed by buildroot in a variety of locations: /etc, /lib, and /usr/lib. For systemd, split /lib is deprecated and only checked if a split /lib and /usr/lib is enabled. /etc is meant for local customizations to the default service files. It is my opinion that buildroot should install all upstream package and buildroot-provided service files in /usr/lib, and this series cleans up our packages to do exactly that. Enabling them by default by linking them
to /etc/systemd/system/multi-user.target.wants has been preserved.

Quoted 5 lines

Upstream systemd's standard installation directory for its binaries is /usr/lib. It appears that historically, buildroot's systemd installation location has been switched between /lib and /usr/lib multiple times. I couldn't find any particular reason for this, so I've moved it back to /usr/lib along with its service files.

I am generally fine with the proposed changes, especially since other systemd users looked at them.

However, there's one thing I'm not sure about: you're changing all the relative symbolic links to absolute symbolic links:

(quoted diff) +1 -1
-       ln -fs ../ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
+       ln -fs /usr/lib/systemd/system/ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
Quoted 6 lines

While it causes no problem on the target, it means that when looking at output/target/ on your build machine, now all those symbolic links are broken. I find it quite nice when relative symlinks are used, since it allows to have things in output/target looking somewhat sensible.

Is there any strong reason for switching to absolute symbolic links?

No, they were just relative to the files that used to be in /etc and I used absolute because it was easier for me to not screw them up when changing them :). How about you or one of the other buildroot core team tell me how you want it done, and I'll re-roll the patch series.

Quoted 4 lines

Also, there are *lots* of systemd related patches sitting in patchwork. Could you and Steven have a look at those pending patches, and let me know which ones can be applied, which ones cannot?

Will do. I think after the next series of this patch, and a couple new spins of other patches, we should be able to send you a large list of patches to commit.

Quoted 8 lines

Thanks,

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

#56 lore raw

Dear Mike Williams,

Quoted 6 lines · Mike Williams
Quoted 1 line

Is there any strong reason for switching to absolute symbolic links?

No, they were just relative to the files that used to be in /etc and I used absolute because it was easier for me to not screw them up when changing them :). How about you or one of the other buildroot core team tell me how you want it done, and I'll re-roll the patch series.

Ok, then I believe staying with relative symlinks is probably the safest option, since that's generally what we're doing in the rest of Buildroot.

Quoted 3 lines

Will do. I think after the next series of this patch, and a couple new spins of other patches, we should be able to send you a large list of patches to commit.

Ok, good. If some of the patches need a bit of rework, don't hesitate to pick them up and resend an updated version as needed.

Thanks a lot!

Thomas

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