From patchwork Sat Jul 20 18:23:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1134456 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="ecdJDnFC"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45rcDP20ZBz9s4Y for ; Sun, 21 Jul 2019 04:42:13 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E50E0C21E16; Sat, 20 Jul 2019 18:29:40 +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 6C340C21E63; Sat, 20 Jul 2019 18:25:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 07C5CC21DB5; Sat, 20 Jul 2019 18:25:12 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id D584FC21DD9 for ; Sat, 20 Jul 2019 18:25:11 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id o9so65321360iom.3 for ; Sat, 20 Jul 2019 11:25:11 -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=iCYd2bEgvRTzbDVU0IWnIzK9EA+mkJcwa6fpwoZRyTk=; b=ecdJDnFCzIpPA+DX3vgBbf5BJvNyNepu9gx39dV/d9zHKSRPMexuvxCtCs1swhLdNV 905YCyGwq7JP7UrP40ksegsUAwBTN/tjq0jdYPhwhZWLfubt9NH/5udY/cvMvLgWqrTl GgyO7m3dNNE4SdEP6yOwk3XLFNTCVDkLwlOIw= 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=iCYd2bEgvRTzbDVU0IWnIzK9EA+mkJcwa6fpwoZRyTk=; b=bqoGam285MpNePXC5CTR5F9OC2Kcn0zAFCVAVtBY5FR/WFIi03z1ipdowgoX9u/qTZ vGnc7DOXYT6LF1slGpmY3XCiu62HiBn7gIfdrT2gxNM8cMO5RkDxfL9O5biMXJQWZY4P VPdBQ+QekSeAe8y2495lTrxF1KESynSO3N49pOCJi0pLWVuBrcLbXY83PUX7UUNXJhFW /MUQiqnDsOAScH3tx/4pPOHPp2zK0e9Y/XTkWPq3FE2KkiErktJwAO/BkvWlgm5y00Kc TvfsYD9ddVNll/Z+shohnxj+dqbcHHNtVDHCrpPCdjTGpS+ZK4NeWta+q8RAOWJRtzYf y7Mg== X-Gm-Message-State: APjAAAXfYHNhUg5+g1QQnD+AkJNECUTaPcjKRW26zf0qHAOqPf5VyTkt iwvgH6CJighasEO/Mm+oWvhMUcpwITs= X-Google-Smtp-Source: APXvYqxgIM4qRQmibyyiV0dqAy8+kE0dcuMKBRPkGX38p2Gms79Om9XOsTspqaDVJlE5EMXxZNURbg== X-Received: by 2002:a5e:9e03:: with SMTP id i3mr54366417ioq.66.1563647110747; Sat, 20 Jul 2019 11:25:10 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id z17sm49778933iol.73.2019.07.20.11.25.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 11:25:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 20 Jul 2019 12:23:41 -0600 Message-Id: <20190720182416.183626-20-sjg@chromium.org> X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog In-Reply-To: <20190720182416.183626-1-sjg@chromium.org> References: <20190720182416.183626-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 19/53] binman: Support loading entry data from a file 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" When modifying an image it is convenient to load the data from the file into each entry so that it can be reprocessed. Add a new LoadData() method to handle this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/entry.py | 5 +++++ tools/binman/etype/section.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tools/binman/entry.py b/tools/binman/entry.py index e3c64348225..6436384254d 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -695,3 +695,8 @@ features to produce new behaviours. (self.GetPath(), self.offset, self.offset + self.size, self.size, len(data))) return data[self.offset:self.offset + self.size] + + def LoadData(self, decomp=True): + data = self.ReadData(decomp) + self.ProcessContentsUpdate(data) + self.Detail('Loaded data size %x' % len(data)) diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index f29784c1bbf..cd623821a34 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -462,3 +462,8 @@ class Entry_section(Entry): self.image_pos, None, self.offset, self) for entry in self._entries.values(): entry.ListEntries(entries, indent + 1) + + def LoadData(self, decomp=True): + for entry in self._entries.values(): + entry.LoadData(decomp) + self.Detail('Loaded data')