From patchwork Mon May 31 07:04:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Liu X-Patchwork-Id: 1485575 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Y3bRhO00; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FtmWx0Tpnz9sRN for ; Mon, 31 May 2021 17:05:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F9AA82B1C; Mon, 31 May 2021 09:05:00 +0200 (CEST) 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="Y3bRhO00"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 48C1D82B3D; Mon, 31 May 2021 09:04:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (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 9845F81019 for ; Mon, 31 May 2021 09:04:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=liu.ming50@gmail.com Received: by mail-lf1-x136.google.com with SMTP id f11so6516687lfq.4 for ; Mon, 31 May 2021 00:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yF10T1un/KZQW6woSWqGuy1mX4kFECkAeSrxLlc4k9Y=; b=Y3bRhO00iz4e+jJ7xpLiMJhr3Z2WwtmwRvwfDHWFj/ALCjIHdvLmQaHIqDLm/IT5GC AWKlT2FNkfhe7JtxgaihXq9Qk4PhODsCLUrXPjNKj/M+nCHNt+z6VkR0laZzY2LbEVh6 CDcrmscL8moUYXC0a83agGARryDrSqJ0pcsGMi0Gg8Z1uKKDIotKCpea7bO9sfEYDpMQ JKleGk5YvvX44mKXf7RWmdDSphBoQ8qVRA/+DuP+1SfA8Fw2x9Qe05v/6wPBcooazoPY D6AaUfAqtG+m5nxx9/zQA/0b0ky8PjBLwhiLoKVzGvm2SCNiKN3vy/nr3iaTtohEj3l/ LBeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yF10T1un/KZQW6woSWqGuy1mX4kFECkAeSrxLlc4k9Y=; b=Y2NeXG3TMz0tZv/CPIiLn3RB4Ob6codh67f6YWMK39QMrw5QQobT8YKVZAe3vmkWmF z91hJJc+WxglRdAaSnRkritMWr7MPtrUWaELmYDcrc+8ZQjI7CF5pd+VaqcJMwYOzQLb EJ4IiSPMvuHTXPHW8vTadAd9wK237vDOU6GfFlwiqAs6auI5CRFrnA3OppxDrxLttu0T NY+r9Zwr1zOxQ/dPrKWj4UKdyZU+uYnvw+91qTf8WCg+/XfpLll9SvsBXT4pK12TE0Ve SroopBCjlYBzFL4XlyYC1Vh7o+my36JiagEfs6GUJJdGnYeRdS2p+7cDjHusG75Ralkg XSaA== X-Gm-Message-State: AOAM532hTwJOhTR/tieAZ9CZZoXezq040l+M+41Am5SQSGx1Nuy8wFS/ ZMsPpzQDkBE5Q/Elg3udgYYbd9eFz6M= X-Google-Smtp-Source: ABdhPJwlyv9txsoY7pTs8S0b/pHrFavflDDLnrahpXf9y17DwUa+QMxuFJnoZLJWX8dCp7fMAaNBSQ== X-Received: by 2002:a05:6512:1303:: with SMTP id x3mr13630793lfu.276.1622444694751; Mon, 31 May 2021 00:04:54 -0700 (PDT) Received: from localhost.localdomain ([90.129.201.30]) by smtp.gmail.com with ESMTPSA id t15sm1608470ljk.99.2021.05.31.00.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 00:04:54 -0700 (PDT) From: liu.ming50@gmail.com To: u-boot@lists.denx.de Cc: sergio.prado@toradex.com, max.krummenacher@toradex.com, Ming Liu Subject: [[PATCH] tools: image-host: fix wrong return value Date: Mon, 31 May 2021 09:04:51 +0200 Message-Id: <20210531070451.6561-1-liu.ming50@gmail.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Ming Liu The return value '-ENOSPC' of fit_set_timestamp function does not match the caller fit_image_write_sig's expection which is '-FDT_ERR_NOSPACE'. Fix it by not calling fit_set_timestamp, but call fdt_setprop instead. This fixes a following mkimage error: | Can't write signature for 'signature@1' signature node in | 'conf@imx6ull-colibri-wifi-eval-v3.dtb' conf node: | mkimage Can't add hashes to FIT blob: -1 Signed-off-by: Ming Liu Tested-by: Igor Opaniuk --- tools/image-host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/image-host.c b/tools/image-host.c index 270d36fe45..73095461a7 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -132,8 +132,10 @@ static int fit_image_write_sig(void *fit, int noffset, uint8_t *value, if (!ret) { time_t timestamp = imagetool_get_source_date(cmdname, time(NULL)); + uint32_t t = cpu_to_uimage(timestamp); - ret = fit_set_timestamp(fit, noffset, timestamp); + ret = fdt_setprop(fit, noffset, FIT_TIMESTAMP_PROP, &t, + sizeof(uint32_t)); } if (region_prop && !ret) { uint32_t strdata[2];