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 791BEC352A1 for ; Tue, 6 Dec 2022 15:03:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFFF48547B; Tue, 6 Dec 2022 16:03:46 +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="GDmWlv3g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5295785488; Tue, 6 Dec 2022 16:03:45 +0100 (CET) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 5153485472 for ; Tue, 6 Dec 2022 16:03: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=trini@konsulko.com Received: by mail-wm1-x333.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso12878492wmo.1 for ; Tue, 06 Dec 2022 07:03:42 -0800 (PST) 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=USyc+gsupyyG+VFm/7H4BgbW6kEu504sB/XPZYfw/pA=; b=GDmWlv3gYuou3e5xlGxSCnXQcY7OJr1JAb601ucaoHeBe+NWLjH5Rq7+6VS74+vIgl ZNKeCbKIg3nDXYwGO+jvTsTR2FjSQRShpAjC97CSWsKShoCr5FExRaBiPkbRx2EeiCMG ChqS/6gGbWjnPl2elUG4x1g6pEA4H2noWQh40= 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=USyc+gsupyyG+VFm/7H4BgbW6kEu504sB/XPZYfw/pA=; b=M2z0zdwyY8yTpMqR74wG6U1h0mJ+Ywq35KW6ZnEqCWmsvvH8gR9Oxj/77CpNjq2WFF Rnj4x0+jlRuNuwdFvV9lsvspbB5yy98FlnkLBTTUiZZRiszG1vLU3GVoFzdHJLOyfJ88 3yVjyVCBy/IbZDm9X/0VCdlTt3hYKIfL5Yq0s3xS+8hqPW4tGz0I0k3nIh992/gE0d/f DzAmVHTiz3nr9EVQq4Eam03aZRRzcNuwlMOHO/8OvCWe4Ak4/5gKQBCeQjMpTn/tHn33 cPWjWnhkhSvAFlgBQEe96qfwf5ZIMi8ENSA437LO9UFJft2j97r2lKhzZBjleHbPyXqA aFtQ== X-Gm-Message-State: ANoB5plB7J3QwFSUWAl71aEKwW8ZlL/aJDgABf0BSa6EoGVnX5XnnS6K Vm1svB8+vevM7hpNq+yrBHvooQ== X-Google-Smtp-Source: AA0mqf6ah/2fSATV1dF4nB6Ut9hXxyHWXsRwugX65qGIRte0mYIp2/1vuVNLigiihOjLkXYMSNzTUA== X-Received: by 2002:a05:600c:4f48:b0:3cf:54f4:eea with SMTP id m8-20020a05600c4f4800b003cf54f40eeamr58406547wmq.105.1670339021630; Tue, 06 Dec 2022 07:03:41 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-40ab-ff29-04a6-7f8f.res6.spectrum.com. [2603:6081:7b00:6400:40ab:ff29:4a6:7f8f]) by smtp.gmail.com with ESMTPSA id d2-20020a5d4f82000000b002425dc49024sm6835945wru.43.2022.12.06.07.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 07:03:41 -0800 (PST) Date: Tue, 6 Dec 2022 10:03:37 -0500 From: Tom Rini To: Simon Glass Cc: u-boot@lists.denx.de, Peter Robinson Subject: Re: [PATCH] Makefile: With BINMAN_ALLOW_MISSING=1 don't error on missing Message-ID: <20221206150337.GK3787616@bill-the-cat> References: <20221206020336.315465-1-trini@konsulko.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="j2aF/mIQU1BZvQnT" 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 --j2aF/mIQU1BZvQnT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 06, 2022 at 03:36:49PM +1300, Simon Glass wrote: > Hi Tom, >=20 > On Tue, 6 Dec 2022 at 15:03, Tom Rini wrote: > > > > When the user builds with BINMAN_ALLOW_MISSING=3D1 they're explicitly > > setting the flag to allow for additional binaries to be missing and so > > have acknowledged the output might not work. In this case we want to > > default to not passing a non-zero exit code. > > > > Cc: Simon Glass > > Reported-by: Peter Robinson > > Signed-off-by: Tom Rini > > --- > > This passes CI as-is: > > https://source.denx.de/u-boot/u-boot/-/pipelines/14340 > > --- > > Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/Makefile b/Makefile > > index de5746399a63..03de1da1bfd0 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -1334,7 +1334,7 @@ cmd_binman =3D $(srctree)/tools/binman/binman $(i= f $(BINMAN_DEBUG),-D) \ > > --toolpath $(objtree)/tools \ > > $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ > > build -u -d u-boot.dtb -O . -m \ > > - $(if $(BINMAN_ALLOW_MISSING),--allow-missing --fake-ext= -blobs) \ > > + $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-m= issing) \ > > -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ > > -I arch/$(ARCH)/dts -a of-list=3D$(CONFIG_OF_LIST) \ > > $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ > > -- > > 2.25.1 > > >=20 > I believe we need the --fake-ext-blobs flag as well, since otherwise > boards which use tools (like mkimage) on things that don't exist will > not work. So, we need to list out all the use cases perhaps, as we had missed one before. In my mind we have: - Board requires 1 or more blobs, developer will be running this on hardware, expects output from U-Boot 'make' (or buildman) to boot. Blobs must be present or non-zero exist status by default. We didn't have this before, and we do now. - Board requires 1 or more blobs AND has optional blobs, will be running this on hardware, expects output from U-Boot 'make' (or buildman) to boot. This is the case we had missed before as allwinner requires bl31 and has optional PMIC firmware. This is the case Peter reported and we had missed before, which this patch allows for, with the caveat that if you forget BL31 you're not going to boot and make won't complain exit-code wise. Another way to resolve this would be a property in the binman node to mark a blob as optional and warn if missing, rather than error if missing. - Board requires 1 or more blobs, output will NOT be run. This is the CI case and the compile testing lots of board cases. This is what CI passes still, with the above. - Board requires 1 or more blobs, developer will be running this on hardware, BUT will be injecting the blobs later on. I think this is the use case you're talking about? > Yes I know this passes on CI, but it will cause breakages when people > use mkimage or other things which have missing inputs. It will be > quite confusing too! >=20 > As to the logic, I thought you had wanted the build to fail if there > are missing blobs, regardless of whether they were allowed or not. > There is currently code in buildman to detect this failure and either > report it or ignore it: >=20 > if (result.return_code =3D=3D 2 and > ('Some images are invalid' in result.stderr)): > # This is handled later by the check for output in > # stderr > result.return_code =3D 0 >=20 > Since buildman sets BINMAN_ALLOW_MISSING=3D1 if -M is given, we will not > be able to detect missing binaries at all when built from buildman. I > think a suitable fix would be to update the code above to detect the > 'Some images are invalid' regardless of the return code. Well, what we designed here first missed how the allwinner case is used by Fedora. That needs both a zero exit code and allowing what turns out to be an optional blob to be missing. --=20 Tom --j2aF/mIQU1BZvQnT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmOPWb8ACgkQFHw5/5Y0 tyy6+gv/WZxUdc15PRBOdheZ64UbqRKC6egk145CIxNds8dqYDza9gbY04vTh2gt ymWPW+BgY+Q1/whbYlCcGPf8CDTgJ24WxjApEL0QQYBmCaDdbUy3mtVU4s7odb0x GvaZdNCFAH0w6an0RkPRgE1prtmJqMUYJ/ns1JgG2/KEqbemHBmwLWKdxvqlwiwr j0xNgnOVmE5mgFE6M8zWb5B28O2tN2SMaISofmbe7VQ5VgnphUWe6rchIGGxUF0w OB5rCwPGZueW6LcSZoEOdLPZGY2qsriq/dpGEbjR1wpfbIfzs5N4+7lfOW6KQsgj GSPhMT1gpK1NqPxdKu/wvQsAlrDOj2p17Jd+HBwrs0wYroPlH0rfP7396P3vM3VI 6KWQiZyzC5dg+D/RE13K720N4P8CrGFVSuZ7A22B/ucB355C2taFXSm2HuD7xmLd yLZj10X9H8Q/iUbDiy/66XDZ5VgfdTYJqgd6/dUG3ElNJYoA5Bz+VPa1xyVMep85 iW4n+EbJ =+8ND -----END PGP SIGNATURE----- --j2aF/mIQU1BZvQnT--