summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-02-14 04:02:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-15 12:18:30 +0000
commit3b909b369ad8047b99acdf3a32918849f24f6829 (patch)
tree50bfe5809fff0315741d467cc6b7ddff0872f820 /meta/classes
parentc4d16fce2e2ca8053f82c2014256814acebe8aca (diff)
downloadpoky-3b909b369ad8047b99acdf3a32918849f24f6829.tar.gz
systemd.bbclass: Dont use libdir and base_libdir for units
systemd always uses /lib and /usr/lib to store unit files so using libdir and base_libdir is incorrect. It will work where libdir is usr/lib and base_libdir is /lib but wont work when say its /lib64 Add a check to make sure that SYSTEMD_PACKAGES are part of PACKAGES too, otherwise error out (From OE-Core rev: 22e16f44b58ae6bbf719b9074d39aac065a402f1) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/systemd.bbclass13
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 8b558137ab..00865edc7c 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -49,6 +49,12 @@ python systemd_populate_packages() {
49 val = (d.getVar(var, True) or "").strip() 49 val = (d.getVar(var, True) or "").strip()
50 return val 50 return val
51 51
52 # Check if systemd-packages already included in PACKAGES
53 def systemd_check_package(pkg_systemd):
54 packages = d.getVar('PACKAGES', True)
55 if not pkg_systemd in packages.split():
56 bb.error('%s does not appear in package list, please add it', " " + pkg_systemd)
57
52 58
53 # Add a runtime dependency on systemd to pkg 59 # Add a runtime dependency on systemd to pkg
54 def systemd_add_rdepends(pkg): 60 def systemd_add_rdepends(pkg):
@@ -118,11 +124,9 @@ python systemd_populate_packages() {
118 124
119 # Check service-files and call systemd_add_files_and_parse for each entry 125 # Check service-files and call systemd_add_files_and_parse for each entry
120 def systemd_check_services(): 126 def systemd_check_services():
121 base_libdir = d.getVar('base_libdir', True)
122 searchpaths = [oe.path.join(d.getVar("sysconfdir", True), "systemd", "system"),] 127 searchpaths = [oe.path.join(d.getVar("sysconfdir", True), "systemd", "system"),]
123 searchpaths.append(oe.path.join(d.getVar("base_libdir", True), "systemd", "system")) 128 searchpaths.append(oe.path.join(d.getVar("nonarch_base_libdir", True), "systemd", "system"))
124 searchpaths.append(oe.path.join(d.getVar("libdir", True), "systemd", "system")) 129 searchpaths.append(oe.path.join(d.getVar("exec_prefix", True), d.getVar("nonarch_base_libdir", True), "systemd", "system"))
125 searchpaths.append(oe.path.join(d.getVar("libdir", True), "systemd", "user"))
126 systemd_packages = d.getVar('SYSTEMD_PACKAGES', True) 130 systemd_packages = d.getVar('SYSTEMD_PACKAGES', True)
127 has_exactly_one_service = len(systemd_packages.split()) == 1 131 has_exactly_one_service = len(systemd_packages.split()) == 1
128 if has_exactly_one_service: 132 if has_exactly_one_service:
@@ -149,6 +153,7 @@ python systemd_populate_packages() {
149 # Run all modifications once when creating package 153 # Run all modifications once when creating package
150 if os.path.exists(d.getVar("D", True)): 154 if os.path.exists(d.getVar("D", True)):
151 for pkg in d.getVar('SYSTEMD_PACKAGES', True).split(): 155 for pkg in d.getVar('SYSTEMD_PACKAGES', True).split():
156 systemd_check_package(pkg)
152 if d.getVar('SYSTEMD_SERVICE_' + pkg, True): 157 if d.getVar('SYSTEMD_SERVICE_' + pkg, True):
153 systemd_generate_package_scripts(pkg) 158 systemd_generate_package_scripts(pkg)
154 systemd_add_rdepends(pkg) 159 systemd_add_rdepends(pkg)