From patchwork Tue Apr 14 13:52:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1270356 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=none (p=none dis=none) header.from=rockwellcollins.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 491n5D6s2pz9sQx for ; Tue, 14 Apr 2020 23:53:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CE20D85B99; Tue, 14 Apr 2020 13:53:33 +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 w6VqHS-V8KeF; Tue, 14 Apr 2020 13:53:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0A74D85AA1; Tue, 14 Apr 2020 13:53:32 +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 0C3D11BF3BA for ; Tue, 14 Apr 2020 13:53:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 00DBB20006 for ; Tue, 14 Apr 2020 13:53:29 +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 fiDBWlFaIDIZ for ; Tue, 14 Apr 2020 13:53:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs04.rockwellcollins.com (da1vs04.rockwellcollins.com [205.175.227.52]) by silver.osuosl.org (Postfix) with ESMTPS id E3E6A20005 for ; Tue, 14 Apr 2020 13:53:27 +0000 (UTC) IronPort-SDR: RaE+QsNKBzoNlmw0WFroz3W/+8LxWyrqLRYJZOsBo3P3O+CA+Ui6jS/fLrWCypskfw4nzolfwz ni75PEgGivWIr2LdoMWAWkOQ4kHMZQtgu9d1uYcv8LCVi/J1OBUZu1HcCUMkDkQkv5U480zTAB JMUjREXfI7DhCyikQPex5WTyhTULAEWRkipkys54p9wAtPuBh7reROGbPkzQPkuLbjztv6GDV7 O9/QZF51ppEc4ZLi47GP84s+hnQuSrx5L0BZJ6f3o8nKWemfzQ0fv411AAkoGWqmmB1Dhn7sCF KCE= Received: from ofwda1n02.rockwellcollins.com (HELO dtulimr02.rockwellcollins.com) ([205.175.227.14]) by da1vs04.rockwellcollins.com with ESMTP; 14 Apr 2020 08:53:27 -0500 X-Received: from bacon.rockwellcollins.com (unknown [192.168.6.146]) by dtulimr02.rockwellcollins.com (Postfix) with ESMTP id C574020074; Tue, 14 Apr 2020 08:53:26 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Tue, 14 Apr 2020 08:52:31 -0500 Message-Id: <20200414135231.27737-1-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.18.0 Subject: [Buildroot] [PATCH] package/swupdate: Add basic systemd service 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: Matt Weber , Sam Voss MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Sam Voss Signed-off-by: Sam Voss Signed-off-by: Matt Weber --- package/swupdate/swupdate.mk | 10 ++++++++++ package/swupdate/swupdate.service | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 package/swupdate/swupdate.service diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk index 2b51edb66d..2300220d93 100644 --- a/package/swupdate/swupdate.mk +++ b/package/swupdate/swupdate.mk @@ -189,4 +189,14 @@ $(error No Swupdate configuration file specified, check your BR2_PACKAGE_SWUPDAT endif endif +ifeq ($(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE),y) +define SWUPDATE_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 644 package/swupdate/swupdate.service \ + $(TARGET_DIR)/usr/lib/systemd/system/swupdate.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -sf ../../../../usr/lib/systemd/system/swupdate.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/swupdate.service +endef +endif + $(eval $(kconfig-package)) diff --git a/package/swupdate/swupdate.service b/package/swupdate/swupdate.service new file mode 100644 index 0000000000..cb065a0414 --- /dev/null +++ b/package/swupdate/swupdate.service @@ -0,0 +1,17 @@ +[Unit] +Description=SWUpdate daemon +Documentation=https://github.com/sbabic/swupdate +Documentation=https://sbabic.github.io/swupdate + +[Service] +# Default environment variables in case /etc/default/swupdate isn't providing them +Environment=SWU_POST_UPDATE_CMD="touch /tmp/.swu_complete" +Environment=SWU_WEBSERVER_ARGS="-p 8080 -r /var/www/swupdate/" + +# Always take what is in the environment files when exists +EnvironmentFile=/etc/default/swupdate + +ExecStart=/usr/bin/swupdate ${SWU_KEY_ARGS} -p ${SWU_POST_UPDATE_CMD} -v -L -w "${SWU_WEBSERVER_ARGS}" + +[Install] +WantedBy=multi-user.target