summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/systemd.bbclass15
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}
172do_install[postfuncs] += "rm_systemd_unitdir " 172do_install[postfuncs] += "rm_systemd_unitdir "
173
174python 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}
187do_install[postfuncs] += "rm_sysvinit_initddir "