diff mbox series

[5/6,v3] system: introduce a choice for /var management

Message ID 4895_1666122201_634F01D9_4895_296_1_acafcb63e0879326a88681d7f3d27afeb31ccd51.1666122184.git.yann.morin@orange.com
State Changes Requested
Headers show
Series [1/6,v3] package/skeleton-systemd: move /var factory tmpfiles out of /etc | expand

Commit Message

Yann E. MORIN Oct. 18, 2022, 7:43 p.m. UTC
Currently, we have a single solution to handle the /var content on a
read-only root filesystem, and users can opt out of using it.

We're going to introduce another solution (based on an overlayfs), which
is incompatible with using the factory, so we'll have a choice of three
mutually exclusive options.

Introduce that choice now with just the existing /var factory, and a new
option to opt out of it.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
---
 system/Config.in | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/system/Config.in b/system/Config.in
index 806a747315..074fda509c 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -156,10 +156,16 @@  endchoice
 
 if BR2_INIT_SYSTEMD
 
-config BR2_INIT_SYSTEMD_VAR_FACTORY
-	bool "build a factory to populate a tmpfs on /var"
-	default y  # legacy
+choice
+	bool "/var management"
+	default BR2_INIT_SYSTEMD_VAR_FACTORY  # legacy
 	depends on !BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
+	help
+	  Select how Buildroot provides a read-write /var when the
+	  rootfs is not remounted read-write.
+
+config BR2_INIT_SYSTEMD_VAR_FACTORY
+	bool "build a factory to populate a tmpfs"
 	help
 	  Build a factory of the content of /var as installed by
 	  packages, mount a tmpfs on /var at runtime, so that
@@ -181,6 +187,15 @@  config BR2_INIT_SYSTEMD_VAR_FACTORY
 	  var.mount unit, that overrides the What and Type, and possibly
 	  the Options and After, fields.
 
+config BR2_INIT_SYSTEMD_VAR_CUSTOM
+	bool "something else"
+	help
+	  Choose this if you have custom dispositions (like a
+	  post-build, fakeroot script, systemd units, or initramfs)
+	  that prepare /var to be writable on a read-only rootfs.
+
+endchoice
+
 config BR2_INIT_SYSTEMD_POPULATE_TMPFILES
 	bool "trigger systemd-tmpfiles during build"
 	default y  # legacy