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 566BCC433EF for ; Fri, 5 Nov 2021 02:05:23 +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 C331D60E97 for ; Fri, 5 Nov 2021 02:05:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C331D60E97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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 B4E9B8373C; Fri, 5 Nov 2021 03:04:22 +0100 (CET) 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="V6NbOQfg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 95B2283704; Fri, 5 Nov 2021 03:03:29 +0100 (CET) Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (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 5614683709 for ; Fri, 5 Nov 2021 03:02:59 +0100 (CET) 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@google.com Received: by mail-ot1-x334.google.com with SMTP id r10-20020a056830448a00b0055ac7767f5eso10969467otv.3 for ; Thu, 04 Nov 2021 19:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YPSpvKZS7OA1BW4Y6TgfwcBKKeZa/BOCogjpV5U6Ey0=; b=V6NbOQfgMhe9SIxj8T7dMd6bkaKRdkllW7WgcS/Ng1XXLM/4CgBMQHUdrO2W+qEQ8p khDA/eMwMnqtinvd2k22ttYnzGlyip7quLrhQpjP6F3ZsSn+f9vxHscl9aNBCJrHyPu4 c1xmu5ZHQjDAj/cqbLyWIQrPsBhOXwBU6PZzY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YPSpvKZS7OA1BW4Y6TgfwcBKKeZa/BOCogjpV5U6Ey0=; b=owzlnPXlL6SFPI3NQYIg8mm6PQ/yNHwbie/iXyy894jtw5mrwuNY0PJALdCAuRZiMK iHWlYhru7bYBD7hvRm2ZXk5JQrygStqyMpEpgIkR47AdpvIIXAkAjUglMjAGSU1K6bYj BqqSpWDrDInKY58vYde08jrrSLMpuN2uJWYSSFdygoSRilK3JXIdmH6Rg7d6K4wd4kXS zs9nek3JzOTJV5mPsptgo8O9kD1tGRx0+vzo6fT2PxUderasNDatkrz2k1nVaiiOB3LQ 4yax+MJaWZugriGxJHOu7wIQMJUtM3FbSNyNlk+nGg1BqQs5JYXheSjIZNWUL16h1H3J U+fw== X-Gm-Message-State: AOAM533Wd6oAwezA0HkBcZkBiuApJcgKER7BC3MpU1AhEyVV3I3s5qSh b6KvwHJQhodioJUcTZIfo0GUQM5cFRJqMa8lDz22oA== X-Google-Smtp-Source: ABdhPJzzpjr2sFbAqvjwfORbKNLoNyp3NsTG+gC/pAWYBWaD6qbtzBh3/9mIEGkxwbGtJYm/VTgUs9JfntQbf137luk= X-Received: by 2002:a9d:37e3:: with SMTP id x90mr35575723otb.11.1636077777669; Thu, 04 Nov 2021 19:02:57 -0700 (PDT) MIME-Version: 1.0 References: <20211104185231.2927-1-heiko.thiery@gmail.com> <20211104185231.2927-3-heiko.thiery@gmail.com> In-Reply-To: <20211104185231.2927-3-heiko.thiery@gmail.com> From: Simon Glass Date: Thu, 4 Nov 2021 20:02:43 -0600 Message-ID: Subject: Re: [RFC 2/2] binman: catch RunException for mkimage runtime failure To: Heiko Thiery Cc: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam , Michael Walle Content-Type: text/plain; charset="UTF-8" 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 Hi Heiko, On Thu, 4 Nov 2021 at 12:53, Heiko Thiery wrote: > > 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(-) Somehow we need to record that it failed, at least. > > 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 > Regards, SImon