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 09030C433FE for ; Thu, 3 Nov 2022 21:26:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4B899850B6; Thu, 3 Nov 2022 22:26:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="fcd2knF2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BB906850BB; Thu, 3 Nov 2022 22:26:40 +0100 (CET) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 73DB485079 for ; Thu, 3 Nov 2022 22:26:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x734.google.com with SMTP id g10so2028546qkl.6 for ; Thu, 03 Nov 2022 14:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Zud1VzPxkdcxCD4rmqSYmWPfFRH8eGm9k2qLK7ivR+I=; b=fcd2knF232JCXJxt3QEMSfWU2MqHNgamWG+AdnfEGc1dNCEO/RpQex6yvgAlc6N5uU dKAOu9q14EuSdD39tAWFDhnOp4RJajpvN/tcD3WNZZkT01HQzpuJz8B12l6ne42RTxpD /GDyKNRfobnyWa81ODbomqgGPAZAvWEBzieMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Zud1VzPxkdcxCD4rmqSYmWPfFRH8eGm9k2qLK7ivR+I=; b=N5qsmL1TMjTZo7i9NoY9/aG1isC+YbTFCZhiu8T1tCwBXKsM5F8yfhVGKxN/yjeu1a SO/ZJ/msRA8XUHk6tzlqHF5E6bATQe4f7IAG2buP+xdAqcARj/YG0Q0VFZHRUNUEcD6s fDNFTx+X6DgCYMc4oIpcfW0N/AtK6e8orNrt1H2Jf1sk/4z0YVRstPkopbqCHT++SvBx 8cP0R0NoevHjF+txdgIQEM2rD6l4K0SPkGcTJwTvfur5YgVOe87mSeIbhBAZBpxWiwil 3+d/IYMF3mSQpoceEAqKMdcdF1PZaIEiT+EYiB4+BFF8h0xk0viWRD8b7K2BaO4mnuRj YpEQ== X-Gm-Message-State: ACrzQf0eP9HRPIma7ciwS0Z8fcDCulEx8kRMRpu7P+TCb7MgA9gN+TmU /jsF35BYPR963v9p2B8qdawOO0UaOsXYrg== X-Google-Smtp-Source: AMsMyM7hN+04b3aLS89sq96W9PcaTJHTMknkxDTbGGMDPGu0abmk94zFwENncjWarHw+VUvcBlci/Q== X-Received: by 2002:a05:620a:22e1:b0:6fa:46cc:8d84 with SMTP id p1-20020a05620a22e100b006fa46cc8d84mr13510079qki.10.1667510796227; Thu, 03 Nov 2022 14:26:36 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-994c-dfba-30d0-8ee5.res6.spectrum.com. [2603:6081:7b00:6400:994c:dfba:30d0:8ee5]) by smtp.gmail.com with ESMTPSA id x17-20020a05620a449100b006fa31bf2f3dsm1545626qkp.47.2022.11.03.14.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 14:26:35 -0700 (PDT) Date: Thu, 3 Nov 2022 17:26:33 -0400 From: Tom Rini To: Simon Glass Cc: Sean Anderson , u-boot@lists.denx.de, Rasmus Villemoes Subject: Re: [PATCH v2 4/4] cmd: source: Support specifying config name Message-ID: <20221103212633.GV2116612@bill-the-cat> References: <20221020192404.2500251-1-sean.anderson@seco.com> <20221020192404.2500251-5-sean.anderson@seco.com> <7825e209-c14d-74ff-4ebf-973d99f896fc@seco.com> <20221030143958.GF2116612@bill-the-cat> <20221031193718.GY2116612@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OxpcHoRZqvs6WvX3" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett 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 --OxpcHoRZqvs6WvX3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 03, 2022 at 02:46:35PM -0600, Simon Glass wrote: > Hi Tom, >=20 > On Mon, 31 Oct 2022 at 13:37, Tom Rini wrote: > > > > On Mon, Oct 31, 2022 at 01:27:08PM -0600, Simon Glass wrote: > > > Hi Tom, > > > > > > On Sun, 30 Oct 2022 at 08:40, Tom Rini wrote: > > > > > > > > On Sat, Oct 29, 2022 at 07:44:00PM -0600, Simon Glass wrote: > > > > > Hi Sean, > > > > > > > > > > On Fri, 21 Oct 2022 at 15:04, Sean Anderson wrote: > > > > > > > > > > > > On 10/21/22 4:17 PM, Simon Glass wrote: > > > > > > > On Thu, 20 Oct 2022 at 13:24, Sean Anderson wrote: > > > > > > >> > > > > > > >> As discussed previously [1,2], the source command is not saf= e to use with > > > > > > >> verified boot unless there is a key with required =3D "image= s" (which has its > > > > > > >> own problems). This is because if such a key is absent, sign= atures are > > > > > > >> verified but not required. It is assumed that configuration = nodes will > > > > > > >> provide the signature. Because the source command does not u= se > > > > > > >> configurations to determine the image to source, effectively= no > > > > > > >> verification takes place. > > > > > > >> > > > > > > >> To address this, allow specifying configuration nodes. We us= e the same > > > > > > >> syntax as the bootm command (helpfully provided for us by fi= t_parse_conf). > > > > > > >> By default, we first try the default config and then the def= ault image. To > > > > > > >> force using a config, # must be present in the command (e.g.= `source > > > > > > >> $loadaddr#my-conf`). For convenience, the config may be omit= ted, just like > > > > > > >> the address may be (e.g. `source \#`). This also works for i= mages > > > > > > >> (`source \:` behaves exactly like `source` currently does). > > > > > > >> > > > > > > >> [1] https://lore.kernel.org/u-boot/7d711133-d513-5bcb-52f2-a= 9dbaa9eeded@prevas.dk/ > > > > > > >> [2] https://lore.kernel.org/u-boot/042dcb34-f85f-351e-1b0e-5= 13f89005fdd@gmail.com/ > > > > > > >> > > > > > > >> Signed-off-by: Sean Anderson > > > > > > >> --- > > > > > > >> > > > > > > >> (no changes since v1) > > > > > > >> > > > > > > >> .../cmd_stm32prog/cmd_stm32prog.c | 2 +- > > > > > > >> boot/bootmeth_script.c | 2 +- > > > > > > >> cmd/source.c | 73 ++++++++= +++++------ > > > > > > >> doc/uImage.FIT/source_file_format.txt | 3 + > > > > > > >> drivers/usb/gadget/f_sdp.c | 2 +- > > > > > > >> include/image.h | 19 +++-- > > > > > > >> test/py/tests/test_source.py | 11 ++- > > > > > > >> 7 files changed, 82 insertions(+), 30 deletions(-) > > > > > > > > > > > > > > Reviewed-by: Simon Glass > > > > > > > > > > > > > > But please use single quotes in Python. Double quotes should = only be > > > > > > > used when the string includes single quotes. > > > > > > > > > > > > > > > > > > > Do we have a style guide for python? Judging by `git grep '"' '= **.py'`, > > > > > > double quoting is endemic. IMO single quotes should be used for > > > > > > identifiers (or things which would be enums in C), and double q= uotes > > > > > > elsewhere. But if you want to go the other way, perhaps add som= ething > > > > > > to checkpatch. > > > > > > > > > > Well we use PEP8, with single quotes used for nearly everything. = The > > > > > exceptions are the one I mentioned, and module/function comments. > > > > > > > > > > Do we use checkpatch for Python? > > > > > > > > Is there a standard python PEP8 checking tool? We should see if > > > > upstream is interested in a flag or similar to call another tool for > > > > python linting. > > > > > > Yes this is pylint and we do already use it, but not in patman so far. > > > It would be a good thing to add. > > > > I'd start by trying to put it in checkpatch.pl and seeing if upstream is > > interested, the kernel has a bunch of python tools too these days. >=20 > Oh dear that seems a bit tricky. Checkpatch does its own checking of C > patches. It would be better to just call pylint I think. Adding a call > to pylint from checkpatch seems odd, but perhaps it would fly? I don't > know how the output would work though. So I think adding to patman > makes more sense. Yes, sorry, I was suggesting that checkpatch.pl call out to pylint. I assumed it would be straightforward as it already calls out to other tools for things like SPDX tag checking.=20 --=20 Tom --OxpcHoRZqvs6WvX3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmNkMgkACgkQFHw5/5Y0 tyw3Pwv/Rw8Atj3OGwNIalk2OjTR26JHmKBqR7LvFwQr7CRWd8V1+eotwJgAYDRC y29r0SZTNoKJshvDxQITDSAndMOhhKB2qZh7QZUwnUGOfVYbW3MzLiw1G3XAWkA8 bf2D8aImADgz9HZdhUPzJG8r3CguC5yVIcQmm+i17huzH5NKOMyWRDT0ev78VzHa 9CAqBpi8ndlyn54pZldY6ZRWGU3z93Vt+TSk3pp1bKZ0svaPLQ3W6EmU5gZ/eKrV tJfSx8L3LF6PttESQ/Nrb66I2i9BMBN4rO6VcXjFgymdN7UhtNpH/UEUj/p38tQ0 tAwsAmMHNzUcCdPdna0ObilbZnXIZOVBusEQgIj7tZdQYmk94BsknWgruapMdkvT jzvPRvs1pgHvCnCrmXCbCYaMbLM/xHnCzi71/82PDqNxA4nbiFz5/mZNk0CgvzaF 8X7So+2Qc7CTioxatlqHyVTNDMqCzF1OivoASvZLnrNpHwmv25vpj522boPzXgDx QoQq09Hn =pRCd -----END PGP SIGNATURE----- --OxpcHoRZqvs6WvX3--