diff options
author | Muhammad Shakeel <muhammad_shakeel@mentor.com> | 2013-07-29 13:09:51 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-07-31 06:59:56 +0100 |
commit | 3b9b8d571da6bb3652427e8ccc7948cbcec0e517 (patch) | |
tree | f1225598886dfcef69f8be08365f99fd6547da2f /meta/classes/systemd.bbclass | |
parent | 205ec4319b7015f8e7ce355506338d951f7bdb13 (diff) | |
download | poky-3b9b8d571da6bb3652427e8ccc7948cbcec0e517.tar.gz |
systemd: Remove init.d dir if systemd unit file is present and sysvinit not a distro feature
If systemd is supported DISTRO_FEATURE and sysvinit is not and also if
systemd_unitdir contains anything then no need to keep init.d scripts
for sysvinit compatibility.
(From OE-Core rev: 823c90ad344ca2205f3055e2dcae08c6616f29b7)
Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/systemd.bbclass')
-rw-r--r-- | meta/classes/systemd.bbclass | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass index 9763faae63..76f0e7da1f 100644 --- a/meta/classes/systemd.bbclass +++ b/meta/classes/systemd.bbclass | |||
@@ -170,3 +170,18 @@ python rm_systemd_unitdir (){ | |||
170 | shutil.rmtree(systemd_unitdir) | 170 | shutil.rmtree(systemd_unitdir) |
171 | } | 171 | } |
172 | do_install[postfuncs] += "rm_systemd_unitdir " | 172 | do_install[postfuncs] += "rm_systemd_unitdir " |
173 | |||
174 | python rm_sysvinit_initddir (){ | ||
175 | import shutil | ||
176 | sysv_initddir = oe.path.join(d.getVar("D", True), (d.getVar('INIT_D_DIR', True) or "/etc/init.d")) | ||
177 | |||
178 | if ("systemd" in d.getVar("DISTRO_FEATURES", True).split() and | ||
179 | "sysvinit" not in d.getVar("DISTRO_FEATURES", True).split() and | ||
180 | os.path.exists(sysv_initddir)): | ||
181 | systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True), "system") | ||
182 | |||
183 | # If systemd_unitdir contains anything, delete sysv_initddir | ||
184 | if (os.path.exists(systemd_unitdir) and os.listdir(systemd_unitdir)): | ||
185 | shutil.rmtree(sysv_initddir) | ||
186 | } | ||
187 | do_install[postfuncs] += "rm_sysvinit_initddir " | ||