From mboxrd@z Thu Jan 1 00:00:00 1970 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 44F76C3F6B0 for ; Thu, 25 Aug 2022 01:27:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9D6DC84879; Thu, 25 Aug 2022 03:26:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JsCdRCgH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3CDAF84869; Thu, 25 Aug 2022 03:26:01 +0200 (CEST) Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) (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 0DE7084860 for ; Thu, 25 Aug 2022 03:25:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-oo1-xc31.google.com with SMTP id q6-20020a4aa886000000b0044b06d0c453so2586601oom.11 for ; Wed, 24 Aug 2022 18:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=yhHjgp0FsG5BnUDnZrcIHw9/oBbBjWhAzpFc2CNYheM=; b=JsCdRCgHJIb9CxWeODJ0L0hsbD3R8UlanNKCD0XeG0FtMZgsRJRZ/2Wr+/kG9lI5L+ aMHRuHID0hrxD/MIg0GRRhOuXHzJDW2wwJcQl8lq0cJcg2qq9+KVuE1LJGVJhxm4Rk+V V+5YOS1euZB05KywyHDK+xk26kYqAFRZtHIk8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=yhHjgp0FsG5BnUDnZrcIHw9/oBbBjWhAzpFc2CNYheM=; b=3ZNcUV3qgClBA3HgfTTEPse0iHKvPmo52iiduHysu3qI6VqJX3qCSUkW+jzYi7yIuN n2I/RU3sdNwchT8qxR+Us9Mb3IsK1PUehXl1+Cx5f3qt+ciJBZh+kjnRtXj6GSo35Kjk PkFkAFMdSqKir1wbVOEJAKTGchJcxa81ygaoFLL69D0qXAfWGReFEOpwEupZhP50AlBQ 0hWYmYaH3RrjNwPq8zBB0nHXZqfmHreyMMHHJaD9OquHOKnQEXNyk0SxPGBwlErb7zVq 7iK4NCzX4wgZgIFUGkWuZW1PBIOrsUoQQ6yV8jo53Ep4LbjBcugcpd+lEXcY92cGfIN1 fdww== X-Gm-Message-State: ACgBeo00m01ZoZVAeoGad48qexhiot28vtC7mg54ivjOg3xkwHa0KthR Q1v5PGGshBN2bl/Ce6dUUJUExpktpD7RmfWBMUVloA== X-Google-Smtp-Source: AA6agR4DoUmEeMZNZBctbVH6KNKemRQCzSGVnV2gV9WjRxURTZwt+RQr8Gsz03wQ4zs6kjAv09l1njYHGvG855HCGww= X-Received: by 2002:a05:6820:1888:b0:44b:3d1f:2850 with SMTP id bm8-20020a056820188800b0044b3d1f2850mr520278oob.39.1661390753254; Wed, 24 Aug 2022 18:25:53 -0700 (PDT) MIME-Version: 1.0 References: <20220803121906.2629478-1-foss+uboot@0leil.net> <20220803121906.2629478-2-foss+uboot@0leil.net> <83501d7a-f0e4-49df-6172-6c4ba33e6634@theobroma-systems.com> In-Reply-To: <83501d7a-f0e4-49df-6172-6c4ba33e6634@theobroma-systems.com> From: Simon Glass Date: Wed, 24 Aug 2022 18:25:37 -0700 Message-ID: Subject: Re: [PATCH v4 1/8] binman: add support for skipping file concatenation for mkimage To: Quentin Schulz Cc: Quentin Schulz , Bharat Gooty , Rayagonda Kokatanur , Philipp Tomsich , Kever Yang , Jagan Teki , Alper Nebi Yasak , Heinrich Schuchardt , Heiko Thiery , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Quentin, On Wed, 24 Aug 2022 at 09:29, Quentin Schulz wrote: > > Hi Simon, > > On 8/18/22 10:17, Simon Glass wrote: > > Hi Quentin, > > > > On Wed, 3 Aug 2022 at 06:19, Quentin Schulz wrote: > >> > >> From: Quentin Schulz > >> > >> Some image types handled by mkimage require the datafiles to be passed > >> independently (-d data1:data2) for specific handling of each. A > >> concatenation of datafiles prior to passing them to mkimage wouldn't > >> work. > >> > >> That is the case for rkspi for example which requires page alignment > >> and only writing 2KB every 4KB. > >> > >> This adds the ability to tell binman to pass the datafiles without > >> prior concatenation to mkimage, by adding the multiple-data-files > >> boolean property to the mkimage node. > >> > >> Cc: Quentin Schulz > >> Reviewed-by: Simon Glass > >> Signed-off-by: Quentin Schulz > >> --- > >> tools/binman/entries.rst | 22 +++++++++++++++++++ > >> tools/binman/etype/mkimage.py | 41 +++++++++++++++++++++++++++++++---- > >> 2 files changed, 59 insertions(+), 4 deletions(-) > > > > Somehow I missed this one, sorry. > > > > It needs a test (try 'binman test -T' to see that it breaks code coverage). > > > > How do you see this test being implemented? > > I think it'd be best to mock calls to mkimage (or > self.mkimage.run_cmd()) and check that the -d parameter has two entries > separated by a colon but my limited knowledge of unittest.mock does not > seem to guide me to the proper implementation. > > Another way would be to use a specific mkimage type that handles that > kind of multiple files -d parameter and outputs something more or less > reproducible, e.g. rkspi type. I don't like this too much even though > it's much easier because we're bound to this type and the image type > could change (I recall some endianness fixes a few months ago). > You should be able to call mkimage for real and check that it does the right thing by looking at the output, in a simple way. See for example testMkimage() and let me know if you need any other hints. Regards, Simon