From patchwork Sun Nov 17 11:33:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Bilas X-Patchwork-Id: 1196351 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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47G92b30Fnz9s7T for ; Sun, 17 Nov 2019 22:33:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4B00485F32; Sun, 17 Nov 2019 11:33:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N1QeZ01jmqNl; Sun, 17 Nov 2019 11:33:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1711785C2E; Sun, 17 Nov 2019 11:33:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 40FFB1BF4E6 for ; Sun, 17 Nov 2019 11:33:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 392D7203A2 for ; Sun, 17 Nov 2019 11:33:38 +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 CAPTa0UFBU7Q for ; Sun, 17 Nov 2019 11:33:36 +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 silver.osuosl.org (Postfix) with ESMTPS id F2ACB2037E for ; Sun, 17 Nov 2019 11:33:35 +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 1iWIo8-0004m9-7P; Sun, 17 Nov 2019 12:33:32 +0100 From: Bartosz Bilas To: buildroot@buildroot.org Date: Sun, 17 Nov 2019 12:33:45 +0100 Message-Id: <20191117113345.159653-2-b.bilas@grinn-global.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191117113345.159653-1-b.bilas@grinn-global.com> References: <20191117113345.159653-1-b.bilas@grinn-global.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] package/systemd: set systemd generators 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" Allow the user to choose which systemd generator should be installed on the target instead of installing all of them by default. That's usefull in case of when someone is using firstboot condition and doesn't want to have e.g getty services created automatically during system boot by systemd-getty-generator. Set them enabled by default to keep compatibility with old builds. Signed-off-by: Bartosz Bilas --- package/systemd/Config.in | 94 ++++++++++++++++++++++++++++++++++++++ package/systemd/systemd.mk | 56 +++++++++++++++++++++++ 2 files changed, 150 insertions(+) diff --git a/package/systemd/Config.in b/package/systemd/Config.in index fadc1a32c8..052b69f4de 100644 --- a/package/systemd/Config.in +++ b/package/systemd/Config.in @@ -112,6 +112,100 @@ config BR2_PACKAGE_SYSTEMD_BOOT_EFI_ARCH default "x64" if BR2_x86_64 depends on BR2_PACKAGE_SYSTEMD_BOOT +menu systemd-generators + +config BR2_PACKAGE_SYSTEMD_DEBUG_GENERATOR + bool "systemd debug generator" + default y + help + systemd-debug-generator is for enabling a runtime debug + shell and masking specific units at boot. + + https://www.freedesktop.org/software/systemd/man/systemd-debug-generator.html + +config BR2_PACKAGE_SYSTEMD_FSTAB_GENERATOR + bool "systemd fstab generator" + default y + help + systemd-fstab-generator is a generator that translates + /etc/fstab into native systemd units early at boot + and when configuration of the system manager is reloaded. + This will instantiate mount and swap units as necessary. + + https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html + +config BR2_PACKAGE_SYSTEMD_GETTY_GENERATOR + bool "systemd getty generator" + default y + help + systemd-getty-generator is a generator that automatically + instantiates serial-getty@.service on the kernel + console(s), if they can function as ttys and are not + provided by the virtual console subsystem. It will also + instantiate serial-getty@.service instances for + virtualizer consoles, if execution in a virtualized + environment is detected. + + https://www.freedesktop.org/software/systemd/man/systemd-getty-generator.html + +config BR2_PACKAGE_SYSTEMD_GPT_AUTO_GENERATOR + bool "systemd gpt auto generator" + default y + help + systemd-gpt-auto-generator is a unit generator that + automatically discovers root, /home/, /srv/, the EFI + System Partition, the Extended Boot Loader Partition and + swap partitions and creates mount and swap units for them, + based on the partition type GUIDs of GUID partition tables + (GPT). It implements the Discoverable Partitions + Specification. + + https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html + +config BR2_PACKAGE_SYSTEMD_RC_LOCAL_GENERATOR + bool "systemd rc local generator" + default y + help + systemd-rc-local-generator is a generator that checks + whether /etc/rc.local exists and is executable, + and if it is pulls the rc-local.service unit into the + boot process. + + https://www.freedesktop.org/software/systemd/man/systemd-rc-local-generator.html + +config BR2_PACKAGE_SYSTEMD_RUN_GENERATOR + bool "systemd run generator" + default y + help + systemd-run-generator is for invoking commands specified + on the kernel command line as system service. + + https://www.freedesktop.org/software/systemd/man/systemd-run-generator.html + +config BR2_PACKAGE_SYSTEMD_SYSTEM_UPDATE_GENERATOR + bool "systemd system update generator" + default y + help + systemd-system-update-generator is a generator that + automatically redirects the boot process to + system-update.target, if /system-update exists. + + https://www.freedesktop.org/software/systemd/man/systemd-system-update-generator.html + +config BR2_PACKAGE_SYSTEMD_SYSV_GENERATOR + bool "systemd sysv generator" + default y + help + systemd-sysv-generator is a generator that creates wrapper + .service units for SysV init scripts in /etc/init.d/* at + boot and when configuration of the system manager is + reloaded. This will allow systemd(1) to support them + similarly to native units/ + + https://www.freedesktop.org/software/systemd/man/systemd-system-update-generator.html + +endmenu + config BR2_PACKAGE_SYSTEMD_MACHINEID_FILE bool "Install empty machine id file" default y diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk index fc348fe120..32349980e3 100644 --- a/package/systemd/systemd.mk +++ b/package/systemd/systemd.mk @@ -467,6 +467,62 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK endef endif +ifneq ($(BR2_PACKAGE_SYSTEMD_DEBUG_GENERATOR),y) +define SYSTEMD_DISABLE_DEBUG_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-debug-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_DEBUG_GENERATOR +endif + +ifneq ($(BR2_PACKAGE_SYSTEMD_FSTAB_GENERATOR),y) +define SYSTEMD_DISABLE_FSTAB_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-fstab-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_FSTAB_GENERATOR +endif + +ifneq ($(BR2_PACKAGE_SYSTEMD_GETTY_GENERATOR),y) +define SYSTEMD_DISABLE_GETTY_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-getty-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_GETTY_GENERATOR +endif + +ifneq ($(BR2_PACKAGE_SYSTEMD_GPT_AUTO_GENERATOR),y) +define SYSTEMD_DISABLE_GPT_AUTO_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-gpt-auto-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_GPT_AUTO_GENERATOR +endif + +ifneq ($(BR2_PACKAGE_SYSTEMD_RC_LOCAL_GENERATOR),y) +define SYSTEMD_DISABLE_RC_LOCAL_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-rc-local-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_RC_LOCAL_GENERATOR +endif + +ifneq ($(BR2_PACKAGE_SYSTEMD_RUN_GENERATOR),y) +define SYSTEMD_DISABLE_RUN_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-run-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_RUN_GENERATOR +endif + +ifneq ($(BR2_PACKAGE_SYSTEMD_SYSTEM_UPDATE_GENERATOR),y) +define SYSTEMD_DISABLE_SYSTEMD_SYSTEM_UPDATE_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-system-update-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_SYSTEMD_SYSTEM_UPDATE_GENERATOR +endif + +ifneq ($(BR2_PACKAGE_SYSTEMD_SYSTEMD_SYSV_GENERATOR),y) +define SYSTEMD_DISABLE_SYSTEMD_SYSV_GENERATOR + rm -f $(TARGET_DIR)/usr/lib/systemd/system-generators/systemd-sysv-generator +endef +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_DISABLE_SYSTEMD_SYSV_GENERATOR +endif + SYSTEMD_POST_INSTALL_TARGET_HOOKS += \ SYSTEMD_INSTALL_TARGET_CRYPTSETUP \ SYSTEMD_INSTALL_TARGET_MACHINED \