From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k1XdX-0005kj-K2 for ptxdist@pengutronix.de; Fri, 31 Jul 2020 18:12:00 +0200 Received: by mail-wm1-x32e.google.com with SMTP id g10so6704289wmc.1 for ; Fri, 31 Jul 2020 09:11:59 -0700 (PDT) From: Bruno Thomsen Date: Fri, 31 Jul 2020 18:11:37 +0200 Message-Id: <20200731161141.6155-3-bruno.thomsen@gmail.com> In-Reply-To: <20200731161141.6155-1-bruno.thomsen@gmail.com> References: <20200731161141.6155-1-bruno.thomsen@gmail.com> MIME-Version: 1.0 Subject: [ptxdist] [PATCH v3 3/7] chrony: systemd unit option List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Bruno Thomsen , bth@kamstrup.com Install examples/chronyd.service from package as starting point, it works great, otherwise use install_alternative. Signed-off-by: Bruno Thomsen --- Changes since version 2: - Remove chronyd.service from projectroot - Install chronyd.service in install stage. Changes since version 1: - Fix install_alternative statement for service file. - Added chrony-3.5/examples/chronyd.service to projectroot. rules/chrony.in | 7 +++++++ rules/chrony.make | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/rules/chrony.in b/rules/chrony.in index c81eba868..16b730199 100644 --- a/rules/chrony.in +++ b/rules/chrony.in @@ -95,6 +95,13 @@ endif config CHRONY_STARTSCRIPT bool default y + depends on INITMETHOD_BBINIT prompt "install /etc/init.d/chrony" +config CHRONY_SYSTEMD_UNIT + bool + default y + depends on INITMETHOD_SYSTEMD + prompt "install systemd unit files" + endif diff --git a/rules/chrony.make b/rules/chrony.make index 9f20c413d..afdfe434a 100644 --- a/rules/chrony.make +++ b/rules/chrony.make @@ -55,6 +55,17 @@ CHRONY_CONF_OPT := \ $(call ptx/ifdef, PTXCONF_GLOBAL_IPV6,,--disable-ipv6) \ --without-seccomp +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/chrony.install: + @$(call targetinfo) + @$(call world/install, CHRONY) + @install -D -m 644 $(CHRONY_DIR)/examples/chronyd.service \ + $(CHRONY_PKGDIR)/usr/lib/systemd/system/chronyd.service + @$(call touch) + # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- @@ -111,6 +122,13 @@ ifneq ($(call remove_quotes, $(PTXCONF_CHRONY_BBINIT_LINK)),) endif endif endif + +ifdef PTXCONF_CHRONY_SYSTEMD_UNIT + @$(call install_alternative, chrony, 0, 0, 0644, /usr/lib/systemd/system/chronyd.service) + @$(call install_link, chrony, ../chronyd.service, \ + /usr/lib/systemd/system/multi-user.target.wants/chronyd.service) +endif + @$(call install_finish, chrony) @$(call touch) -- 2.26.2 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de