[Buildroot] [PATCH v2 19/25] systemd: change install path to /usr/lib

Mike Williams mike at mikebwilliams.com
Fri Mar 20 19:14:10 UTC 2015


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

Signed-off-by: Mike Williams <mike at mikebwilliams.com>
---
 package/systemd/systemd.mk | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 98bda02..b2e69cc 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -27,8 +27,6 @@ SYSTEMD_DEPENDENCIES += busybox
 endif
 
 SYSTEMD_CONF_OPTS += \
-	--with-rootprefix= \
-	--with-rootlibdir=/lib \
 	--enable-static=no \
 	--disable-manpages \
 	--disable-selinux \
@@ -107,9 +105,9 @@ 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,13 @@ 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 +156,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 +198,8 @@ define SYSTEMD_INSTALL_SERVICE_TTY
 	else \
 		SERVICE="serial-getty"; \
 	fi; \
-	ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/getty.target.wants
+	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




More information about the buildroot mailing list