systemd: sort out the conflict between var factory and tmpfiles (branch systemdify-var)
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | package/skeleton-systemd: move /var factory out of /etcpackage/ | +2 | 0 replies | |
| 2/4 | package/skeleton-systemd: systemd-ify mounting /var tmpfs with ro rootfspackage/ package/ | +20 | 0 replies | |
| 3/4 | package/skeleton-systemd: host the tmpfiles preparation scriptpackage/ package/ package/ | +6 | 0 replies | |
| 4/4 | system: add options for var factory and tmpfiles pre-seedpackage/ system/ | +42 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Buildroot] [PATCH 0/4] systemd: sort out the conflict between var factory and tmpfiles (branch systemdify-var)
Hello All!
This small four-patch series touches on the delicate intricacies of the systemd package and how we integrate it in Buildroot, especially with regard to read-only filesystems.
The underlying issue is that systemd wants a writable /var filesystem (it will store a bunch of things at runtime in there). A lot of packages also expect a writable /var. After all, var stands for variadic, so it is not supposed to be set in stone and read-only.
The solution we implemented in Buildroot is to generate a factory for /var, and register that as tmpfiles, at build time, and mount a tmpfs on the then-empty /var at runtime, so that systemd-tmpfiles populates /var on boot. Having a tmpfs means /var is repopulated from a clean state at each boot, and people who want a persistent /var have to provide their own mechanism to mount their actual filesystem instead.
However, for some people, this does not seem to work as expected, so we introduced a call to systemd-tmpfiles at build time, to pre-populate the rootfs from all the tmpfiles, of which our var factory, at build time.
These two mechanism clash with each others, and are mostly incompatible, and causes files to be duplicated.
To solve the issue, this series introduces new options, so the user can elect to use either, none, or both mechanisms, as they see fit.
The first steps are borrowed from Yann@work, where we make it easier to change the location where /var is nounted from, by making it a systemd mount unit, rather than use the legacy fstab, and move the factory to /usr/share as it is a system factory (/etc is for the administartor to provide overrides). Note that those two are not strictly required for the following, but since that makes it easier to change the /var filesystem in a systemd-compliant manner, they are a nice addition to the series.
Then we move together the two mechanisms under the auspices of a common package, to make it easier to later make them conditional.
Finally, we introduce those two new options, that drive each mechanism.
Eventally, we want to highlight that, by default, the behaviour has not changed, since the two new options default to y, so as to explicitly keep the behaviour from nefore this patchset.
Regards,
Yann E. MORIN.
----------------------------------------------------------------
Yann E. MORIN (4):
package/skeleton-systemd: move /var factory out of /etc package/skeleton-systemd: systemd-ify mounting /var tmpfs with ro rootfs package/skeleton-systemd: host the tmpfiles preparation script
system: add options for var factory and tmpfiles pre-seed
.../fakeroot_tmpfiles.sh | 0
.../skeleton-init-systemd/skeleton-init-systemd.mk | 18 +++++++---
package/skeleton-init-systemd/var.mount | 18 ++++++++++
package/systemd/systemd.mk | 6 ----
system/Config.in | 38 +++++++++++++++++++++-
5 files changed, 69 insertions(+), 11 deletions(-)
rename package/{systemd => skeleton-init-systemd}/fakeroot_tmpfiles.sh (100%)
create mode 100644 package/skeleton-init-systemd/var.mountSignature · 10 lines
.-----------------.--------------------.------------------.--------------------. | 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 [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot