Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 676A7C433F5 for ; Sun, 27 Mar 2022 15:32:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C3ACC8393B; Sun, 27 Mar 2022 17:32:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Yjkat8mU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0CB983937; Sun, 27 Mar 2022 17:32:09 +0200 (CEST) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8A87180F68 for ; Sun, 27 Mar 2022 17:32:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ed1-x532.google.com with SMTP id h4so6566276edr.3 for ; Sun, 27 Mar 2022 08:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JR/lS/U0IfElViZB1I3gX/DTDM3isTU3hM0XcAeX1pw=; b=Yjkat8mU8lChd+RPu3AzQyVfftkwo6yXSI4YnMG0YL90yBPB0Jgm4psV7lV1wCHHBz d+g/AsuKIFtC5MKGV/mrEi3L1lyfMGf3uTPvF1vFeJMwunORQe4pQIfGot3ADkAsxhcp 1AMMMxcjOyqhpa4mClSXxmppfjLmw+cUs+DHZ6Bo7svA5VuSME9Av1H7xqE+HZVNgzca f64i0Yy/T7p5jITFYSl7ObCH93cYM3oPj++jhbAHLgf19b9WBMJcTyARSQpqfUuPcer5 iU0mh1uiVwS87ODZXUcVTmFJijTqcVQMq+VaAqiVn2g0c+feYf0uhRPd8UMVvxkkvHhX P8Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JR/lS/U0IfElViZB1I3gX/DTDM3isTU3hM0XcAeX1pw=; b=dj9OIE9C8SzoXTtSnCz7BOWRcMM6aafCRtCzqdLUrIY+J1Ty93QhPeabjBc9qooKSx 6vY3iO0EwEVaBoi9LmQNzSl4udoKdHqSf2XVK85wyqTRMohiRGfgM4eJO0bbuXCvDoyx IGO+hpa3x2xMHSXeQg7ZlxwDYjPW0QMewJHEdtMq93fKUpB7RDx8l/YJdJZSVxUXGQT9 B/hbuYA38T85RKG6BQhUO9kXknyP6dCW6GtaG3Tf3f9axzvrL7zeCTk7+VJ6GrBN5Top oRnAiX2EsOCOOo3zquBHVRWltvN/3YfIyTXYEGYX3Fcqe91AVpLL4z1zYvRh/Riqw7D7 4ajA== X-Gm-Message-State: AOAM530NHHLubMbObPO4WdmkK8d5CR6t3eqjSQU84IR1LST6PegLVDYV eJBcb69nM/9jospDjshl8XZ2QIIdIcY= X-Google-Smtp-Source: ABdhPJxUBrgXwgorX/eIdu8Ut57NSVFFecE0gRTfbD4a7SEP51O4cWxBfXSNhRPd0GqkJT3pD7OkxQ== X-Received: by 2002:a05:6402:278d:b0:419:3794:de39 with SMTP id b13-20020a056402278d00b004193794de39mr10920708ede.137.1648395126032; Sun, 27 Mar 2022 08:32:06 -0700 (PDT) Received: from localhost.localdomain ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id jg22-20020a170907971600b006df9ff416ccsm4639763ejc.137.2022.03.27.08.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 08:32:05 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Simon Glass , Heiko Thiery , Jan Kiszka , Alper Nebi Yasak Subject: [PATCH 0/7] binman: Fix replacing FIT subentries Date: Sun, 27 Mar 2022 18:31:43 +0300 Message-Id: <20220327153151.15912-1-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Converting the binman FIT entry type to a section ended up breaking the ability to replace these in images. The conversion to section partially enables extracting and replacing the subentries, but that also doesn't work as intended. This series gets binman to a point where it can extract FIT subentries and replace their non-section leaf entries correctly. Replacing sections of any kind doesn't really work right now, so the final patch disables that by raising an error. Initially, I had managed to replace sections by propagating changes in ProcessContentsUpdate() to the child entries, but writing arbitrary data into entries representing data in a certain format quickly gets into weird (maybe even undecidable?) edge cases. Just recently I had a better idea. Instead of writing incompatible data into a section, we can replace the section entry/node with for example a blob-ext entry/node for the input file. I've got this working as a proof of concept, but I need to experiment more to see what works best. Alper Nebi Yasak (7): binman: Fix unique names having '/.' for images read from files binman: Collect bintools for images when replacing entries binman: Don't reset offset/size if image doesn't allow repacking binman: Remove '/images/' fragment from FIT subentry paths binman: Create FIT subentries in the FIT section, not its parent binman: Test replacing non-section entries in FIT subsections binman: Refuse to replace sections for now tools/binman/control.py | 3 +- tools/binman/entry.py | 2 +- tools/binman/etype/_testing.py | 36 ++++ tools/binman/etype/fit.py | 15 +- tools/binman/etype/section.py | 3 + tools/binman/ftest.py | 179 ++++++++++++++++++ tools/binman/test/230_unique_names.dts | 34 ++++ tools/binman/test/231_unique_names_multi.dts | 38 ++++ .../binman/test/232_replace_with_bintool.dts | 39 ++++ tools/binman/test/233_fit_extract_replace.dts | 74 ++++++++ .../test/234_replace_section_simple.dts | 23 +++ 11 files changed, 438 insertions(+), 8 deletions(-) create mode 100644 tools/binman/test/230_unique_names.dts create mode 100644 tools/binman/test/231_unique_names_multi.dts create mode 100644 tools/binman/test/232_replace_with_bintool.dts create mode 100644 tools/binman/test/233_fit_extract_replace.dts create mode 100644 tools/binman/test/234_replace_section_simple.dts -- 2.35.1