update-rcd.bbclass: handle both sysvinit and systemd features being present

Run the helper if the sysvinit feature is present, or if the systemd feature is
present but the systemd class hasn't been inherited.  We want to run in the
latter case as systemd has sysvinit compatibility, but we don't want to always
run so that pure systemd images don't have redundant sysvinit files.

(From OE-Core rev: a3856ab19f1d4ae312f559521785ad4384700729)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton 2013-02-28 16:28:28 +00:00 committed by Richard Purdie
parent e92dfa1157
commit 55ba8ea863
1 changed files with 6 additions and 3 deletions

View File

@ -75,9 +75,12 @@ python populate_packages_updatercd () {
postrm += d.getVar('updatercd_postrm', True)
d.setVar('pkg_postrm_%s' % pkg, postrm)
# If the systemd class has also been inherited, then don't do anything as
# the systemd units will override anything created by update-rc.d.
if not d.getVar("SYSTEMD_BBCLASS_ENABLED", True):
# Run if the sysvinit feature is present, or if the systemd feature is present
# but the systemd class hasn't been inherited. We want to run in the latter case
# as systemd has sysvinit compatibility, but we don't want to always so that
# pure systemd images don't have redundent sysvinit files.
if "sysvinit" in d.getVar("DISTRO_FEATURES").split() or \
("systemd" in d.getVar("DISTRO_FEATURES").split() and not d.getVar("SYSTEMD_BBCLASS_ENABLED", True)):
pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
if pkgs == None:
pkgs = d.getVar('UPDATERCPN', True)