From 258af8106cbed6fa53f7bee042bf903e58b57a41 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 29 Sep 2020 18:01:41 -0700
Subject: [PATCH] Move sysusers.d/sysctl.d/binfmt.d/modules-load.d to /usr

These directories are moved to /lib since systemd v246, commit
4a56315a990b ("path: use ROOTPREFIX properly"), but in oe-core/yocto,
the old /usr/lib is still being used.

Upstream-Status: Inappropriate (OE-specific)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>

---
 src/core/systemd.pc.in           | 8 ++++----
 src/libsystemd/sd-path/sd-path.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
index 693433b34b..8368a3ff02 100644
--- a/src/core/systemd.pc.in
+++ b/src/core/systemd.pc.in
@@ -67,16 +67,16 @@ tmpfilesdir=${tmpfiles_dir}
 
 user_tmpfiles_dir=${prefix}/share/user-tmpfiles.d
 
-sysusers_dir=${rootprefix}/lib/sysusers.d
+sysusers_dir=${prefix}/lib/sysusers.d
 sysusersdir=${sysusers_dir}
 
-sysctl_dir=${rootprefix}/lib/sysctl.d
+sysctl_dir=${prefix}/lib/sysctl.d
 sysctldir=${sysctl_dir}
 
-binfmt_dir=${rootprefix}/lib/binfmt.d
+binfmt_dir=${prefix}/lib/binfmt.d
 binfmtdir=${binfmt_dir}
 
-modules_load_dir=${rootprefix}/lib/modules-load.d
+modules_load_dir=${prefix}/lib/modules-load.d
 modulesloaddir=${modules_load_dir}
 
 catalog_dir=${prefix}/lib/systemd/catalog
diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c
index ac33e349c0..f0615ffb22 100644
--- a/src/libsystemd/sd-path/sd-path.c
+++ b/src/libsystemd/sd-path/sd-path.c
@@ -362,19 +362,19 @@ static int get_path(uint64_t type, char **buffer, const char **ret) {
                 return 0;
 
         case SD_PATH_SYSUSERS:
-                *ret = ROOTPREFIX_NOSLASH "/lib/sysusers.d";
+                *ret = "/usr/lib/sysusers.d";
                 return 0;
 
         case SD_PATH_SYSCTL:
-                *ret = ROOTPREFIX_NOSLASH "/lib/sysctl.d";
+                *ret = "/usr/lib/sysctl.d";
                 return 0;
 
         case SD_PATH_BINFMT:
-                *ret = ROOTPREFIX_NOSLASH "/lib/binfmt.d";
+                *ret = "/usr/lib/binfmt.d";
                 return 0;
 
         case SD_PATH_MODULES_LOAD:
-                *ret = ROOTPREFIX_NOSLASH "/lib/modules-load.d";
+                *ret = "/usr/lib/modules-load.d";
                 return 0;
 
         case SD_PATH_CATALOG:
