Skip to contentSkip to conversation

systemd: use system variables instead of hardcoded paths

PATCH Koen Kooi 2 participants 2 messages Sep 14, 2012 – Sep 15, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Koen Kooi

author
#1 lore raw

Please do a git cherry-pick to keep author info

Op 14 sep. 2012, om 12:18 heeft <[email protected]> het volgende geschreven:

Quoted 167 lines

From: Ting Liu <[email protected]>

Back port commit 980b338fb5100ff4c779335a86f3d9450ea8c54a Below is the original commit message:

Fix build for ppc64

Consider /lib64 and /usr/lib64

Some 64bit architectures chose lib64 instead of lib for default library dirnames. So we dig this from metadata vars base_libdir and libdir instead of hardcoding 'lib'

ppc64 in OE uses lib64 for default libdir
and this leaves lot of udev/systemd
files unpackaged since 'lib' was hardcoded

---

meta-oe/classes/systemd.bbclass                    |    5 +-
.../systemd/systemd/use-rootlibdir.patch           |   94 ++++++++++++++++++++
meta-oe/recipes-core/systemd/systemd_git.bb        |    3 +-
3 files changed, 100 insertions(+), 2 deletions(-)

create mode 100644 meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch

meta-oe/classes/systemd.bbclass +4 -1
index a2c8ddf..0d88c64 100644
@@ -154,7 +154,10 @@ python populate_packages_prepend () {
 
 	# check service-files and call systemd_add_files_and_parse for each entry
 	def systemd_check_services():
-		searchpaths = '/etc/systemd/system/ /lib/systemd/system/ /usr/lib/systemd/system/'
+		base_libdir = d.getVar('base_libdir', 1)
+		searchpaths = '/etc/systemd/system/' + ' '
+		searchpaths += d.getVar('base_libdir', 1) + '/systemd/system/' + ' '
+		searchpaths += d.getVar('libdir', 1) + '/systemd/system/' + ' '
 		systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
 		has_exactly_one_service = len(systemd_packages.split()) == 1
 		if has_exactly_one_service:
meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch new file +94 -0
new file mode 100644
index 0000000..26973c4
@@ -0,0 +1,94 @@
+From 5210f67d0c637f4fbd8bb0a94e9b11da25a9c76c Mon Sep 17 00:00:00 2001
+From: Ting Liu <[email protected]>
+Date: Fri, 14 Sep 2012 16:56:30 +0800
+Subject: [PATCH] use rootlibdir
+
+Back port from meta-oe 980b338fb5100ff4c779335a86f3d9450ea8c54a.
+Below is the original message in the patch:
+
+Upstream-Status: Undecided
+
+This patch removes some of hardcoded references to /lib
+and /usr/lib since on some architectures it should be
+/lib64 and /usr/lib64 atleast in OE
+
+I am not sure about the intention of hardcoded values
+thats why status is undecided
+
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Ting Liu <[email protected]>
+---
+ Makefile.am |   20 ++++++++++----------
+ 1 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 219d8de..b96ac74 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -50,19 +50,19 @@ bashcompletiondir=$(sysconfdir)/bash_completion.d
+ 
+ # Our own, non-special dirs
+ pkgsysconfdir=$(sysconfdir)/systemd
+-userunitdir=$(prefix)/lib/systemd/user
+-tmpfilesdir=$(prefix)/lib/tmpfiles.d
+-sysctldir=$(prefix)/lib/sysctl.d
++userunitdir=$(prefix)/$(rootlibdir)/gcsystemd/user
++tmpfilesdir=$(prefix)/$(rootlibdir)/gctmpfiles.d
++sysctldir=$(prefix)/$(rootlibdir)/gcsysctl.d
+ usergeneratordir=$(pkglibexecdir)/user-generators
+ pkgincludedir=$(includedir)/systemd
+ 
+ # And these are the special ones for /
+ rootprefix=@rootprefix@
+ rootbindir=$(rootprefix)/bin
+-rootlibexecdir=$(rootprefix)/lib/systemd
++rootlibexecdir=$(rootprefix)/$(rootlibdir)/gcsystemd
+ systemgeneratordir=$(rootlibexecdir)/system-generators
+ systemshutdowndir=$(rootlibexecdir)/system-shutdown
+-systemunitdir=$(rootprefix)/lib/systemd/system
++systemunitdir=$(rootprefix)/$(rootlibdir)/gcsystemd/system
+ 
+ CLEANFILES =
+ EXTRA_DIST =
+@@ -93,7 +93,7 @@ AM_CPPFLAGS = \
+ 	-DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
+ 	-DROOTPREFIX=\"$(rootprefix)\" \
+ 	-DRUNTIME_DIR=\"/run\" \
+-	-DRANDOM_SEED=\"$(localstatedir)/lib/random-seed\" \
++	-DRANDOM_SEED=\"$(localstatedir)/$(rootlibdir)/gcrandom-seed\" \
+ 	-DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
+ 	-DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
+ 	-DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
+@@ -1408,7 +1408,7 @@ nodist_systemunit_DATA += \
+ 
+ binfmt-install-data-hook:
+ 	$(MKDIR_P) -m 0755 \
+-		$(DESTDIR)$(prefix)/lib/binfmt.d \
++		$(DESTDIR)$(prefix)/$(rootlibdir)/gcbinfmt.d \
+ 		$(DESTDIR)$(sysconfdir)/binfmt.d \
+ 		$(DESTDIR)$(systemunitdir)/sysinit.target.wants
+ 	( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
+@@ -1940,7 +1940,7 @@ polkitpolicy_in_files += \
+ logind-install-data-hook:
+ 	$(MKDIR_P) -m 0755 \
+ 		$(DESTDIR)$(systemunitdir)/multi-user.target.wants \
+-                $(DESTDIR)$(localstatedir)/lib/systemd
++                $(DESTDIR)$(localstatedir)/$(rootlibdir)/gcsystemd
+ 	( cd $(DESTDIR)$(systemunitdir) && \
+ 		rm -f dbus-org.freedesktop.login1.service && \
+ 		$(LN_S) systemd-logind.service dbus-org.freedesktop.login1.service)
+@@ -2196,9 +2196,9 @@ systemd-install-data-hook:
+ 	$(MKDIR_P) -m 0755 \
+ 		$(DESTDIR)$(tmpfilesdir) \
+ 		$(DESTDIR)$(sysconfdir)/tmpfiles.d \
+-		$(DESTDIR)$(prefix)/lib/modules-load.d \
++		$(DESTDIR)$(prefix)/$(rootlibdir)/gcmodules-load.d \
+ 		$(DESTDIR)$(sysconfdir)/modules-load.d \
+-		$(DESTDIR)$(prefix)/lib/sysctl.d \
++		$(DESTDIR)$(prefix)/$(rootlibdir)/gcsysctl.d \
+ 		$(DESTDIR)$(sysconfdir)/sysctl.d \
+ 		$(DESTDIR)$(systemshutdowndir) \
+ 		$(DESTDIR)$(systemgeneratordir) \
+-- 
+1.7.5
+
meta-oe/recipes-core/systemd/systemd_git.bb +0 -0
index b9c8a19..21a6326 100644
@@ -14,13 +14,14 @@ inherit gitpkgv

PKGV = "v${GITPKGVTAG}"

PV = "git"

meta-oe/recipes-core/systemd/systemd_git.bb +1 -1
-PR = "r28"
+PR = "r29"

inherit useradd pkgconfig autotools vala perlnative

SRCREV = "3eff4208ffecedd778fec260f0d4b18e94dab443"

SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \

+           file://use-rootlibdir.patch \
           ${UCLIBCPATCHES} \
           file://var-run.conf \
          "
Signature · 1 line
1.7.5
#2 lore raw
Quoted 11 lines

-----Original Message-----
From: Koen Kooi [mailto:[email protected]]
Sent: Friday, September 14, 2012 8:32 PM
To: Liu Ting-B28495
Cc: [email protected]; Khem Raj; openembedded- [email protected]
Subject: Re: [meta-oe v2][for-denzil][PATCH] systemd: use system variables instead of hardcoded paths

Please do a git cherry-pick to keep author info

[Liu Ting-B28495] My fault. Because recipes are moved to meta-systemd and the systemd source code has changed, the original commit can't be used directly on denzil. Moreover, the fix is part of the original commit "systemd: Upgrade to 187 tag". So I generate a new patch in the same way with original commit, include related messages, and use a more clear title. Sorry for not keeping author info.

Quoted 180 lines

Op 14 sep. 2012, om 12:18 heeft <[email protected]> het volgende geschreven:

Quoted 16 lines

From: Ting Liu <[email protected]>

Back port commit 980b338fb5100ff4c779335a86f3d9450ea8c54a Below is the original commit message:

Fix build for ppc64

Consider /lib64 and /usr/lib64

Some 64bit architectures chose lib64 instead of lib for default library dirnames. So we dig this from metadata vars base_libdir and libdir instead of hardcoding 'lib'

ppc64 in OE uses lib64 for default libdir and this leaves lot of udev/systemd files unpackaged since 'lib' was hardcoded

Quoted 6 lines

---
meta-oe/classes/systemd.bbclass | 5 +-
.../systemd/systemd/use-rootlibdir.patch | 94

++++++++++++++++++++

meta-oe/classes/systemd.bbclass python populate_packages_prepend () { · line 155

Quoted 11 lines

meta-oe/recipes-core/systemd/systemd_git.bb | 3 +-

3 files changed, 100 insertions(+), 2 deletions(-) create mode 100644

meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch

(quoted diff) +0 -0

b/meta-oe/classes/systemd.bbclass index a2c8ddf..0d88c64 100644

meta-oe/classes/systemd.bbclass +0 -0
@@ -154,7 +154,10 @@ python populate_packages_prepend () {
 
 	# check service-files and call systemd_add_files_and_parse for each

entry

meta-oe/classes/systemd.bbclass python populate_packages_prepend () { · line 157

Quoted 2 lines
meta-oe/classes/systemd.bbclass +0 -1
 	def systemd_check_services():
-		searchpaths = '/etc/systemd/system/ /lib/systemd/system/

/usr/lib/systemd/system/'

meta-oe/classes/systemd.bbclass python populate_packages_prepend () { · line 159

Quoted 3 lines
meta-oe/classes/systemd.bbclass +3 -0
+		base_libdir = d.getVar('base_libdir', 1)
+		searchpaths = '/etc/systemd/system/' + ' '
+		searchpaths += d.getVar('base_libdir', 1) +

'/systemd/system/' + ' '

meta-oe/classes/systemd.bbclass python populate_packages_prepend () { · line 160

Quoted 1 line
meta-oe/classes/systemd.bbclass +1 -0
+		searchpaths += d.getVar('libdir', 1) + '/systemd/system/' + '

'

Quoted 53 lines
meta-oe/classes/systemd.bbclass +0 -0
 		systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
 		has_exactly_one_service = len(systemd_packages.split()) == 1
 		if has_exactly_one_service:
meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch new file +43 -0
new file mode 100644
index 0000000..26973c4
@@ -0,0 +1,94 @@
+From 5210f67d0c637f4fbd8bb0a94e9b11da25a9c76c Mon Sep 17 00:00:00
+2001
+From: Ting Liu <[email protected]>
+Date: Fri, 14 Sep 2012 16:56:30 +0800
+Subject: [PATCH] use rootlibdir
+
+Back port from meta-oe 980b338fb5100ff4c779335a86f3d9450ea8c54a.
+Below is the original message in the patch:
+
+Upstream-Status: Undecided
+
+This patch removes some of hardcoded references to /lib and /usr/lib
+since on some architectures it should be
+/lib64 and /usr/lib64 atleast in OE
+
+I am not sure about the intention of hardcoded values thats why
+status is undecided
+
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Ting Liu <[email protected]>
+---
+ Makefile.am |   20 ++++++++++----------
+ 1 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am index 219d8de..b96ac74 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -50,19 +50,19 @@ bashcompletiondir=$(sysconfdir)/bash_completion.d
+
+ # Our own, non-special dirs
+ pkgsysconfdir=$(sysconfdir)/systemd
+-userunitdir=$(prefix)/lib/systemd/user
+-tmpfilesdir=$(prefix)/lib/tmpfiles.d
+-sysctldir=$(prefix)/lib/sysctl.d
++userunitdir=$(prefix)/$(rootlibdir)/gcsystemd/user
++tmpfilesdir=$(prefix)/$(rootlibdir)/gctmpfiles.d
++sysctldir=$(prefix)/$(rootlibdir)/gcsysctl.d
+ usergeneratordir=$(pkglibexecdir)/user-generators
+ pkgincludedir=$(includedir)/systemd
+
+ # And these are the special ones for /  rootprefix=@rootprefix@
+rootbindir=$(rootprefix)/bin
+-rootlibexecdir=$(rootprefix)/lib/systemd

meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch line 53

Quoted 10 lines
meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch new file +10 -0
++rootlibexecdir=$(rootprefix)/$(rootlibdir)/gcsystemd
+ systemgeneratordir=$(rootlibexecdir)/system-generators
+ systemshutdowndir=$(rootlibexecdir)/system-shutdown
+-systemunitdir=$(rootprefix)/lib/systemd/system
++systemunitdir=$(rootprefix)/$(rootlibdir)/gcsystemd/system
+
+ CLEANFILES =
+ EXTRA_DIST =
+@@ -93,7 +93,7 @@ AM_CPPFLAGS = \
+ 	-DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-

bridge\" \

meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch line 58

Quoted 5 lines
meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch new file +5 -0
+ 	-DROOTPREFIX=\"$(rootprefix)\" \
+ 	-DRUNTIME_DIR=\"/run\" \
+-	-DRANDOM_SEED=\"$(localstatedir)/lib/random-seed\" \
++	-DRANDOM_SEED=\"$(localstatedir)/$(rootlibdir)/gcrandom-seed\" \
+ 	-DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\"

\

Quoted 62 lines
meta-oe/recipes-core/systemd/systemd/use-rootlibdir.patch new file +36 -0
+ 	-DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
+ 	-DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \ @@ -1408,7 +1408,7
+@@ nodist_systemunit_DATA += \
+
+ binfmt-install-data-hook:
+ 	$(MKDIR_P) -m 0755 \
+-		$(DESTDIR)$(prefix)/lib/binfmt.d \
++		$(DESTDIR)$(prefix)/$(rootlibdir)/gcbinfmt.d \
+ 		$(DESTDIR)$(sysconfdir)/binfmt.d \
+ 		$(DESTDIR)$(systemunitdir)/sysinit.target.wants
+ 	( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \ @@
+-1940,7 +1940,7 @@ polkitpolicy_in_files += \
+ logind-install-data-hook:
+ 	$(MKDIR_P) -m 0755 \
+ 		$(DESTDIR)$(systemunitdir)/multi-user.target.wants \
+-                $(DESTDIR)$(localstatedir)/lib/systemd
++                $(DESTDIR)$(localstatedir)/$(rootlibdir)/gcsystemd
+ 	( cd $(DESTDIR)$(systemunitdir) && \
+ 		rm -f dbus-org.freedesktop.login1.service && \
+ 		$(LN_S) systemd-logind.service
+dbus-org.freedesktop.login1.service)
+@@ -2196,9 +2196,9 @@ systemd-install-data-hook:
+ 	$(MKDIR_P) -m 0755 \
+ 		$(DESTDIR)$(tmpfilesdir) \
+ 		$(DESTDIR)$(sysconfdir)/tmpfiles.d \
+-		$(DESTDIR)$(prefix)/lib/modules-load.d \
++		$(DESTDIR)$(prefix)/$(rootlibdir)/gcmodules-load.d \
+ 		$(DESTDIR)$(sysconfdir)/modules-load.d \
+-		$(DESTDIR)$(prefix)/lib/sysctl.d \
++		$(DESTDIR)$(prefix)/$(rootlibdir)/gcsysctl.d \
+ 		$(DESTDIR)$(sysconfdir)/sysctl.d \
+ 		$(DESTDIR)$(systemshutdowndir) \
+ 		$(DESTDIR)$(systemgeneratordir) \
+--
+1.7.5
+
meta-oe/recipes-core/systemd/systemd_git.bb +0 -0
index b9c8a19..21a6326 100644
@@ -14,13 +14,14 @@ inherit gitpkgv

PKGV = "v${GITPKGVTAG}"

PV = "git"

meta-oe/recipes-core/systemd/systemd_git.bb +1 -1
-PR = "r28"
+PR = "r29"

inherit useradd pkgconfig autotools vala perlnative

SRCREV = "3eff4208ffecedd778fec260f0d4b18e94dab443"

SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \

+           file://use-rootlibdir.patch \
           ${UCLIBCPATCHES} \
           file://var-run.conf \
          "

--
1.7.5