All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Bilas <b.bilas@grinn-global.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] package/systemd: set machine id file instalation as optional choice
Date: Sun, 17 Nov 2019 12:33:44 +0100	[thread overview]
Message-ID: <20191117113345.159653-1-b.bilas@grinn-global.com> (raw)

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

             reply	other threads:[~2019-11-17 11:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17 11:33 Bartosz Bilas [this message]
2019-11-17 11:33 ` [Buildroot] [PATCH 2/2] package/systemd: set systemd generators instalation as optional choice 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

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=20191117113345.159653-1-b.bilas@grinn-global.com \
    --to=b.bilas@grinn-global.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 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.