From patchwork Sun Nov 17 11:33:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Bilas X-Patchwork-Id: 1196352 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=grinn-global.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47G92b458kz9sPZ for ; Sun, 17 Nov 2019 22:33:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9982E203C4; Sun, 17 Nov 2019 11:33:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dg-HKBoxcQdb; Sun, 17 Nov 2019 11:33:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 927A320384; Sun, 17 Nov 2019 11:33:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 59E371BF4E6 for ; Sun, 17 Nov 2019 11:33:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 41559864E0 for ; Sun, 17 Nov 2019 11:33:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DkFa+6sneH8q for ; Sun, 17 Nov 2019 11:33:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.megiteam.pl (smtp.megiteam.pl [31.186.83.105]) by whitealder.osuosl.org (Postfix) with ESMTPS id A6A3D864DA for ; Sun, 17 Nov 2019 11:33:34 +0000 (UTC) Received: from host-81-161-203-248.oxylion.net.pl ([81.161.203.248] helo=bartekk-pc.lan) by smtp.megiteam.pl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86.2_XX) (envelope-from ) id 1iWIo7-0004m9-1R; Sun, 17 Nov 2019 12:33:31 +0100 From: Bartosz Bilas To: buildroot@buildroot.org Date: Sun, 17 Nov 2019 12:33:44 +0100 Message-Id: <20191117113345.159653-1-b.bilas@grinn-global.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] package/systemd: set machine id file instalation as optional choice X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Bilas Errors-To: buildroot-bounces@busybox.net Sender: "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 --- 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 \