From patchwork Sat Apr 10 20:53:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Russell X-Patchwork-Id: 1464707 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=2607:f8b0:4864:20::43c; helo=mail-pf1-x43c.google.com; envelope-from=swupdate+bncbdk3lwhx3aebbyvazcbqmgqehraud4y@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=dQq5Ib8R; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=VYrgEDuK; dkim-atps=neutral Received: from mail-pf1-x43c.google.com (mail-pf1-x43c.google.com [IPv6:2607:f8b0:4864:20::43c]) (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 4FHnKc5rJbz9sTD for ; Sun, 11 Apr 2021 06:53:56 +1000 (AEST) Received: by mail-pf1-x43c.google.com with SMTP id s10sf2907578pfu.3 for ; Sat, 10 Apr 2021 13:53:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1618088034; cv=pass; d=google.com; s=arc-20160816; b=YIXWX5dhKkXewKzG+jtMCQxWLeOk29FimWILNx5VisezRr+prdTM4VmfnB1Zds9Mxi VFHGD687Pp+VGoEnmKY0dhBplMIzHWVpuJ48kdorjBGU07EHyCcMI4Cx/Ex41VHQTqDb ZYj6itd7hk1xek5zDuIKdoPD/+Ni3P9zzybheypwN6BfHRFohD6KuxhG7bR/1FGQYlP1 B7fpKSATwBIINi1mn0FTk3WBrTIDXa+aSmgBS+XqnaehWqoyYmNGL8/FQ8Opr9gjQQ2c BOHDkF0ocpIazRJjygDDqKPtKg+2U8EPNisvOYfYqfc+VRmJEtmEeXHr7C7gHR8CsSv+ ekwA== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=e9zW+SNdc8N+mCahIqhYtZG7FUqeGc7h2arcKT4WKcI=; b=M7ZXI3ev6JfaSHiiGpKnmikh7HE3tRkEAazVnUsKmZaYRpqMAa/4grhppoEljp5lQO 8vbhH0bz4GjH3aNIiAcoGc2lKYV/sB6PRbYXuuHc1w65JtntH/40GPYAvl6CAdVcDot4 rsXO/YBEDv1eLSnxu38MElQYuzBKn9cX9bJzBgRrWZ1czH+sT1XeYebpFOMPfS8vZA2I IUktZ4RPEuDz1hyVoNPrCxdZEotq0nQvIoCncEeqQ0g4nOSDpCl6ihSXAQ2gJxmdGN7c iAkUTqdvFr7OerV9dlJtYUFWMrRZ9MYvqn0Vk03b+FFO2Iv22G2WYLTb0HdtSXwZfYct 5OpA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oRNmKnss; spf=pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::f35 as permitted sender) smtp.mailfrom=bkylerussell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=e9zW+SNdc8N+mCahIqhYtZG7FUqeGc7h2arcKT4WKcI=; b=dQq5Ib8RZc513KjCSzeSOXAqbsl9ISY3zfdU/85Po894zS+6Wg14r9bhcGggV1bk9L 1reT0ceeHo8+oNPec8M/fVpkhyiHY3irRotFgMyp9/kO0kIaqTZ66lKWkHPHPYEmC/S6 An/mDOrccu+Ook8NG4sk4Y2up4KHdE+oNkgKT4pR8BcD6jTapspzkpAsgBrZDfseeoS3 vAdAWRr4k4NHPt9J6GYmUNFBPSzXoLHYLXpREzkMuKa5ALqntuEDUtSUhCaA7MAysNzX My17J0hYGp34mlu4HbAHV+/VHt2DLbeHZYcNyUM0KwssZMxsJVHmEogagelKsQ8e5P1e qoHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=e9zW+SNdc8N+mCahIqhYtZG7FUqeGc7h2arcKT4WKcI=; b=VYrgEDuKkMuNm1TIRV+7xsA7IC93ai/us7MKAYSc0nq0T9Yoa8vCn1sr3MiAH263VS YGbyDBMGhMzkPR+mqptHx5iG71BaK48CVlosfe8/Ee2jG7GOHO5urfWs8ZxxA3EdKKcD r4jrgCULsIgbl31+MX6mryTfWAgNUd/veL4VNzO59Of+pTUiZHSV35Z/0/9qZHNCeU1q v3nFUbPr4K3N8wrBZnsRPUGYWygo6YuDHEp1XZ228oPSXYkwiNXfPMR8cD2QBFehOh+Z MmpBxONy4ObshLxd69GBHUeedYYUrLU8uggnAwnP1D4UQWV4mHUbNcxqVof1bhI85ogX uOlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version: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=e9zW+SNdc8N+mCahIqhYtZG7FUqeGc7h2arcKT4WKcI=; b=YOIa22HH3ioQqc1glKchq/I41lrKHi7jRKgG10ft15ibnmSSphVo9nWk6E3rScpdVz Y/OGuDRw1ngVaB/cnJanfXr+c5Oh+GNVd/HYefxOG5Ng5yAOFo+6Sn6/t5JXyGe8mjER 2IWs3BA+/0eEpzvNbxJ2lc8EVhMvMllNroeNShPPB5NbeiUq/f4IN53jgYJCzqP0hsfP owU5EXRCljAFYNSy2nsQao4qgLIeiahJjgyRtTdTHIct+xON03aBTepTE0PP/ZflM1Gs /pizn93r6peSTQbpgFPBhBd3OQmtfSxSVDSC97MD+Zy44VPhRKvrJzk1jqxcPoEA7N8Q /L1A== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530EmWlTKJDlvhEUnHRsZhJtSALSmtVpaSZXSZ/ltzNqgJFIM6ut WYQnkjlFJr0oE8PlccEhYd8= X-Google-Smtp-Source: ABdhPJywfqXPvR6rqZC8GfbLn5DZJjokKufowTArIJJ5aWq7bfm1tlXJa0iSTu6w1/Ak9uVSN7wbpg== X-Received: by 2002:a17:90a:bd8c:: with SMTP id z12mr14033916pjr.83.1618088034562; Sat, 10 Apr 2021 13:53:54 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a63:1656:: with SMTP id 22ls5190729pgw.1.gmail; Sat, 10 Apr 2021 13:53:54 -0700 (PDT) X-Received: by 2002:a63:b91b:: with SMTP id z27mr19265779pge.231.1618088034000; Sat, 10 Apr 2021 13:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618088033; cv=none; d=google.com; s=arc-20160816; b=0ArgiTk4FFvAUWvqtODVvCJDqP3c7b1M8zliI80y+4cQbbdlJ/bGKQkrIYylMHyjzR bvVP9/ZzpdbyVUxHfmRxYPWySsaXb0W7EdvqslkOVPetmP1DhZe/xS89Zz85AMvN1Gwn k9f96sL71zJCbx/09ADyonEBInLO2VGWxrVNe9qE/Yf6IE7xp3t1DqoXf/RrLhbwXKZP 6cwmetYigXREUuMBl8l/pi3TeWxuMumKoES1yBCPd1ojgnKSeDXfyEHDUcSJrWob7WKo NCgQtE6pKyH2WxsgvA2clisrlQgL+LZzMqixShZbnqD8d0F9gzAfQst406lo6mUfrqKW mabQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ze6FBd0tmBbt8qgyUUU/o/4BZa6yB16hTP6NycMpe6g=; b=hxSDDAGPO8IiClCzfxOH9jgtcW0C5Jj7ite9i71U6c+5icB5W1tk3C+VVsU3AbAZUn caYTO98XVibswrSeYtL682ryvbihwmuF/vi69lWKVKI937ib7ahxQfatxr/OJO9/OWIo pORQEB2kFeQ5huFQ1lOrKBLG0VJcKdEeJM95Wh5+MbGjXqOF4ei2swjcIaBzBFjGNQTH BRZWM5hX3mXzw2LT9YT4efI9OyJxsAgyJmcXimW7qBh91iHbsW0rql4kQCWHzBgANBR1 eE+8eAMrrfxscxF06qM8psqluwF0x1RyLwgJ5qD0aHqB5DaxCi12sGdJd4/dFINzhgjv zZqw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oRNmKnss; spf=pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::f35 as permitted sender) smtp.mailfrom=bkylerussell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com. [2607:f8b0:4864:20::f35]) by gmr-mx.google.com with ESMTPS id g23si721486pfu.3.2021.04.10.13.53.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 10 Apr 2021 13:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::f35 as permitted sender) client-ip=2607:f8b0:4864:20::f35; Received: by mail-qv1-xf35.google.com with SMTP id es6so4467521qvb.0 for ; Sat, 10 Apr 2021 13:53:53 -0700 (PDT) X-Received: by 2002:a05:6214:19c4:: with SMTP id j4mr20656739qvc.27.1618088033454; Sat, 10 Apr 2021 13:53:53 -0700 (PDT) Received: from poirot.file.core.windows.net ([12.190.236.22]) by smtp.gmail.com with ESMTPSA id g74sm4679657qke.3.2021.04.10.13.53.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Apr 2021 13:53:53 -0700 (PDT) From: Kyle Russell To: swupdate@googlegroups.com Cc: Kyle Russell Subject: [swupdate] [meta-swupdate][PATCH 2/2] swupdate: reboot on update from initramfs recovery image Date: Sat, 10 Apr 2021 16:53:31 -0400 Message-Id: <20210410205331.158805-2-bkylerussell@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410205331.158805-1-bkylerussell@gmail.com> References: <20210410205331.158805-1-bkylerussell@gmail.com> MIME-Version: 1.0 X-Original-Sender: bkylerussell@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oRNmKnss; spf=pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::f35 as permitted sender) smtp.mailfrom=bkylerussell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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: , Create a swupdate-progress-sysvinit package with the necessary startup script for swupdate-progress to run correctly during startup of the initramfs recovery image. This allows swupdate-progress to be installed in both a distro's main rootfs which uses systemd, and the initramfs image which uses sysvinit. In order for the initramfs image to support automatic reboot, it needs swupdate-progress to monitor the update process and trigger a reboot of the system, but for distros configured to use systemd, the init script needed to launch swupdate-progress isn't even installed to the swupdate-progress package, so just installing swupdate-progress to the initramfs isn't sufficient for this to work since the initramfs only uses sysvinit. Both the init script (from swupdate-progress-sysvinig) and the swupdate-progress package need to be installed to the initramfs. Signed-off-by: Kyle Russell --- recipes-extended/images/swupdate-image.inc | 2 +- recipes-support/swupdate/swupdate.inc | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/recipes-extended/images/swupdate-image.inc b/recipes-extended/images/swupdate-image.inc index 795b4a2..928edad 100644 --- a/recipes-extended/images/swupdate-image.inc +++ b/recipes-extended/images/swupdate-image.inc @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ libconfig \ swupdate \ swupdate-www \ - ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ + ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit swupdate-progress-sysvinit', d)} \ util-linux-sfdisk \ " diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index 0d382bd..e5ff392 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -36,6 +36,7 @@ PACKAGES =+ " \ ${PN}-client \ ${PN}-lua \ ${PN}-progress \ + ${PN}-progress-sysvinit \ ${PN}-tools \ ${PN}-tools-hawkbit \ ${PN}-usb \ @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" FILES_${PN}-progress = " \ ${bindir}/swupdate-progress \ ${systemd_system_unitdir}/swupdate-progress.service \ - ${libdir}/swupdate/conf.d/90-start-progress \ " +FILES_${PN}-progress-sysvinit = "${libdir}/swupdate/conf.d/90-start-progress" + FILES_${PN}-usb = " \ ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ ${systemd_system_unitdir}/swupdate-usb@.service \ @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ " RDEPENDS_${PN}-usb += "${PN}-client" +RDEPENDS_${PN}-progress += "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" # The tools package is deprecated, it is an empty meta package for backward compatibility RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \ @@ -255,10 +258,10 @@ do_install () { install -m 0644 ${WORKDIR}/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/ - else - # in case of systemd there is a service file, for sysv init we need to start it as well - install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/ fi + + # in case of systemd there is a service file, for sysv init we need to start it as well + install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/ } INITSCRIPT_NAME = "swupdate"