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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB3F9C433F5 for ; Thu, 4 Nov 2021 18:53:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C56016112E for ; Thu, 4 Nov 2021 18:53:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C56016112E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 08A73836BE; Thu, 4 Nov 2021 19:53:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="B2crp9C7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 45C2C836C0; Thu, 4 Nov 2021 19:53:19 +0100 (CET) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (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 31F80836C5 for ; Thu, 4 Nov 2021 19:53:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heiko.thiery@gmail.com Received: by mail-wm1-x336.google.com with SMTP id c71-20020a1c9a4a000000b0032cdcc8cbafso4953066wme.3 for ; Thu, 04 Nov 2021 11:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1cxuAifzeyz+xGvS1OarXdATwnlQk+Lk5b5fuSjfrPI=; b=B2crp9C7ceU4bCjRJ9IJ7MLvnzpebUCatB41ilHULYYiwuHOwbv1J3ePiKsZOBPcGy jPfTqX/mbPZtYIsXjHd6jGThvhUNTwDe6ANGgou9BjyzVa8FIa4Z069TtFIP6AGnYrUY XYSlG2ZNGvePf/2ykeji/6zTp3OXy8qObAbpvS+8s2MxdCnQr2Q0GOoTolabbqEX9Ipd y/grNywe5Ws1Z+fGCRbNIrw1ayMt5SC9QqH3KTVs7fpS0argaLX2Xkj2SHZrVhiwjzyL R6tGGzcp2nfHNnotOu66Txt+oQz52IVCKAD9xFdtbUgJZjGRR16nnUf3N8z5PCN7vkYZ CVYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1cxuAifzeyz+xGvS1OarXdATwnlQk+Lk5b5fuSjfrPI=; b=csH5lyms438DfPcBCSnyX8gI8Y337pYZu/GneCmJAqty8W3HQKQ6exOGLlF4y2Aqt0 9Wrj4IrVqOzaejmDkMhbXf+FPevAjQ4XcgnKD3/bbJTwa59NX7OCAjiFHzhL0aQMD49L nPn17M8sNhZ9nwLtLwi7+lWvQqKIP5pfBGo2rn/E/RB6PAnRlFJYt0+L2ijBkYLoIfrn uVaXbZ+C7G1EDO6XeLn6zvgLX/HPTp25sZXHbfpE3SYswktLyVatxxgDCXTyhlJmyOfm nHQlct93jXY6OMbqjTvPkz1qrNdyIbBKZLpDo0vkMmZBF8xtfSXrRuD0/6MrIuUKM0Ea yCTQ== X-Gm-Message-State: AOAM530qlHgUJ9d0QlcxYZLolHmujpU280iG6pau3jb81aP8qXCohQcL 1xbB/ecMCDZ7kPi64hfQWwy6+dPj0o8= X-Google-Smtp-Source: ABdhPJx8Jn43iURmvFeUz9ygog1s8Y2VPAJQD6l1WnlTcaOWMFUcbfCm3i6m9JUp49YWjUkfRj2duw== X-Received: by 2002:a1c:7ed3:: with SMTP id z202mr24859721wmc.110.1636051993184; Thu, 04 Nov 2021 11:53:13 -0700 (PDT) Received: from hthiery.fritz.box ([2a02:810c:8d40:ec0:8e16:45ff:fe22:ad85]) by smtp.gmail.com with ESMTPSA id l15sm1779829wme.47.2021.11.04.11.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 11:53:12 -0700 (PDT) From: Heiko Thiery To: u-boot@lists.denx.de Cc: Stefano Babic , Fabio Estevam , Michael Walle , Simon Glass , Heiko Thiery Subject: [RFC 2/2] binman: catch RunException for mkimage runtime failure Date: Thu, 4 Nov 2021 19:52:34 +0100 Message-Id: <20211104185231.2927-3-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211104185231.2927-1-heiko.thiery@gmail.com> References: <20211104185231.2927-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean In case mkimage exits with a return code other than zero do not stop. Print an error message and go on. Signed-off-by: Heiko Thiery --- tools/binman/etype/mkimage.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py index e49977522e..24fbe79172 100644 --- a/tools/binman/etype/mkimage.py +++ b/tools/binman/etype/mkimage.py @@ -10,6 +10,7 @@ from collections import OrderedDict from binman.entry import Entry from dtoc import fdt_util from patman import tools +from patman import tout class Entry_mkimage(Entry): """Binary produced by mkimage @@ -51,7 +52,12 @@ class Entry_mkimage(Entry): input_fname = tools.GetOutputFilename('mkimage.%s' % uniq) tools.WriteFile(input_fname, data) output_fname = tools.GetOutputFilename('mkimage-out.%s' % uniq) - tools.Run('mkimage', '-d', input_fname, *self._args, output_fname) + + try: + tools.Run('mkimage', '-d', input_fname, *self._args, output_fname) + except Exception as e: + tout.Error("mkimage failed: %s" % e) + self.SetContents(tools.ReadFile(output_fname)) return True -- 2.30.2