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 0D788C433FE for ; Mon, 10 Oct 2022 20:01:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 67C9B84F06; Mon, 10 Oct 2022 22:01:09 +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="mi004JJx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9CF8F84F03; Mon, 10 Oct 2022 22:00:55 +0200 (CEST) Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 728D384EF6 for ; Mon, 10 Oct 2022 22:00:50 +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-il1-x130.google.com with SMTP id y17so6152941ilq.8 for ; Mon, 10 Oct 2022 13:00:50 -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=PSaD4B/T3OJ9cdzlT42JF5cLotKHChSzdZQwiOyGDyY=; b=mi004JJxFdKibKIJ8xTtkMcnQ0gXt0y/5PZGekE3VYTCcB4J6OVgOVUOvIsq5IZQh9 9m1LC1MaSAZFIF+RdLA/Tria2VF6Zyie63b8TIdeB63qbK3nWly1bsLTTEAHa3pbTOtl jd33Q0hjWsJpanFN1xmRyMq0pwISo0lLy0jOs= 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=PSaD4B/T3OJ9cdzlT42JF5cLotKHChSzdZQwiOyGDyY=; b=CMBmLsvHlkAXYanUeBrh4cnl6TgZb1IGo0f0p4zpF0uCqCHCrTOePb0IhErsixbZJG kFGlUdsPVhAjlr4dm/Hmfejakgk6EdG21xpQbep56AjkE5D+s9FO/uB0OXuzWYI46NQm sXZTnASJLNhk7xxtNX8lXMrjvFRktmqD1818TNuCq+iK8GakcC8K6kfRpiXVG7KGGIqo jgo2Quc30bTfaXT0LYSf/Ql6JddOsEMjOYurSxpJy+jRRy+PWbRlqcyJu4YpFohvs7Ae 3eoybFfsP+NgfLs/+xiuyYa9LNGVxujYD1bluiqeETQXvzXdvYSG1paS35sGMlInJKnU KLkQ== X-Gm-Message-State: ACrzQf10B2KofY8Mqpuo1EXLzzjXB6XF05boczJSpUYdG7ScDoIz9298 IFqulYoeBFqv4LQqp85mNQivfmpI/t4zOg== X-Google-Smtp-Source: AMsMyM7NP87yzTKl7fVsubCvJiDgWcT29imx+q61d7Cj6m1FNSBlsbTE/DGxyVvtz4uPSxbRyjFN6Q== X-Received: by 2002:a05:6e02:1a06:b0:2fa:5239:c678 with SMTP id s6-20020a056e021a0600b002fa5239c678mr10046050ild.45.1665432048592; Mon, 10 Oct 2022 13:00:48 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:295e:d074:1d59:53b1]) by smtp.gmail.com with ESMTPSA id z18-20020a926512000000b002f5024d8543sm4157717ilb.38.2022.10.10.13.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 13:00:48 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Rasmus Villemoes , Tom Rini , Simon Glass , Alper Nebi Yasak Subject: [PATCH 4/5] binman: Use an exit code when blobs are missing Date: Mon, 10 Oct 2022 14:00:31 -0600 Message-Id: <20221010200032.73483-5-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc2.412.g84df46c1b4-goog In-Reply-To: <20221010200032.73483-1-sjg@chromium.org> References: <20221010200032.73483-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 --- tools/binman/binman.rst | 4 ++++ tools/binman/cmdline.py | 3 +++ tools/binman/control.py | 7 ++++++- 3 files changed, 13 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..119b1176b7a 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -742,7 +742,12 @@ def Binman(args): elf.UpdateFile(*elf_params, data) if invalid: - tout.warning("\nSome images are invalid") + msg = '\nSome images are invalid' + if args.ignore_missing_blobs: + tout.warning(msg) + else: + tout.error("\nSome images are invalid") + return 103 # Use this to debug the time take to pack the image #state.TimingShow() -- 2.38.0.rc2.412.g84df46c1b4-goog