All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][for-denzil][PATCH] systemd.bbclass: use system variables instead of hardcoded paths
@ 2012-09-13  7:33 b28495
  2012-09-13 13:02 ` Otavio Salvador
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: b28495 @ 2012-09-13  7:33 UTC (permalink / raw)
  To: openembedded-devel; +Cc: b29882

From: Ting Liu <b28495@freescale.com>

Fix below issue when check service-files for 64bit target:
| DEBUG: adding systemd calls to postinst/postrm for busybox-syslog-systemd
| ERROR: Function failed:
|
| For package busybox-syslog-systemd SYSTEMD_SERVICE-entry busybox-syslog.service does not exist
NOTE: package busybox-1.19.4-r6+fsl.0: task do_package: Failed

Signed-off-by: Ting Liu <b28495@freescale.com>
---
 meta-oe/classes/systemd.bbclass |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index a2c8ddf..9690c18 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -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/'
+		searchpaths = []
+		searchpaths.append(d.getVar('sysconfdir', True))
+		searchpaths.append(d.getVar('libdir', True))
+		searchpaths.append(d.getVar('base_libdir', True))
 		systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
 		has_exactly_one_service = len(systemd_packages.split()) == 1
 		if has_exactly_one_service:
@@ -168,9 +171,9 @@ python populate_packages_prepend () {
 		for pkg_systemd in systemd_packages.split():
 			for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
 				path_found = ''
-				for path in searchpaths.split():
-					if os.path.exists('${D}' + path + service):
-						path_found = path
+				for path in searchpaths:
+					if os.path.exists('${D}' + path + '/systemd/system/' + service):
+						path_found = path + '/systemd/system/'
 				if path_found != '':
 					systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
 				else:
-- 
1.7.5.4





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-14 11:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13  7:33 [meta-oe][for-denzil][PATCH] systemd.bbclass: use system variables instead of hardcoded paths b28495
2012-09-13 13:02 ` Otavio Salvador
2012-09-13 13:04 ` Otavio Salvador
2012-09-14 10:22   ` Liu Ting-B28495
2012-09-13 15:20 ` Koen Kooi
2012-09-13 18:01   ` McClintock Matthew-B29882

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.