From patchwork Wed Oct 23 21:10:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Freihofer, Adrian" X-Patchwork-Id: 1182493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::440; helo=mail-wr1-x440.google.com; envelope-from=swupdate+bncbaabb4edypwqkgqefra5usa@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=siemens.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="ncbXxj9Y"; dkim-atps=neutral Received: from mail-wr1-x440.google.com (mail-wr1-x440.google.com [IPv6:2a00:1450:4864:20::440]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46z32Z58YWz9sPx for ; Thu, 24 Oct 2019 08:11:17 +1100 (AEDT) Received: by mail-wr1-x440.google.com with SMTP id v8sf10762864wrt.16 for ; Wed, 23 Oct 2019 14:11:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1571865072; cv=pass; d=google.com; s=arc-20160816; b=ZyOEN3onEyblnuwO1ocYkd2hYlKy4mz7/HdOjU50jw7PIYHMAekL/O1419XHTeCaVD PypPCwq5UA6BHM9an1IAUEUSTPvsVSrl7lTPeJmOvTmstNajEZQuXNnuWDFR0+d2MutC koCIl8kId/M5nqtKK6uf4BrUM32czb4VM+1Db/9f9sLX7VTmrr78IzstE3BM2/dJgtci 35CTAhA/UYXhSEQLo72q/ChhocCKdKFSew1MrWDBEOOd0teUt0bFeLJnHBwpwemK43ZG UZSNrESxGQJp++uuJMuPND0GnmWw6vFOSFHSk95kwzcMrcUIiVou+viA3/FlAH1QuLaQ vnsQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:mime-version:sender:dkim-signature; bh=EYsjIejnvij1Oy/bjBoat6k4jbFJE7j0JimmYTQZyGs=; b=bu1rlEHH7LSIAADLGTvt0VXIyvZuXbe0lMX9iWseTg2hNYzl6U1hDu3lLqpHUW2RFG umtbPs9mkGJp9yQQ5eDMcAwKzVzJklFkA5MlLl6mNTj0li5jrhMoMFKjbDfy9F2PRhDS GYc1qSYYXN37LKw6YW3aw76S1xSbr6IEEtG+H7RapuxrTPmC7uUzl5vZmE2eUWA/2Dcs cviabSQu0SxPpM/ysBKHiSWrO1pYSMklDRVD4cf5od5ZbTuqI4oJ+O8aiYbloFHH43iC 1JR1gc+DQh9Rww0Ex17p6m9SNL53Jee16WoNQjZ7E860gYb0kIQjuyc2ZhF8Og9On19b vv3g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of adrian.freihofer@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=adrian.freihofer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=EYsjIejnvij1Oy/bjBoat6k4jbFJE7j0JimmYTQZyGs=; b=ncbXxj9Yi94qBDPCdklZQO70A7ciYGC8XvIYeGgfs9MrUXjDJkew5kikO6O64OkdNz DWK078K9aXKiztJvALi3uK1ByaLZwktn3CP/LTNzH6QZ051WXvsec/DmZbLvoUWbzT4D DKAYP8xuM/aXDV2JALcZeeAfuBAS78DWl831gRgx0Vf9b8rMIMABbZEUHH+KnY4LEhOo wZRYUo2Kpx+wbdmognjuuww5ksxfV8UcQDP0VeNNSFoLU/n33YbpGitA4JreAhn9UMTn DdxqKd1JBrBL4Ql5w1pfORlo19JkqsoNo0kfXK0YOTufTHaMpTocYxfDJQ6FFGaOEWq8 /WGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=EYsjIejnvij1Oy/bjBoat6k4jbFJE7j0JimmYTQZyGs=; b=Pu2gX6IUs4bT8OeZ8h3uEwc0D42L2Jm0er7VL8bJU74FMInY2dfvIT/D1AM8iFbyP0 1NtYcEgcgFhR8XjVvwc79EBMKoFWN5AsOuCc0MJm/fZBjfR7+2GE6OwNC7l9xW6p4Ujo fi2QqB2rilhcFpV/fOjgJ1QxoDRUT1FYTnWi837nXWpyCC2+vyNJXCHLGt4LuAhiwQoG cp3kwC3kQyjm0JPz5bYiLQcHKhCnqkSyWXG32z5mRiSKOMYj2xEevfQtIoQEO9JHb4c/ BcXdSu1BnKYMOvnOYnItioKeMuo5CEX6u6Layej18H9tfBPcpYsOw74S8tkZ1Q1BCru3 t8LQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAVd/Kjpful3y50QF5I4X+kc4i/J6v7HR8s6l3GzxR7bNDEvkKvC CSU7yV116XHKhllyMjCy5RA= X-Google-Smtp-Source: APXvYqxEX47BHJm2ULYTwNe36MGe7yp4Zndx4C6Tz6/2XZP5khWM153OwMTKTpKSRyqsDYpK7eCK3w== X-Received: by 2002:a1c:1d7:: with SMTP id 206mr1616247wmb.33.1571865072268; Wed, 23 Oct 2019 14:11:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:a517:: with SMTP id i23ls2124717wrb.9.gmail; Wed, 23 Oct 2019 14:11:11 -0700 (PDT) X-Received: by 2002:a5d:62c5:: with SMTP id o5mr688022wrv.388.1571865071778; Wed, 23 Oct 2019 14:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571865071; cv=none; d=google.com; s=arc-20160816; b=FHt0GlU+lRCAhiQoLLJVcw1Jwhl21zSkLZbrCMIDcfsbfNNjIr+XRi7MWnaIFfHGih szgAUeex+yxgqxErtDXgr9Z6su8aQ/SXePbpA+qsMB9YJmMNQygeyoExqvmt++flPlKH HaCEBa8mKbL6rHb9o2JFDOOdMVNBblPRPQooC4/b4aehwM7D0Az5h8z+3fLELFJCPgRu 62naWdW+nvPl2AGQjl35ZT4r4N9ouOk2Wggq6gLaQ1kGwoF24hAVQW7ntfMYI3tdlwl1 PORFv0yHYAG9nQ07r38+G8veSn2rDcbyJZxPX9E2dvEnA6GGYcpFtDSdFWslaEbmb5JZ abkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=EHOUTaJA1BQyC9WHaTeB5fi+CjYZspzwY6P0wfo39zs=; b=L08auXsb0tpcC0EF71YWHl/edEmzrBgQHo+LM5bQ5X8m8HB0lG+43/bGQCDkSzC0od KI1JcuQGIfE2quLgpqOeiv00P673z2E/L0Qwsjyz8wVfk6j2uPqyTRpFlbjUk4AxXhi5 mhwvKngJN5v5Wg1EM+0nHxe8eO2pxUFgj6cCi3ADnLvipTuu8FmPkiu+B+4aWslU391l 5xctL+PYaeeI5nczfk0+st231zjIipKysAEeIFV3XQY/ioD+bPgjo8j58s7Fh+3z6Gjj wPtN4GaB76lFfE9RJFQ/CwA3e5H2oVm40K6YmxH1n/AZrlKG9l5bHVErHS+3T5L0o0jX oGnQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of adrian.freihofer@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=adrian.freihofer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id l3si43980wmg.0.2019.10.23.14.11.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2019 14:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of adrian.freihofer@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x9NLBBpT003140 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 23 Oct 2019 23:11:11 +0200 Received: from dev.vm6.ccp.siemens.com ([167.87.32.70]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id x9NLB9nS026775; Wed, 23 Oct 2019 23:11:10 +0200 Received: from dev.localdomain (localhost [127.0.0.1]) by dev.vm6.ccp.siemens.com (Postfix) with ESMTP id 7DC9E2353A5A; Wed, 23 Oct 2019 23:11:08 +0200 (CEST) From: Adrian Freihofer To: swupdate@googlegroups.com Cc: Adrian Freihofer Subject: [swupdate] [meta-swupdate][PATCH 09/12] swupdate: improve systemd config Date: Wed, 23 Oct 2019 23:10:58 +0200 Message-Id: <20191023211101.16591-10-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191023211101.16591-1-adrian.freihofer@siemens.com> References: <20191023211101.16591-1-adrian.freihofer@siemens.com> X-Original-Sender: adrian.freihofer@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of adrian.freihofer@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=adrian.freihofer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , For most projects starting swupdate requires some logic implemented in shell scripts. Therefore swupdate is now started by a shell script also in case of systemd is anabled in DISTRO_FEATURES. The new swupdate startup script sources code snippets located in /usr/lib/swupdate/conf.d and in /etc/swupdate/conf.d. The snippets are executed in alphabetical order. The idea is that files in /usr are added at build time and files in /etc might be added or modified at run-time. If two scripts, one in /etc and one in /usr have the same file name, the script in /usr gets skipped completely. This allows to disable code in /usr, which is probably mounted ro, at runtime. Code snippets are automatically generated at build-time, depending on the configuration created by swupdate's menuconfig. But code snippets may be created manually and added via bbappend to the /usr/lib/swupdate/conf.d folder. All modes (file, webserver, webclient) of swupdate are supported. Different variables might be defined by the code snippets added to the named folders: - SWUPDATE_ARGS - SWUPDATE_WEBSERVER_ARGS - SWUPDATE_DOWNLOAD_ARGS Finally swupdate gets started by a line similar to: exec /usr/bin/swupdate $SWUPDATE_ARGS \ -w "$SWUPDATE_WEBSERVER_ARGS" \ -u "$SWUPDATE_DOWNLOAD_ARGS" The default set of configuraton and service files is now installed by the "make install" target of the swupdate Makefile. The service files which are not used for the latest git version of swupdate are moved to swupdate-2019.04 folder. Signed-off-by: Adrian Freihofer --- .../swupdate-progress.service | 0 .../swupdate-usb.rules | 0 .../swupdate-usb@.service | 0 .../swupdate.service | 0 .../systemd-tmpfiles-swupdate.conf | 0 recipes-support/swupdate/swupdate.inc | 40 +++++++++------------- recipes-support/swupdate/swupdate_2019.04.bb | 8 +++++ recipes-support/swupdate/swupdate_git.bb | 4 +++ 8 files changed, 29 insertions(+), 23 deletions(-) rename recipes-support/swupdate/{swupdate => swupdate-2019.04}/swupdate-progress.service (100%) rename recipes-support/swupdate/{swupdate => swupdate-2019.04}/swupdate-usb.rules (100%) rename recipes-support/swupdate/{swupdate => swupdate-2019.04}/swupdate-usb@.service (100%) rename recipes-support/swupdate/{swupdate => swupdate-2019.04}/swupdate.service (100%) rename recipes-support/swupdate/{swupdate => swupdate-2019.04}/systemd-tmpfiles-swupdate.conf (100%) diff --git a/recipes-support/swupdate/swupdate/swupdate-progress.service b/recipes-support/swupdate/swupdate-2019.04/swupdate-progress.service similarity index 100% rename from recipes-support/swupdate/swupdate/swupdate-progress.service rename to recipes-support/swupdate/swupdate-2019.04/swupdate-progress.service diff --git a/recipes-support/swupdate/swupdate/swupdate-usb.rules b/recipes-support/swupdate/swupdate-2019.04/swupdate-usb.rules similarity index 100% rename from recipes-support/swupdate/swupdate/swupdate-usb.rules rename to recipes-support/swupdate/swupdate-2019.04/swupdate-usb.rules diff --git a/recipes-support/swupdate/swupdate/swupdate-usb@.service b/recipes-support/swupdate/swupdate-2019.04/swupdate-usb@.service similarity index 100% rename from recipes-support/swupdate/swupdate/swupdate-usb@.service rename to recipes-support/swupdate/swupdate-2019.04/swupdate-usb@.service diff --git a/recipes-support/swupdate/swupdate/swupdate.service b/recipes-support/swupdate/swupdate-2019.04/swupdate.service similarity index 100% rename from recipes-support/swupdate/swupdate/swupdate.service rename to recipes-support/swupdate/swupdate-2019.04/swupdate.service diff --git a/recipes-support/swupdate/swupdate/systemd-tmpfiles-swupdate.conf b/recipes-support/swupdate/swupdate-2019.04/systemd-tmpfiles-swupdate.conf similarity index 100% rename from recipes-support/swupdate/swupdate/systemd-tmpfiles-swupdate.conf rename to recipes-support/swupdate/swupdate-2019.04/systemd-tmpfiles-swupdate.conf diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index 1c863bb..19ccf4a 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -10,25 +10,30 @@ inherit cml1 update-rc.d systemd pkgconfig SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=https \ file://defconfig \ file://swupdate \ - file://swupdate.service \ - file://swupdate-usb.rules \ - file://swupdate-usb@.service \ - file://swupdate-progress.service \ - file://systemd-tmpfiles-swupdate.conf \ " INSANE_SKIP_${PN} = "ldflags" PACKAGES =+ "${PN}-www ${PN}-lua" FILES_${PN}-lua += "${libdir}/lua/" -FILES_${PN}-www = "/www/*" -FILES_${PN} += "${libdir}/tmpfiles.d" +FILES_${PN}-www = " \ + ${libdir}/swupdate/conf.d/*mongoose* \ + /www/* \ +" +FILES_${PN} += " \ + ${libdir}/tmpfiles.d \ + ${libdir}/swupdate/* \ + ${systemd_system_unitdir}/swupdate.socket \ + ${systemd_system_unitdir}/swupdate.service \ + ${systemd_system_unitdir}/swupdate-usb@.service \ +" RDEPENDS_${PN}-www += "${PN}-tools" S = "${WORKDIR}/git/" -EXTRA_OEMAKE += " HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y" +EXTRA_OEMAKE += " HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'SYSTEMD_SYSTEM_UNITDIR=${systemd_system_unitdir}', '', d)}" DEPENDS += "kern-tools-native" @@ -144,23 +149,12 @@ do_install () { install -d ${D}${sysconfdir}/init.d install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d - - install -d ${D}${systemd_unitdir}/system - install -m 644 ${WORKDIR}/swupdate.service ${D}${systemd_unitdir}/system - install -m 644 ${WORKDIR}/swupdate-usb@.service ${D}${systemd_unitdir}/system - install -m 644 ${WORKDIR}/swupdate-progress.service ${D}${systemd_unitdir}/system - - - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -d ${D}${libdir}/tmpfiles.d - install -m 0644 ${WORKDIR}/systemd-tmpfiles-swupdate.conf ${D}${libdir}/tmpfiles.d/swupdate.conf - install -d ${D}${sysconfdir}/udev/rules.d - install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/ - fi } INITSCRIPT_NAME = "swupdate" INITSCRIPT_PARAMS = "defaults 70" -SYSTEMD_SERVICE_${PN} = "swupdate.service" -SYSTEMD_SERVICE_${PN} += "swupdate-usb@.service swupdate-progress.service" +SYSTEMD_SERVICE_${PN} = " \ + swupdate.service \ + swupdate-usb@.service \ + " diff --git a/recipes-support/swupdate/swupdate_2019.04.bb b/recipes-support/swupdate/swupdate_2019.04.bb index e2eabbb..83785d7 100644 --- a/recipes-support/swupdate/swupdate_2019.04.bb +++ b/recipes-support/swupdate/swupdate_2019.04.bb @@ -1,4 +1,12 @@ require swupdate.inc require swupdate_tools.inc +SRC_URI += " \ + file://swupdate.service \ + file://swupdate-usb.rules \ + file://swupdate-usb@.service \ + file://swupdate-progress.service \ + file://systemd-tmpfiles-swupdate.conf \ + " + SRCREV = "d39f4b8e00ef1929545b66158e45b82ea922bf81" diff --git a/recipes-support/swupdate/swupdate_git.bb b/recipes-support/swupdate/swupdate_git.bb index 9fea83a..a4289f6 100644 --- a/recipes-support/swupdate/swupdate_git.bb +++ b/recipes-support/swupdate/swupdate_git.bb @@ -5,3 +5,7 @@ DEFAULT_PREFERENCE = "-1" SRCREV ?= "045a618a725d0a2fce64161f10101c0004ac5d85" PV = "2019.04+git${SRCPV}" + +SYSTEMD_SERVICE_${PN} += " \ + swupdate.socket \ +"