Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] system/skeleton: make /var/run a symlink to /run
Date: Wed, 15 Jul 2020 17:38:31 +0200	[thread overview]
Message-ID: <20200715173831.702c9448@windsurf.home> (raw)
In-Reply-To: <CADYdroN0JsN4BS6QWX-wruwSrnBQSZmWBy1FTzPYej6tygdxNQ@mail.gmail.com>

On Wed, 15 Jul 2020 15:53:12 +0200
Norbert Lange <nolange79@gmail.com> wrote:

> > But... /run is already a tmpfs in sysv-based systems, so what prevents
> > today from using /run/lttng even for sysv based systems ?  
> 
> Ok, I missed that bit, thought it would have unrelated /run and
> /var/run directories.
> So this patch is just a cleanup then, and buildroot already *always*
> uses a tmpfs /run (with compatibilty symlink /var/run),
> and I can use /run with lttng and dbus whether this cleanup is merged or not?
> 
> I'd redo the patch with those removed, if you agree:
> 
> package/skeleton-init-openrc/skeleton/var/run
> package/skeleton-init-sysv/skeleton/var/run
> 
> Or do nothing if you dont ;)
> My new argument would be that this would prevent false assumptions (like mine).

OK, the more I look into this, the more I'm confused. To me, it seems
like in both systemd *and* non-systemd cases, /var/run is already a
symlink to /run, but just implemented in a different way.

For the systemd case, we have:

        ln -s ../run $(TARGET_DIR)/var/run

in package/skeleton-init-systemd/skeleton-init-systemd.dmk.

For the sysv/openrc case, we have the skeleton itself that contains:

$ ls -l package/skeleton-init-sysv/skeleton/var/run 
lrwxrwxrwx 1 thomas thomas 6 26 mars  17:10 package/skeleton-init-sysv/skeleton/var/run -> ../run
$ ls -l package/skeleton-init-openrc/skeleton/var/run 
lrwxrwxrwx 1 thomas thomas 6 18 mai   17:32 package/skeleton-init-openrc/skeleton/var/run -> ../run

So, it all cases, /var/run is already a symlink to /run. Am I missing
something here ?

So, if anything needs to be done, it's just cleaning up that and doing
it in the same way for all init systems, perhaps in a common place. But
we need to be careful, skeleton-init-systemd.mk has some
special/complex logic to handle /var and generate a
/etc/tmpfiles.d/var-factory.conf to generate the contents of /var at
boot time when the rootfs is read only and therefore the entire /var is
in tmpfs.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2020-07-15 15:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29 10:47 [Buildroot] [PATCH] system/skeleton: make /var/run a symlink to /run Norbert Lange
2020-06-29 10:52 ` Norbert Lange
2020-07-14 13:14 ` Thomas Petazzoni
2020-07-14 13:35   ` Norbert Lange
2020-07-14 13:52     ` Thomas Petazzoni
2020-07-14 14:22       ` Norbert Lange
2020-07-15 13:43         ` Thomas Petazzoni
2020-07-15 13:53           ` Norbert Lange
2020-07-15 15:38             ` Thomas Petazzoni [this message]
2020-07-16  9:42               ` Norbert Lange

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=20200715173831.702c9448@windsurf.home \
    --to=thomas.petazzoni@bootlin.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