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 60857C433FE for ; Tue, 11 Oct 2022 14:16:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 391C684F1B; Tue, 11 Oct 2022 16:16:29 +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="k2ffbUER"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3E6E84F0F; Tue, 11 Oct 2022 16:16:05 +0200 (CEST) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 B002784EFB for ; Tue, 11 Oct 2022 16:15:57 +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@chromium.org Received: by mail-io1-xd34.google.com with SMTP id 137so6676448iou.9 for ; Tue, 11 Oct 2022 07:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8EjjTcLGwHOdr2YSkRGf20PgtZJMIPWYy6aC3YSlAkw=; b=k2ffbUERcAuNW3+AX/nCMExpvcsSPdDKahha7bjUyTxpjjox3HG6IK6jXx570duKpP un6kS/l8pSVwMxHfKi7GoCpDoJgv0AyLTxFQo5IE0+JypNOTDLVrZSoL4X77gVyGAymr o42r/lCbscH/dkvGsCUYxx0LNGZ3tIlDXTFEM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8EjjTcLGwHOdr2YSkRGf20PgtZJMIPWYy6aC3YSlAkw=; b=u+ION5Z3NjGVQPsXG+0ig/cqTfPIdCOv8iimU11Pr2SX9l4wRogDUJcWeOAk881BZN QVnsY9nLEISctwiI5XUXI7Ne9EDEWZC2vG5EX5LvGCgXSp+mrr0o1395DCAqCpDeGbp4 yhwtDgU2mMFEawM3zpZZBOHM5mep8Yyh/Z1nTT9eruY9t3w3fTgn2iXSZUIpAhE4bQAu H3ridf0psstPOXU2uYJZJDBi7YGG9KmgIZthfttvStG4PuMYDC20soATo3mFkHejBcxN EySHxHjYgajM32+LRlG9k+7yB1nJLTgnhUdAfqvhGIqod9AbHo1eL652vYdnhHlfAY1I zuFg== X-Gm-Message-State: ACrzQf3+DCWZOJAby9zYbMioPB4Dgb0xmjyGVrBGCQX1zOzzw8Z1iuBp cOOsrsw5HEToCPjTvTOXJZVHsHDm6S/P8Q== X-Google-Smtp-Source: AMsMyM7uSTh7NlryxmvCEo3BXLsX46u8i2HVcYwhQDe90tETU8zZoodOrxwppO9zgYZlmp2Cv3fQcw== X-Received: by 2002:a05:6602:2d55:b0:6a4:a04c:5c9e with SMTP id d21-20020a0566022d5500b006a4a04c5c9emr11596290iow.7.1665497755840; Tue, 11 Oct 2022 07:15:55 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id o42-20020a02742a000000b0035a9b0050easm5235155jac.18.2022.10.11.07.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 07:15:55 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Quentin Schulz , Rasmus Villemoes , Tom Rini , Simon Glass , Alper Nebi Yasak Subject: [PATCH v2 4/5] binman: Use an exit code when blobs are missing Date: Tue, 11 Oct 2022 08:15:40 -0600 Message-Id: <20221011141541.538175-5-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20221011141541.538175-1-sjg@chromium.org> References: <20221011141541.538175-1-sjg@chromium.org> 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.6 at phobos.denx.de X-Virus-Status: Clean At present binman returns success when told to handle missing blobs. This is confusing this in fact the resulting image cannot work. Use exit code 103 to signal this problem, with a -W option to convert it to a warning. Signed-off-by: Simon Glass --- Changes in v2: - Fix missing usage of the msg variable - Simplify code to remove the 'else' tools/binman/binman.rst | 4 ++++ tools/binman/cmdline.py | 3 +++ tools/binman/control.py | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst index 4ee6f41f35e..c0512e68e67 100644 --- a/tools/binman/binman.rst +++ b/tools/binman/binman.rst @@ -1458,6 +1458,10 @@ space-separated list of directories to search for binary blobs:: odroid-c4/build/board/hardkernel/odroidc4/firmware \ odroid-c4/build/scp_task" binman ... +Note that binman fails with error code 103 when there are missing blobs. If you +wish to continue anyway, you can pass `-W` to binman. + + Code coverage ------------- diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index 1d1ca43993d..144c0c916a2 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -128,6 +128,9 @@ controlled by a description in the board device tree.''' default=False, help='Update the binman node with offset/size info') build_parser.add_argument('--update-fdt-in-elf', type=str, help='Update an ELF file with the output dtb: infile,outfile,begin_sym,end_sym') + build_parser.add_argument( + '-W', '--ignore-missing-blobs', action='store_true', default=False, + help='Return success even if there are missing blobs') subparsers.add_parser( 'bintool-docs', help='Write out bintool documentation (see bintool.rst)') diff --git a/tools/binman/control.py b/tools/binman/control.py index bfe63a15204..da52abad077 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -742,7 +742,11 @@ def Binman(args): elf.UpdateFile(*elf_params, data) if invalid: - tout.warning("\nSome images are invalid") + msg = '\nSome images are invalid' + if not args.ignore_missing_blobs: + tout.error(msg) + return 103 + tout.warning(msg) # Use this to debug the time take to pack the image #state.TimingShow() -- 2.38.0.rc1.362.ged0d419d3c-goog