From patchwork Sat Aug 24 13:23:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152620 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="EEpHe65x"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzjv34W8z9s7T for ; Sat, 24 Aug 2019 23:33:23 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 260A2C21D8E; Sat, 24 Aug 2019 13:31:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6D533C21DE8; Sat, 24 Aug 2019 13:29:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 00B03C21E35; Sat, 24 Aug 2019 13:28:00 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by lists.denx.de (Postfix) with ESMTPS id 740ACC21DD4 for ; Sat, 24 Aug 2019 13:27:57 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id j5so26655280ioj.8 for ; Sat, 24 Aug 2019 06:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x510gcJBvDIXIPPumxPz9wM23L7i7WzZ7ypnp6GGVuU=; b=EEpHe65xgaHrGJC2Pz4WLHYkNBPZuvJfeTdeqWWTQIFGtToNqk5Z6tY4X4U2lvwbXg aOF4G689eXSNsOarCu1azp8m5Aq2ITiespzrH/QfKjCbS6EHwX9QXB4U9f8j/9WwylIt lzyYZKBtY/URA6XLoiyNuK3pSHhFL65O+md40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x510gcJBvDIXIPPumxPz9wM23L7i7WzZ7ypnp6GGVuU=; b=p3rC08MoQV+PbZeyxlqtZRjUUd7Y6vW/tV7KSd5dWNH/WoJFNn5xuKLqmfpSM2/ECn 7vzcjDcnbQjmNqGVJ+O87eag2SYS0l8O95hU+7Sl5rkyHgsOjZFxOTcRHAZO4w7oyb7K 5P/+W75uniXkkpjo8khF5eyk9wvhH/r6ryngUEdyTURpev24fUhfVv6puU/BYk2mk7Qb Yx3UR94XeyldMeLtdXKRhoCdJ3J8teUzb5xzmTxPWEY5+2CCO6o4pYNONB3pBSdCwN/y 1m0yH8Zw7EgqA/xgxyXTcFbEYZ64NygMkNYiML/nKWnY+d4SS+tD7gru0j9SvzJm4LpK P96w== X-Gm-Message-State: APjAAAV8SqfyVCD/LQseH7TsPBU6gvhlxyrmCoPuEntFkaAYsqeLjSI1 fx3S2G1huxNU6zHO1sw0PBJN4V8iBy0= X-Google-Smtp-Source: APXvYqzC4NBCp+NtOHLUODMgbmAAYkRttD1P7GpR/ogIRWeVY16uTAgne97PyWRx+TZV1twTWMvO/w== X-Received: by 2002:a05:6638:a12:: with SMTP id 18mr4729985jan.123.1566653276262; Sat, 24 Aug 2019 06:27:56 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:56 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:10 -0600 Message-Id: <20190824132315.53130-31-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 30/34] binman: Update IFWI entry to support updates X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add support for the ProcessContents() method in this entry so that it is possible to support entries which change after initial creation. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/intel_ifwi.py | 46 +++++++++++++++++++------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index ef2b35706f..17792defe9 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -53,22 +53,8 @@ class Entry_intel_ifwi(Entry_blob): self._ReadSubnodes() Entry_blob.ReadNode(self) - def ObtainContents(self): - """Get the contects for the IFWI - - Unfortunately we cannot create anything from scratch here, as Intel has - tools which create precursor binaries with lots of data and settings, - and these are not incorporated into binman. - - The first step is to get a file in the IFWI format. This is either - supplied directly or is extracted from a fitimage using the 'create' - subcommand. - - After that we delete the OBBP sub-partition and add each of the files - that we want in the IFWI file, one for each sub-entry of the IWFI node. - """ - self._pathname = tools.GetInputFilename(self._filename) - + def _BuildIfwi(self): + """Build the contents of the IFWI and write it to the 'data' property""" # Create the IFWI file if needed if self._convert_fit: inname = self._pathname @@ -85,8 +71,6 @@ class Entry_intel_ifwi(Entry_blob): for entry in self._ifwi_entries.values(): # First get the input data and put it in a file - if not entry.ObtainContents(): - return False data = entry.GetData() uniq = self.GetUniqueName() input_fname = tools.GetOutputFilename('input.%s' % uniq) @@ -99,6 +83,32 @@ class Entry_intel_ifwi(Entry_blob): self.ReadBlobContents() return True + def ObtainContents(self): + """Get the contects for the IFWI + + Unfortunately we cannot create anything from scratch here, as Intel has + tools which create precursor binaries with lots of data and settings, + and these are not incorporated into binman. + + The first step is to get a file in the IFWI format. This is either + supplied directly or is extracted from a fitimage using the 'create' + subcommand. + + After that we delete the OBBP sub-partition and add each of the files + that we want in the IFWI file, one for each sub-entry of the IWFI node. + """ + self._pathname = tools.GetInputFilename(self._filename) + for entry in self._ifwi_entries.values(): + if not entry.ObtainContents(): + return False + return self._BuildIfwi() + + def ProcessContents(self): + orig_data = self.data + self._BuildIfwi() + same = orig_data == self.data + return same + def _ReadSubnodes(self): """Read the subnodes to find out what should go in this IFWI""" for node in self._node.subnodes: