All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/systemd: set machine id file instalation as optional choice
@ 2019-11-17 11:33 Bartosz Bilas
  2019-11-17 11:33 ` [Buildroot] [PATCH 2/2] package/systemd: set systemd generators " Bartosz Bilas
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Bartosz Bilas @ 2019-11-17 11:33 UTC (permalink / raw)
  To: buildroot

In case of e.g writable systems there is no neccesity to have
pre-installed empty machine-id file on target because systemd
generates that automatically during system boot.
Also in case of having empty machine-id file we are not able
to use a service with ConditionFirstBoot because systemd recognizes
machine-id file in system therefore we can't detect new system instance boots up.
Set this option as enable by default to keep compatibility with old builds.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
---
 package/systemd/Config.in  | 13 +++++++++++++
 package/systemd/systemd.mk |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index aef39abe27..fadc1a32c8 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -112,6 +112,19 @@ config BR2_PACKAGE_SYSTEMD_BOOT_EFI_ARCH
 	default "x64"   if BR2_x86_64
 	depends on BR2_PACKAGE_SYSTEMD_BOOT
 
+config BR2_PACKAGE_SYSTEMD_MACHINEID_FILE
+	bool "Install empty machine id file"
+	default y
+	help
+	  The /etc/machine-id file contains the unique machine ID
+	  of the local system that is set during installation or
+	  boot. The machine ID is a single newline-terminated,
+	  hexadecimal, 32-character, lowercase ID. When decoded from
+	  hexadecimal, this corresponds to a 16-byte/128-bit value.
+	  This ID may not be all zeros.
+
+	  https://www.freedesktop.org/software/systemd/man/machine-id.html
+
 config BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY
 	bool "HTTP server for journal events"
 	select BR2_PACKAGE_LIBMICROHTTPD
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 92490eb86b..fc348fe120 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -461,9 +461,11 @@ define SYSTEMD_INSTALL_INIT_HOOK
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/remote-fs.target
 endef
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_MACHINEID_FILE),y)
 define SYSTEMD_INSTALL_MACHINEID_HOOK
 	touch $(TARGET_DIR)/etc/machine-id
 endef
+endif
 
 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
 	SYSTEMD_INSTALL_TARGET_CRYPTSETUP \
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-08-05 20:07 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-17 11:33 [Buildroot] [PATCH 1/2] package/systemd: set machine id file instalation as optional choice Bartosz Bilas
2019-11-17 11:33 ` [Buildroot] [PATCH 2/2] package/systemd: set systemd generators " Bartosz Bilas
2019-11-17 14:12   ` Arnout Vandecappelle
2019-11-17 15:06     ` Jérémy ROSEN
2019-11-25 16:44       ` Bartosz Bilas
2019-11-25 16:48         ` Jérémy ROSEN
2019-11-25 16:55           ` Bartosz Bilas
2019-11-25 17:02             ` Jérémy ROSEN
2020-02-03 18:37               ` Bartosz Bilas
2019-11-17 13:39 ` [Buildroot] [PATCH 1/2] package/systemd: set machine id file " Arnout Vandecappelle
2019-11-17 14:19   ` Jérémy ROSEN
2019-11-17 16:00     ` Arnout Vandecappelle
2019-11-17 16:14       ` Jérémy ROSEN
2019-11-17 17:34         ` Arnout Vandecappelle
2019-11-17 17:47           ` Jérémy ROSEN
2019-11-19  8:40       ` Thomas Petazzoni
2019-11-19 10:15         ` Jérémy ROSEN
2020-02-03 18:28           ` Bartosz Bilas
2020-02-03 18:34             ` Bartosz Bilas
2020-02-03 18:41               ` Bartosz Bilas
2020-02-05  9:05                 ` Jérémy ROSEN
2021-08-05 20:07 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.