commit: 31153db1f45836c37cda3d0c12643c67e1eaca85
Author: Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 23 14:53:58 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 23 15:17:40 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31153db1
systemd.eclass: make all fallback paths use /usr/lib
Back in 2018, the eclass was changed to ensure that the canonical path
used for results was in /lib, since that works for split-usr systems
running systemd while also supporting merged-usr systems due to portage
following symlinks at install time. It even works for binpkgs.
But here and now in 2025, systemd doesn't support split-usr at all.
There is no point in having unit files install conservatively in
/lib/systemd. Update the path to accommodate the new reality.
This mostly has no effect. On openrc profiles, or for packages that use
systemd_dounit without pulling in pkgconfig, binpkgs will be created
with a different, but still working path, which then triggers iwdevtools
warnings when you reinstall a former binpkg from source, as it thinks
the file has "moved". e.g.
```
* CMP: =net-misc/radvd-2.19-r7 with net-misc/radvd-2.20/image
* FILES:-lib/systemd/system/radvd.service
* FILES:+usr/lib/systemd/system/radvd.service
* ------> FILES(+1,-1)
```
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/systemd.eclass | 12 ++++++------
eclass/tests/systemd.sh | 10 +++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index f908ad688d9d..f0b4b79d9c32 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -1,4 +1,4 @@
-# Copyright 2011-2024 Gentoo Authors
+# Copyright 2011-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: systemd.eclass
@@ -77,7 +77,7 @@ _systemd_unprefix() {
systemd_get_systemunitdir() {
debug-print-function ${FUNCNAME} "$@"
- _systemd_get_dir systemdsystemunitdir /lib/systemd/system
+ _systemd_get_dir systemdsystemunitdir /usr/lib/systemd/system
}
# @FUNCTION: systemd_get_userunitdir
@@ -99,7 +99,7 @@ systemd_get_userunitdir() {
systemd_get_utildir() {
debug-print-function ${FUNCNAME} "$@"
- _systemd_get_dir systemdutildir /lib/systemd
+ _systemd_get_dir systemdutildir /usr/lib/systemd
}
# @FUNCTION: systemd_get_systemgeneratordir
@@ -109,7 +109,7 @@ systemd_get_utildir() {
systemd_get_systemgeneratordir() {
debug-print-function ${FUNCNAME} "$@"
- _systemd_get_dir systemdsystemgeneratordir
/lib/systemd/system-generators
+ _systemd_get_dir systemdsystemgeneratordir
/usr/lib/systemd/system-generators
}
# @FUNCTION: systemd_get_systempresetdir
@@ -119,7 +119,7 @@ systemd_get_systemgeneratordir() {
systemd_get_systempresetdir() {
debug-print-function ${FUNCNAME} "$@"
- _systemd_get_dir systemdsystempresetdir /lib/systemd/system-preset
+ _systemd_get_dir systemdsystempresetdir /usr/lib/systemd/system-preset
}
# @FUNCTION: systemd_get_sleepdir
@@ -127,7 +127,7 @@ systemd_get_systempresetdir() {
# Output the path for the system sleep directory.
systemd_get_sleepdir() {
debug-print-function ${FUNCNAME} "$@"
- _systemd_get_dir systemdsleepdir /lib/systemd/system-sleep
+ _systemd_get_dir systemdsleepdir /usr/lib/systemd/system-sleep
}
# @FUNCTION: systemd_dounit
diff --git a/eclass/tests/systemd.sh b/eclass/tests/systemd.sh
index f870df4b7a12..3b735c95bf6a 100755
--- a/eclass/tests/systemd.sh
+++ b/eclass/tests/systemd.sh
@@ -35,11 +35,11 @@ test_systemd_unprefix() {
tend $?
}
-test_system_dir /lib/systemd/system systemd_get_systemunitdir
-test_system_dir /lib/systemd systemd_get_utildir
-test_system_dir /lib/systemd/system-generators systemd_get_systemgeneratordir
-test_system_dir /lib/systemd/system-preset systemd_get_systempresetdir
-test_system_dir /lib/systemd/system-sleep systemd_get_sleepdir
+test_system_dir /usr/lib/systemd/system systemd_get_systemunitdir
+test_system_dir /usr/lib/systemd systemd_get_utildir
+test_system_dir /usr/lib/systemd/system-generators
systemd_get_systemgeneratordir
+test_system_dir /usr/lib/systemd/system-preset systemd_get_systempresetdir
+test_system_dir /usr/lib/systemd/system-sleep systemd_get_sleepdir
test_user_dir /usr/lib/systemd/user systemd_get_userunitdir