All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Qi <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 04/26] update-rc.d: fix logic in populate_packages_updatercd
Date: Tue, 2 Sep 2014 18:53:50 +0800	[thread overview]
Message-ID: <329bb7bd11a0b4a90b5d0fc947b0711be3895189.1409655125.git.Qi.Chen@windriver.com> (raw)
In-Reply-To: <cover.1409655125.git.Qi.Chen@windriver.com>

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.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/update-rc.d.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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:
-- 
1.9.1



  parent reply	other threads:[~2014-09-02 10:54 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 10:53 [PATCH 00/26] systemd upgrade to 216 and other misc fixes Chen Qi
2014-09-02 10:53 ` [PATCH 01/26] systemd: upgrade to 216 Chen Qi
2014-09-04 19:30   ` Peter A. Bigot
2014-09-04 19:37     ` Burton, Ross
2014-09-05 10:21     ` Enrico Scholz
2014-09-08 17:02       ` Burton, Ross
2014-09-02 10:53 ` [PATCH 02/26] systemd: add PACKAGECONFIG for curl Chen Qi
2014-09-02 14:59   ` Burton, Ross
2014-09-03  2:38     ` ChenQi
2014-09-02 10:53 ` [PATCH 03/26] systemd: make runlevel work in non-runlevel targets Chen Qi
2014-09-02 10:53 ` Chen Qi [this message]
2014-09-02 10:53 ` [PATCH 05/26] alsa-state: fix pkg_postinst and set INHIBIT_UPDATERCD_BBCLASS Chen Qi
2014-09-02 10:53 ` [PATCH 06/26] keymaps: fix for systemd Chen Qi
2014-09-02 10:53 ` [PATCH 07/26] systemd: add kbd-keymaps to RRECOMMENDS of systemd-vconsole-setup Chen Qi
2014-09-02 10:53 ` [PATCH 08/26] v86d: set INHIBIT_UPDATERCD_BBCLASS if 'sysvinit' not in DISTRO_FEATURES Chen Qi
2014-09-02 10:53 ` [PATCH 09/26] systemd: add support for executing scripts under /etc/rcS.d Chen Qi
2014-09-02 15:00   ` Burton, Ross
2014-09-03  2:38     ` ChenQi
2014-09-02 10:53 ` [PATCH 10/26] dhcp: add dhcpd.service Chen Qi
2014-09-02 15:03   ` Burton, Ross
2014-09-03  2:39     ` ChenQi
2014-09-02 10:53 ` [PATCH 11/26] dhcp: add dhcrelay.service Chen Qi
2014-09-02 10:53 ` [PATCH 12/26] acpid: upgrade to 2.0.22 and add systemd support Chen Qi
2014-09-02 15:24   ` Burton, Ross
2014-09-03  2:39     ` ChenQi
2014-09-02 10:53 ` [PATCH 13/26] cups: make cups daemon start correctly Chen Qi
2014-09-02 15:36   ` Burton, Ross
2014-09-03  2:41     ` ChenQi
2014-09-02 10:54 ` [PATCH 14/26] cups: add systemd support Chen Qi
2014-09-02 15:38   ` Burton, Ross
2014-09-03  3:01     ` ChenQi
2014-09-02 10:54 ` [PATCH 15/26] rpcbind: avoid entering failed status after stopping daemon Chen Qi
2014-09-02 10:54 ` [PATCH 16/26] at: remove dependency on initscripts Chen Qi
2014-09-02 10:54 ` [PATCH 17/26] at: inherit update-rc.d to handle sysv init script Chen Qi
2014-09-02 10:54 ` [PATCH 18/26] keymaps: remove dependency on initscripts Chen Qi
2014-09-02 10:54 ` [PATCH 19/26] packagegroup-core-boot: conditionally rdepend on VIRTUAL-RUNTIME_initscripts Chen Qi
2014-09-02 10:54 ` [PATCH 20/26] initscripts: mask several init scripts Chen Qi
2014-09-02 10:54 ` [PATCH 21/26] keymaps: mask keymap when necessary Chen Qi
2014-09-02 10:54 ` [PATCH 22/26] v86d: mask fbsetup " Chen Qi
2014-09-02 10:54 ` [PATCH 23/26] psplash: mask psplash in case of systemd Chen Qi
2014-09-02 10:54 ` [PATCH 24/26] modutils-initscripts: mask modutils " Chen Qi
2014-09-02 10:54 ` [PATCH 25/26] run-postinsts.service: remove redundant line Chen Qi
2014-09-02 17:17   ` Burton, Ross
2014-09-03  2:50     ` ChenQi
2014-09-02 10:54 ` [PATCH 26/26] systemd: enable forwarding messages to syslog daemon Chen Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=329bb7bd11a0b4a90b5d0fc947b0711be3895189.1409655125.git.Qi.Chen@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.