summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-rc.d.bbclass
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-09-03 15:09:01 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-03 11:09:04 +0100
commitee05cc83596744b94ad7c107d5bdc2d9136744fe (patch)
treebceacb7e19fc2c5522ca77ac7234ac3422e7288d /meta/classes/update-rc.d.bbclass
parent16de99b14ad5a383f90df749260dd445b132906d (diff)
downloadast2050-yocto-poky-ee05cc83596744b94ad7c107d5bdc2d9136744fe.zip
ast2050-yocto-poky-ee05cc83596744b94ad7c107d5bdc2d9136744fe.tar.gz
update-rc.d: fix logic in populate_packages_updatercd
The 'and' logic for the check is wrong. To make things clear, please see the example below. Say that we have a recipe A, which has a sysv-init style init script named initA and no corresponding service file. The recipe inherits update-rc.d, but it doesn't inherit systemd.bbclass. The DISTRO_FEATURES has 'systemd' inside it, but it doesn't have 'sysvinit'. Now if we build an image, with the 'and' logic in the check, the symlinks for initA would not be installed into /etc/rc?.d directory. This is incorrect. Because there's no corresponding service. The symlinks in /etc/rc?.d/ should be created so that the service would be correctly started at boot time. The logic should really be 'or' in the check. This is actually what the code was when it was originally written. Several different situations are listed below to prove the correctness of the 'or' logic. If 'sysvinit' is in DISTRO_FEATURES, the initA script would always be installed with corresponding preisnt/postinst generated and added. If 'sysvinit' is not in DISTRO_FEATURES, we have three situations. 1) A has initA and A.service. In such situation, systemd.bbclass would set INHIBIT_UPDATERCD_BBCLASS, so no preinst/postinst about update-rc.d would be added and the symlinks for initA would not be created. 2) A has initA, and the functionality of initA is not implemented internally in systemd. In such situation, symlinks for initA would be installed. 3) A has initA, and the functionality of initA is implemented internally in systemd or in some other recipe. Examples for such situation are alsa-state and keymaps in OE. In such situation, we need to set INHIBIT_UPDATERCD_BBCLASS in the recipe so that there would be no preinst/postinst scripts about update-rc.d added. (From OE-Core rev: 6272c81509bbdb5d602056ceaa6f2c02bbf47a41) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/update-rc.d.bbclass')
-rw-r--r--meta/classes/update-rc.d.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 19b081d..3c5414b 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -121,7 +121,7 @@ python populate_packages_updatercd () {
# Check that this class isn't being inhibited (generally, by
# systemd.bbclass) before doing any work.
- if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
+ if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
if pkgs == None:
OpenPOWER on IntegriCloud