From patchwork Thu Jun 25 14:10:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 11625479 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F074917CB for ; Thu, 25 Jun 2020 14:10:22 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA91A20702 for ; Thu, 25 Jun 2020 14:10:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.cip-project.org header.i=@lists.cip-project.org header.b="F3X1w9Lp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA91A20702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=siemens.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+64572+4828+4520428+8129116@lists.cip-project.org X-Received: by 127.0.0.2 with SMTP id BYHxYY4521763x49d2I1DEBb; Thu, 25 Jun 2020 07:10:22 -0700 X-Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by mx.groups.io with SMTP id smtpd.web11.11425.1593094221016138583 for ; Thu, 25 Jun 2020 07:10:21 -0700 X-Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 05PEAJNt021321 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 25 Jun 2020 16:10:19 +0200 X-Received: from md2dvrtc.ad001.siemens.net ([167.87.6.122]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 05PEAFXZ000356; Thu, 25 Jun 2020 16:10:19 +0200 From: "Quirin Gylstorff" To: cip-dev@lists.cip-project.org, Jan.Kiszka@siemens.com Cc: Quirin Gylstorff Subject: [cip-dev] [isar-cip-core RFC 6/7] swupdate: Add luahandler for secureboot Date: Thu, 25 Jun 2020 16:10:14 +0200 Message-Id: <20200625141015.31719-7-Quirin.Gylstorff@siemens.com> In-Reply-To: <20200625141015.31719-1-Quirin.Gylstorff@siemens.com> References: <20200625141015.31719-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: cip-dev@lists.cip-project.org List-Id: Mailing-List: list cip-dev@lists.cip-project.org; contact cip-dev+owner@lists.cip-project.org Delivered-To: mailing list cip-dev@lists.cip-project.org Reply-To: cip-dev@lists.cip-project.org X-Gm-Message-State: 4bOJQXzNr1MXVANeIhh0Gfshx4520428AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.cip-project.org; q=dns/txt; s=20140610; t=1593094222; bh=NkHItu3ARrqqzwP9oRir3Qp0rL0Newnr509TY8YflE0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=F3X1w9Lp9iDgDKglmaCkVY0Wcl1Zksl8SDUjDMOTRsip0S1JsS16GWydKQbiEYkeWDS jfTDOevqsbGHHl1nOG4CZTTfXg4XvwyAoiVto7xdrdsSXpf8irW9C4XJMJqdK9IehIZS0 yyZ91JQuydUOYkKEzkqtbjO1pBeToblkXFw= From: Quirin Gylstorff Signed-off-by: Quirin Gylstorff --- recipes-core/swupdate/files/swupdate_handlers.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes-core/swupdate/files/swupdate_handlers.lua b/recipes-core/swupdate/files/swupdate_handlers.lua index c9b9962..f2ecc54 100644 --- a/recipes-core/swupdate/files/swupdate_handlers.lua +++ b/recipes-core/swupdate/files/swupdate_handlers.lua @@ -311,8 +311,12 @@ function handler_roundrobin(image) if rootparam and rootdevice then break end end if not rootdevice then - swupdate.error("Cannot determine current root device.") - return 1 + -- Use findmnt to get the rootdev + rootdevice = io.popen('findmnt -nl / -o PARTUUID'):read("*l") + if not rootdevice then + swupdate.error("Cannot determine current root device.") + return 1 + end end swupdate.info(string.format("Current root device is: %s", rootdevice))