From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Norbert Lange <nolange79@gmail.com>
Cc: "Romain Naour" <romain.naour@smile.fr>,
yann.morin@orange.com, "Jérémy Rosen" <jeremy.rosen@smile.fr>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/6 v3] package/skeleton-systemd: move /var factory tmpfiles out of /etc
Date: Sun, 6 Nov 2022 16:58:04 +0100 [thread overview]
Message-ID: <20221106155804.GA3918838@scaer> (raw)
In-Reply-To: <CADYdroOC6mUR-Hiv8Jqri4-_wO7Grwvgm0C5BjifrtxG6LEb9w@mail.gmail.com>
Norbert, All,
On 2022-11-06 16:40 +0100, Norbert Lange spake thusly:
> Am Di., 18. Okt. 2022 um 21:43 Uhr schrieb <yann.morin@orange.com>:
[--SNIP--]
> > diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > index 795a171809..7b66732ef4 100644
> > --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > @@ -29,7 +29,6 @@ else
> > # a real (but empty) directory, and the "factory files" will be copied
> > # back there by the tmpfiles.d mechanism.
> > define SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW
> > - mkdir -p $(TARGET_DIR)/etc/systemd/tmpfiles.d
> > echo "/dev/root / auto ro 0 1" >$(TARGET_DIR)/etc/fstab
> > echo "tmpfs /var tmpfs mode=1777 0 0" >>$(TARGET_DIR)/etc/fstab
> > endef
> > @@ -38,6 +37,7 @@ define SKELETON_INIT_SYSTEMD_PRE_ROOTFS_VAR
> > rm -rf $(TARGET_DIR)/usr/share/factory/var
> > mv $(TARGET_DIR)/var $(TARGET_DIR)/usr/share/factory/var
> > mkdir -p $(TARGET_DIR)/var
> > + mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
> > for i in $(TARGET_DIR)/usr/share/factory/var/* \
> > $(TARGET_DIR)/usr/share/factory/var/lib/* \
> > $(TARGET_DIR)/usr/share/factory/var/lib/systemd/*; do \
> > @@ -51,7 +51,7 @@ define SKELETON_INIT_SYSTEMD_PRE_ROOTFS_VAR
> > printf "C! %s - - - -\n" "$${j}" \
> > || exit 1; \
> > fi; \
>
> From tmpfiles.d docs: "C ... Recursively copy a file or directory, if
> the destination files or directories do not
> exist yet or the destination directory is empty. Note that this
> command will not descend into subdirectories
> if the destination directory already exists and is not empty.
> Instead, the entire copy operation is skipped."
>
> So all the drama could be just replaced with "C! /var - - - -\n" imho.
>
> (non standard permissions/owner are probably gone either way)
I do remember that I had to explicitly register individual entries
rather than the directory alone, as that did not work. That was 5+
years ago (commit 26085bbbd500), and I did not write it down in the
commit log...
However, it looks like we hit this issue, as hinted in commit
7e811708f31c (package/skeleton-init-systemd: work around for /var/lib
not populating), which states:
It turns out /var/lib will exist, because some part of systemd creates
/var/lib/systemd/catalog on boot before tmpfiles runs.
So, we do have a chicken-n-eggs issue, that registering /var as a whole
does not work.
I'll try to investigate further, and see if that's still the case.
> > - done >$(TARGET_DIR)/etc/tmpfiles.d/var-factory.conf
> > + done >$(TARGET_DIR)/usr/lib/tmpfiles.d/buildroot-factory.conf
>
> How about naming this something like 00-buildroot-var.conf, so hopefully any
> *.conf that might expect something in /var existing is executed later.
I am totally OK for 00-buildroot-var.conf.
[--SNIP--]
> Regardless, the changes are an improvement, buildroot is the "distro"
> and its special sauce
> should reside inside /usr as much as possible.
Yes, that was my reasoning as well.
> Id highly recommend atleast changing the name to
> 00-buildroot-var.conf, other than that:
Agreed.
> Acked-by: Norbert Lange <nolange79@gmail.com>
Thanks!
Regards,
Yann E. MORIN.
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-11-06 15:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1666122184.git.yann.morin@orange.com>
2022-10-18 19:43 ` [Buildroot] [PATCH 1/6 v3] package/skeleton-systemd: move /var factory tmpfiles out of /etc yann.morin
2022-11-06 15:40 ` Norbert Lange
2022-11-06 15:58 ` Yann E. MORIN [this message]
2022-11-07 13:32 ` Norbert Lange
2022-12-21 21:16 ` Yann E. MORIN
2022-10-18 19:43 ` [Buildroot] [PATCH 2/6 v3] package/skeleton-systemd: systemd-ify mounting /var tmpfs with ro rootfs yann.morin
2022-11-06 15:56 ` Norbert Lange
2022-11-06 16:26 ` Yann E. MORIN
2022-11-06 16:41 ` Norbert Lange
2022-12-21 21:17 ` Yann E. MORIN
2022-10-18 19:43 ` [Buildroot] [PATCH 3/6 v3] package/skeleton-systemd: host the tmpfiles preparation script yann.morin
2022-11-06 16:04 ` Norbert Lange
2022-12-21 21:18 ` Yann E. MORIN
2022-10-18 19:43 ` [Buildroot] [PATCH 4/6 v3] system: add options for /var factory and tmpfiles pre-seed yann.morin
2022-12-22 10:08 ` Yann E. MORIN
2022-10-18 19:43 ` [Buildroot] [PATCH 5/6 v3] system: introduce a choice for /var management yann.morin
2022-10-18 19:43 ` [Buildroot] [PATCH 6/6 v3] system: add option to use an overlayfs on /var on a r/o root w/ systemd yann.morin
2022-10-23 21:47 ` Norbert Lange
2022-10-25 8:08 ` yann.morin
2022-10-25 12:12 ` Norbert Lange
2022-11-06 16:13 ` Norbert Lange
2022-10-18 19:43 [Buildroot] [PATCH 0/6 v3] systemd: sort out the conflict between var factory and tmpfiles yann.morin
2022-11-06 16:21 ` Norbert Lange
2022-11-06 16:49 ` Yann E. MORIN
2022-11-06 17:01 ` 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=20221106155804.GA3918838@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=jeremy.rosen@smile.fr \
--cc=nolange79@gmail.com \
--cc=romain.naour@smile.fr \
--cc=yann.morin@orange.com \
/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