Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/skeleton-init-systemd: create a symlink /var/run to ../run
Date: Fri, 23 Feb 2018 18:25:38 +0000	[thread overview]
Message-ID: <1519410337.25567.173.camel@impinj.com> (raw)
In-Reply-To: <20180222221014.19584-1-romain.naour@gmail.com>

On Thu, 2018-02-22 at 23:10 +0100, Romain Naour wrote:
> As reported by J?r?my Rosen [1] and Jan Kundr?t (RO case)[2], systemd
> looks for the dbus socket in /run/dbus instead of /var/run/dbus which
> is not where dbus puts the socket. This is a change introduced with
> the last version bump v237 [3].
> 
> The file /usr/lib/tmpfiles.d/var.con will create automatically that
> symlink at bootup /var/run doesn't exist yet. But dbus creates, at
> install time, the directory /var/run/dbus without taking care of
> /var/run. So we end up with two different directories /run and
> /var/run. This bug affects more or less all systemd-provided
> utilities, including logind and systemd itself.
> 
> This patch create the correct symlink run -> ../run when systemd
> is used as init system.

This doesn't work in the RO root case.  I described this in another
mail to the list, but in the RO root case target/var is a symlink to
target/usr/share/factory/var.  Thus this link is actually created as:

target/usr/share/factory/var/run -> ../run

It points to target/usr/share/factory/run, which is wrong.  In order to
get it to work in the RO case, instead create this link.

define SKELETON_INIT_SYSTEMD_VAR_RUN_LINK
       ln -sf ../../../../run $(TARGET_DIR)/usr/share/factory/var/run
endef
 
SKELETON_INIT_SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
       SKELETON_INIT_SYSTEMD_VAR_RUN_LINK

Then you get a target that looks like this:
                                                                 
lrwxrwxrwx    1 root     root  29 Feb 23 02:35 /var/run -> ../usr/share/factory//var/run
lrwxrwxrwx    1 root     root  15 Feb 23 00:51 /usr/share/factory/var/run -> ../../../../run

On the target, /var/run ends up pointing to /run and also on the host
$TARGET_DIR/var/run points to $TARGET_DIR/run.

  reply	other threads:[~2018-02-23 18:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 22:10 [Buildroot] [PATCH] package/skeleton-init-systemd: create a symlink /var/run to ../run Romain Naour
2018-02-23 18:25 ` Trent Piepho [this message]
2018-02-24 18:15   ` Arnout Vandecappelle
2018-02-27 19:28     ` Trent Piepho
2018-02-25 19:16   ` Romain Naour
2018-02-27 18:37     ` Trent Piepho
2018-02-27 21:24       ` Pierre

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=1519410337.25567.173.camel@impinj.com \
    --to=tpiepho@impinj.com \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox