From patchwork Thu Aug 23 10:43:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 144909 Delivered-To: patches@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp30536ljw; Thu, 23 Aug 2018 03:43:44 -0700 (PDT) X-Received: by 2002:a2e:5b4a:: with SMTP id p71-v6mr38799373ljb.91.1535021024603; Thu, 23 Aug 2018 03:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535021024; cv=none; d=google.com; s=arc-20160816; b=HZL/twl5QRhyTSuChEU4xcgfnPfAjv5fq5RGuHK/b9wOpQWDLM0r26VB8UWCsWl77M +oA58jz9t7xl5cVG31Bud3lIP5JvHARKg7mnn1MCwVQ4RnWmLGcfuSg7GNS0elLtaUCG +c1jskIU7FZO329j4VLNOthdKPce5m34WfrUvKlx6hU/46gaJ9k5zJ2jEbzM71694EUc DmaSYr/xa/Nhy97qWrJRWYupM1C+eZotBQgQmapTeJh3KsTfSzTdKbzI8qQKsDrzwRDU NxIHS87SiSoCf+xfdPwZGpQoRRt7/8N7PMR2b6HiqrmMXaMKGMqzYfuApF5QNycEZIYb kp3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Lw0wZrCdsaedqJ77wj0I9x8SVXR1t3HaUgBcOOZU8ok=; b=Z0Gokv3y5Q9vLhtLZuKBIr3/rwAUTDDmEv6UyCn+aiIQKZGl/JVE5VZz50YPDnSdtY uXuvUQV9l+r+Uim4MCM8SZpyoTmUUikV5vRfTIrjgQbvq4MqK+lGY8YydnBQSJ7itq97 ptEr2oqhYveLZfx21PWrQQAXew0lG2YL+HP0pWzfN5C2gOmbErY9lvu1JpqqYm6ewTBr /fMSGlftpmsYaEl4rWAK1W5eLeyeKcspmMPduSkP7RYgalzZUCkK4h0Q2J95ooEjBp8z MAGL88zCO98h/+42TKzkQVcQDlfdYIxiiVL42m+IAkxEsA2Laxu2K7oxY49hINrWKPqT jYdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WUicBSLR; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u85-v6sor457131lfi.182.2018.08.23.03.43.44 for (Google Transport Security); Thu, 23 Aug 2018 03:43:44 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WUicBSLR; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Lw0wZrCdsaedqJ77wj0I9x8SVXR1t3HaUgBcOOZU8ok=; b=WUicBSLRbgsrnVCgdrmmwADs5f678K6ikdA3V6lcPskM7ck2RaZLewecXjsj46ikqH sZWx097xLWsOI2XIX6e8qwmT3gmmnTlUTQNK+uI8oCWTxc7Ub2kJVJcCYaET4Yv65nL9 eL98ArLYeScR+0fEuQPRtcM6FqKTDjTcCtwEY= 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:in-reply-to :references; bh=Lw0wZrCdsaedqJ77wj0I9x8SVXR1t3HaUgBcOOZU8ok=; b=GrUgA7EPAlHWTAlFwGJi8lK/2DLrbcLghLlw8i0ehv5HvwcKrUGWgLTe7BaANiqnKr pn3r0vydR4xu8plW30pqYb30vslONj491sFUJbXWv+0EM21Ok7/snPqVVU0QQM8s5KcD q5eF4WNzKImiLOBxrViwBUpSwVeBKuFQUOUqYT73pE6Nnhnbz7CFxds8ye8Ak230sA9b y9K/TRXKvCQH8JluPcnE15j3Cb2Ud20828Jj4joKa7ZmZ0tux1RFLhAesaLJ99NF6yRC unSOjln+4DxiyiB0JoOL/U2y1ccV/OtA3Wj+///h6b9pnrzYNiARhbWE3SdZ+E36fyws ZTRQ== X-Gm-Message-State: AOUpUlF2UdMar39FI643LUsZLAjMpvSnWrGpbWNrp57iQeTGcew7/hMW Ep7+6Tx7MvP4yN+X294+pPlUiYYP X-Google-Smtp-Source: AA+uWPy26S0tj9EAY5oYU8MHbugb8d5gwB91v4NZpWRm03alzKXW3SDFRzTr1bs3gPiLqr3b0IV/Dg== X-Received: by 2002:a19:a401:: with SMTP id q1-v6mr11124709lfc.111.1535021024430; Thu, 23 Aug 2018 03:43:44 -0700 (PDT) Return-Path: Received: from jax.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id y5-v6sm679771ljj.75.2018.08.23.03.43.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 03:43:43 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de Cc: Simon Glass , Igor Opaniuk , Tom Rini , Jaehoon Chung , Pierre Aubert , Albert Aribaud , Peter Griffin , Michal Simek , Jens Wiklander Subject: [PATCH v2 03/15] cmd: avb: print error message if command fails Date: Thu, 23 Aug 2018 12:43:22 +0200 Message-Id: <20180823104334.16083-4-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180823104334.16083-1-jens.wiklander@linaro.org> References: <20180823104334.16083-1-jens.wiklander@linaro.org> Signed-off-by: Jens Wiklander --- cmd/avb.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.17.1 Reviewed-by: Simon Glass diff --git a/cmd/avb.c b/cmd/avb.c index ca4b26d5d7b3..ff00be4cee38 100644 --- a/cmd/avb.c +++ b/cmd/avb.c @@ -35,6 +35,8 @@ int do_avb_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (avb_ops) return CMD_RET_SUCCESS; + printf("Failed to initialize avb2\n"); + return CMD_RET_FAILURE; } @@ -65,6 +67,8 @@ int do_avb_read_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_SUCCESS; } + printf("Failed to read from partition\n"); + return CMD_RET_FAILURE; } @@ -108,6 +112,8 @@ int do_avb_read_part_hex(cmd_tbl_t *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } + printf("Failed to read from partition\n"); + free(buffer); return CMD_RET_FAILURE; } @@ -138,6 +144,8 @@ int do_avb_write_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_SUCCESS; } + printf("Failed to write in partition\n"); + return CMD_RET_FAILURE; } @@ -161,6 +169,9 @@ int do_avb_read_rb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("Rollback index: %llx\n", rb_idx); return CMD_RET_SUCCESS; } + + printf("Failed to read rollback index\n"); + return CMD_RET_FAILURE; } @@ -184,6 +195,8 @@ int do_avb_write_rb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) AVB_IO_RESULT_OK) return CMD_RET_SUCCESS; + printf("Failed to write rollback index\n"); + return CMD_RET_FAILURE; } @@ -210,6 +223,8 @@ int do_avb_get_uuid(cmd_tbl_t *cmdtp, int flag, return CMD_RET_SUCCESS; } + printf("Failed to read UUID\n"); + return CMD_RET_FAILURE; } @@ -320,6 +335,8 @@ int do_avb_is_unlocked(cmd_tbl_t *cmdtp, int flag, return CMD_RET_SUCCESS; } + printf("Can't determine device lock state.\n"); + return CMD_RET_FAILURE; }