All of lore.kernel.org
 help / color / mirror / Atom feed
From: nick83ola <nick83ola@gmail.com>
To: poky@yoctoproject.org
Subject: [PATCH] systemd: resolved linked even if the option is disabled
Date: Wed, 30 May 2018 14:24:07 +0100	[thread overview]
Message-ID: <CABPh3UMsooqLDJ+Aq1DiObxoi12a2Oj68nO51ALjgBet2SwkAw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2937 bytes --]

systemd: resolved linked even if the option is disabled

in the do_install function in systemd recipe the condition to check
if the resolved option is selected is reversed (wrong !).
This is for example true if we compile systemd with musl instead of
glibc (every poky-image-minimal recipe).

Also no link should be created if the option is not selected
nor an ALTERNATIVE set.

Signed-off-by: Nicola Lunghi <nick83ola@gmail.com>
---
 meta/recipes-core/systemd/systemd_237.bb | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_237.bb
b/meta/recipes-core/systemd/systemd_237.bb
index 2e6558ded1..2eea6af508 100644
--- a/meta/recipes-core/systemd/systemd_237.bb
+++ b/meta/recipes-core/systemd/systemd_237.bb
@@ -256,14 +256,11 @@ do_install() {
     if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
         ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e
"\$ad /run/systemd/netif/links 0755 root root -"
${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)}
     fi
-    if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true',
'false', d)}; then
+    if ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false',
d)}; then
         echo 'L! ${sysconfdir}/resolv.conf - - - -
../run/systemd/resolve/resolv.conf'
>>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
         echo 'd /run/systemd/resolve 0755 root root -'
>>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
         echo 'f /run/systemd/resolve/resolv.conf 0644 root root'
>>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
         ln -s ../run/systemd/resolve/resolv.conf
${D}${sysconfdir}/resolv-conf.systemd
-    else
-        sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - -
../run/systemd/resolve/resolv.conf%g"
${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
-        ln -s ../run/systemd/resolve/resolv.conf
${D}${sysconfdir}/resolv-conf.systemd
     fi
     install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON
${D}${systemd_unitdir}/systemd-sysv-install

@@ -537,7 +534,7 @@ python __anonymous() {
 # TODO:
 # u-a for runlevel and telinit

-ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel
resolv-conf"
+ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"

 ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
 ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
@@ -563,6 +560,7 @@ ALTERNATIVE_TARGET[runlevel] =
"${base_bindir}/systemctl"
 ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
 ALTERNATIVE_PRIORITY[runlevel] ?= "300"

+ALTERNATIVE_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved',
'resolv-conf', '', d)}"
 ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
 ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
 ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
-- 
2.17.0

[-- Attachment #2: Type: text/html, Size: 3724 bytes --]

             reply	other threads:[~2018-05-30 13:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 13:24 nick83ola [this message]
2018-05-30 14:38 ` [poky][PATCH] systemd: resolved linked even if the option is disabled nick83ola
2018-06-06  8:48 ` [PATCH] " nick83ola
2018-06-11 11:40   ` nick83ola
2018-06-12  1:47     ` ChenQi

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=CABPh3UMsooqLDJ+Aq1DiObxoi12a2Oj68nO51ALjgBet2SwkAw@mail.gmail.com \
    --to=nick83ola@gmail.com \
    --cc=poky@yoctoproject.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.