systemd: limit bbclass hooks to class-target scope
Allow the phosphor systemd and dbus bbclasses to be inherited
by recipes using BBCLASSEXTEND (native, etc). No-op in non-target
recipe class context.
Tested: Built an image and verified dbus and systemd unit files.
Change-Id: Ib2f64233f89d05679c568527a074d9236729201f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/classes/obmc-phosphor-systemd.bbclass b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
index c6a2e69..3a3234f 100644
--- a/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
@@ -198,6 +198,11 @@
add_sd_user(d, '%s' % dest, pkg)
+ if d.getVar('CLASSOVERRIDE', True) != 'class-target':
+ return
+
+ d.appendVarFlag('do_install', 'postfuncs', ' systemd_do_postinst')
+
pn = d.getVar('PN', True)
if d.getVar('SYSTEMD_SERVICE_%s' % pn, True) is None:
d.setVar('SYSTEMD_SERVICE_%s' % pn, '%s.service' % pn)
@@ -326,6 +331,3 @@
${D}${systemd_system_unitdir}/$s
done
}
-
-
-do_install[postfuncs] += "systemd_do_postinst"