From patchwork Thu Feb 2 09:24:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 649654 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp135393pva; Thu, 2 Feb 2023 01:25:42 -0800 (PST) X-Google-Smtp-Source: AK7set9ZfiJEZSxA2kxFjGlKukRIiE5gMn+Yjqc9eftA3CB4zcUk8U4VftvJkC5NQX2jGRVQxVEB X-Received: by 2002:a05:6871:b0a:b0:15e:e77b:b2da with SMTP id fq10-20020a0568710b0a00b0015ee77bb2damr2733317oab.17.1675329942706; Thu, 02 Feb 2023 01:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675329942; cv=none; d=google.com; s=arc-20160816; b=BMioGMXG6B5SQ5JkmslMSb5pZE1LpuQFjekvVXdc0jIV8IEN8nioDU5xKnVFLlwtyU SdMXquayMQfMty/WaOxpEo1IFh9cGgwzOH8pj1Ty4MbLn9zDORmTdWiwbKFMhZ6ONWFg r058pB34EwDfFvNUm5mP8SHPN3Pyc8cZomN4pR7OArGxvQuIJLavuA48tXDe99mJzwEp wLH4yJsxk4/tHkMFWCq7W82udPLgHpKNKBbXjqmGJHd0+FYBK9SdfEhUORok10qMZVUK +sL1d7g1xqiRcONMkbl505OPYYdbDADkDtgeXBS1vj+toFnSsyeHMLllHnexjEWksY3R TzSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=IOZ4UrIWwINFcckW1U76kPF9u0Fuu1HU8lT2UbpT2Oc=; b=zOK6mYlN/J9GRM9iZ6de2ts30E04j31xZqoLwaCoZSZeyXaYW7uzaXd0aXtt8P8iRA 6BtgCV9eW6lAlqxs7/SOKiOuRgAPF7ZbLv0/AWIOcfbEZCKy31N508+kK48zkWk9rP2C 6M/IbB+va9dNwz8ssN6+C088/AbkIBU9toEQRU+ErtHIjYX8k2Q1IhwmxswD+7tg4UH/ oiaci+TpL9pe/FArQ/T5HFFQ5lv/wbXQYD1nvQYofXwsywOrCVN4O7ZlPp82k/O7B0zQ lS/l2OP04pqf4eplJu0JrAtQkbTQJA+TgKdgqLYHHYT7UafSMH64yAHYc5wb1TQfRW/l h//A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PVI1QSYu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id x15-20020a056870a78f00b00169d50d4c48si1322797oao.323.2023.02.02.01.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:25:42 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PVI1QSYu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E135D85EEB; Thu, 2 Feb 2023 10:25:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="PVI1QSYu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5921C85EE9; Thu, 2 Feb 2023 10:25:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 0F94D85ED4 for ; Thu, 2 Feb 2023 10:25:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x102e.google.com with SMTP id l4-20020a17090a850400b0023013402671so4957873pjn.5 for ; Thu, 02 Feb 2023 01:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=IOZ4UrIWwINFcckW1U76kPF9u0Fuu1HU8lT2UbpT2Oc=; b=PVI1QSYuKSNHoAq/74EEGi9g70+OmgzPJeSsS0VAID3IjDmKCu97qr9zIAfBXETwKt 3pe6QDUbCt4AksQ4RVJThQymSpXOykoLJfiyOGZmGWZyUzxHDr713xZgaOn/N3DL9v9X FI/Fn0jsos2hFqHKk/UEmREgEUMLgd3Mv+j7FohtKt2PhOMzACLZk4k/zB89Bd7VmBen rnWga2dWdm2ILVXzXMFdDQGLlXWCaKrU2fnPmfoxYmwaG5A04gcVgNmbgRtbKTJUFUv1 gHeOTVGOta/XAfU/qWpO3lS+s7K+MQaTnTAdDeSuuP/6yUz37sFKUoxmo+xR+uqayAUU /KfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=IOZ4UrIWwINFcckW1U76kPF9u0Fuu1HU8lT2UbpT2Oc=; b=G86MmQdpqENRn60o3KJrq0DxTkDp1CJbnFcmyhK5GCtvLasYk8K/NA+rchRrbrCbvI Lqlp5fbC5cJPPRqiOWXbLIBR68yKluXWX5AACzTzOXPf7DgNXmAyJOXsLQ0x9M9W9yzG 6HmMCLf5D8SKDYqCWeTyUr+5gi15VNPxS8oGpyTjor2fi0fa6RdJXzGHZqgZD02Zikp2 x4xjiSo8FT/nIZrF8zHg72rowfc7uRiicpdIYuKpvQ/as5kDx7DHgwEoF3GfCpY0wndB A90ynm8JTqroUbQZDkAxUt8+8YoVlT6b0v9iVqKDrpmt2DYLx4ugAegJ8Ihzt6xAwhwW UlzA== X-Gm-Message-State: AO0yUKUXgAxGstQJBYUMr5Pl63A9X6XF6B2ITolT3iasXAc8uzJT+Uup Rx9c8wqe3Kas38hzRJOLF2TEiZhKPVbtBynj+DE= X-Received: by 2002:a17:902:c60b:b0:196:6c71:ae6 with SMTP id r11-20020a170902c60b00b001966c710ae6mr4286912plr.47.1675329908124; Thu, 02 Feb 2023 01:25:08 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id w4-20020a170902a70400b0019619f27525sm13120349plq.302.2023.02.02.01.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:25:07 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima , Simon Glass , Stefan Roese , Bin Meng Subject: [PATCH 1/5] menu: remove CTRL+C to quit Date: Thu, 2 Feb 2023 18:24:43 +0900 Message-Id: <20230202092447.28590-2-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202092447.28590-1-masahisa.kojima@linaro.org> References: <20230202092447.28590-1-masahisa.kojima@linaro.org> 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 On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima --- cmd/bootmenu.c | 2 +- cmd/eficonfig.c | 6 +++--- common/menu.c | 1 - doc/usage/cmd/bootmenu.rst | 2 +- lib/efi_loader/efi_console.c | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 3236ca5d79..8dc133c236 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -437,7 +437,7 @@ static void menu_display_statusline(struct menu *m) printf(ANSI_CURSOR_POSITION, menu->count + 5, 1); puts(ANSI_CLEAR_LINE); printf(ANSI_CURSOR_POSITION, menu->count + 6, 3); - puts("Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit"); + puts("Press UP/DOWN to move, ENTER to select, ESC to quit"); puts(ANSI_CLEAR_LINE_TO_END); printf(ANSI_CURSOR_POSITION, menu->count + 7, 1); puts(ANSI_CLEAR_LINE); diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 47c04cf536..f365a988d4 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -23,12 +23,12 @@ static struct efi_simple_text_input_protocol *cin; const char *eficonfig_menu_desc = - " Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit"; + " Press UP/DOWN to move, ENTER to select, ESC to quit"; static const char *eficonfig_change_boot_order_desc = " Press UP/DOWN to move, +/- to change orde\n" " Press SPACE to activate or deactivate the entry\n" - " Select [Save] to complete, ESC/CTRL+C to quit"; + " Select [Save] to complete, ESC to quit"; static struct efi_simple_text_output_protocol *cout; static int avail_row; @@ -927,7 +927,7 @@ static efi_status_t handle_user_input(u16 *buf, int buf_size, ANSI_CURSOR_POSITION "%s" ANSI_CURSOR_POSITION - " Press ENTER to complete, ESC/CTRL+C to quit", + " Press ENTER to complete, ESC to quit", 0, 1, msg, 8, 1); /* tmp is used to accept user cancel */ diff --git a/common/menu.c b/common/menu.c index cdcdbb2a18..56401695de 100644 --- a/common/menu.c +++ b/common/menu.c @@ -492,7 +492,6 @@ enum bootmenu_key bootmenu_conv_key(int ichar) /* enter key was pressed */ key = BKEY_SELECT; break; - case CTL_CH('c'): case '\e': /* ^C was pressed */ key = BKEY_QUIT; diff --git a/doc/usage/cmd/bootmenu.rst b/doc/usage/cmd/bootmenu.rst index cb3c8d2f93..684a18d8e1 100644 --- a/doc/usage/cmd/bootmenu.rst +++ b/doc/usage/cmd/bootmenu.rst @@ -122,7 +122,7 @@ Example bootmenu is as below:: Default behavior when user exits from the bootmenu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ User can exit from bootmenu by selecting the last entry -"U-Boot console"/"Quit" or ESC/CTRL+C key. +"U-Boot console"/"Quit" or ESC key. When the CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE is disabled, user exits from the bootmenu and returns to the U-Boot console. diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index 1ed8c7aa36..2c7536107a 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -1395,7 +1395,7 @@ efi_status_t efi_console_get_u16_string(struct efi_simple_text_input_protocol *c } else if (key.unicode_char == u'\r') { buf[len] = u'\0'; return EFI_SUCCESS; - } else if (key.unicode_char == 0x3 || key.scan_code == 23) { + } else if (key.scan_code == 23) { return EFI_ABORTED; } else if (key.unicode_char < 0x20) { /* ignore control codes other than Ctrl+C, '\r' and '\b' */ From patchwork Thu Feb 2 09:24:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 649655 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp135618pva; Thu, 2 Feb 2023 01:26:17 -0800 (PST) X-Google-Smtp-Source: AK7set/YtOyt6R+rEv7gdESW7ePc7y4FvOblMpg8rMd1XLRgYFWMDlLmnooBhiWLXCAZZclVVv+r X-Received: by 2002:a05:6808:cd:b0:378:2ded:5aa6 with SMTP id t13-20020a05680800cd00b003782ded5aa6mr2243382oic.48.1675329977603; Thu, 02 Feb 2023 01:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675329977; cv=none; d=google.com; s=arc-20160816; b=kZeLbbf921S2VDd6tDRnbquyulktPiSbA1OL9ByrxEjGTrHRHGb4iBzAVRDPKBvt2n z1yG35m3Y2kbNxFOPCy157dQflj+2+CsSn9NXFxbcAiRrQBtFTSb+l+jEe/uY8bUAYKk tvk2bli/NY+aisMhscCFgMdBcpvybzZCrUxMf4OJA8c/e8IpWii084o+ngmAtq4VwawA YKKQhy6AtT/XCcy9z/ey/1wLDcLjCkntDalVVV7xAmdAhWwudRBv5tzQATKtyIBIWgwU w4KlDoHXAWTJiyZEEul4MDKEMx3W8TDN4cmY/QTzGZv4l21R92Fu+8zHJKAiXeBasrKY KD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=HWbZX67udIJoRWBFrQ5g7bNLFOwtmiEOT0ZUc2AjphI=; b=OCQ51/G5zUmXqmDyuqo8YmOQAu9X01pQBfMOxGlwPHzeNOI++XmGDWRq+tfdKvvJIJ hRvSMAnr+rIPRIvobdPZ0H+c8LJ4bnmkwoOLpTriScXb9YpyuFnAI1cQR+C+LH8sWnZE 7fE0Kf/L5bwnZKIwIqILQEmTknw6Zhx7d4ZfDeEN0jVSIp8q4j9FI+3fGYP4l5AsyIt1 WFmE1GqPd/qAt81kvMP1zhhwyVOERmA0K09fAVi6q+Be9rgfF6lzCM+6FXWBUXFRMLwG 0syTXjfe45+ed3Ax3GNvaPpnKLbTtC8DZ6ZtSwjqyZ4xM+kzznWXUfJAYcksijyzUHGw edZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S2yT+L37; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 5-20020aca0d05000000b0037884426d52si6204876oin.95.2023.02.02.01.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:26:17 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S2yT+L37; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 76C8485EEC; Thu, 2 Feb 2023 10:25:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="S2yT+L37"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5478585EEC; Thu, 2 Feb 2023 10:25:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (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 DAAA285EE8 for ; Thu, 2 Feb 2023 10:25:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x1030.google.com with SMTP id e10-20020a17090a630a00b0022bedd66e6dso4990476pjj.1 for ; Thu, 02 Feb 2023 01:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=HWbZX67udIJoRWBFrQ5g7bNLFOwtmiEOT0ZUc2AjphI=; b=S2yT+L37kQ1mhoQVpyWt4GklwngR/gJMaFIkq0HKuzw+8eZcGTfJ80NiRc5afZ6N1G aebmx0P0S3tgeVtxPyCW0fm2SVHubLScO7LW4jaLethAPu/EbGQQrE2B2d94nVYhKKep U5VzptJlLMnh8V/SUj+jV9l7sjv5FcnJQ9dpvIe6oik0hDuxfoerNBq6AEHS5B2sv8v9 ffubVnTT5XE8GnKC7iW1k06mfM2DC6dvlYfYpNam85SpFM3+YeTRY1s87iMmxyGNGUck RelwmlUaUvLffE/HKMCUlaD7NCA90YxWI0wIDBDCjEqGd8EUDe15iP76s1bR0AJTw6e8 /hag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=HWbZX67udIJoRWBFrQ5g7bNLFOwtmiEOT0ZUc2AjphI=; b=HINRT2wcSqYZPJcT28grzQ8Z28scO5h66EisRKhwDQ2BJ0R1SUfk43/SLjD20Re/3M deMgNrX0C7azIe+RNetRx3I7CHXfb5Cij30YxaBpGWzJrdoTsgdgO16q+3B6KG2qtaT+ ABRQFXSXw4csFI4PY7AEDtCntU6YunCrDH+SI8djYuAGfuZRwqNLARrFbAi12PLUDd0G MY/gcILYFaJGUbnl1rkdzO7rjP1UBBoertz4eTgj+yi8T7p/I6yG6PaQ8BtbV9Rl51h1 mRO4AG5h0ygWCJ5kPz5ZxlrPjQnQEeEh+/3CI52SR/3uL5FrlJGwF7YjHUsAcj5b8YwS KgNg== X-Gm-Message-State: AO0yUKWOUU6BQ4hl5sYWBBmzKeDkq9xjt/1F9xpjZNVQaJ+HMXs9QqGB KO9hRtVGeVvWGz/rRoLGm4Z6ENCHNmclYGBJH/U= X-Received: by 2002:a17:902:db08:b0:196:6577:5a96 with SMTP id m8-20020a170902db0800b0019665775a96mr7743859plx.30.1675329910914; Thu, 02 Feb 2023 01:25:10 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id w4-20020a170902a70400b0019619f27525sm13120349plq.302.2023.02.02.01.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:25:10 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima , Simon Glass , Stefan Roese Subject: [PATCH 2/5] eficonfig: CTRL+S to save the boot order Date: Thu, 2 Feb 2023 18:24:44 +0900 Message-Id: <20230202092447.28590-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202092447.28590-1-masahisa.kojima@linaro.org> References: <20230202092447.28590-1-masahisa.kojima@linaro.org> 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 The change boot order menu in eficonfig can have at most INT_MAX lines and it is troublesome to scroll down to the "Save" entry. This commit assigns CTRL+S to save the boot order. Signed-off-by: Masahisa Kojima --- cmd/eficonfig.c | 6 +++++- common/menu.c | 3 +++ include/menu.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index f365a988d4..0a17b8cf34 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -28,7 +28,7 @@ const char *eficonfig_menu_desc = static const char *eficonfig_change_boot_order_desc = " Press UP/DOWN to move, +/- to change orde\n" " Press SPACE to activate or deactivate the entry\n" - " Select [Save] to complete, ESC to quit"; + " CTRL+S to save, ESC to quit"; static struct efi_simple_text_output_protocol *cout; static int avail_row; @@ -1983,6 +1983,10 @@ char *eficonfig_choice_change_boot_order(void *data) eficonfig_menu_down(efi_menu); return NULL; + case BKEY_SAVE: + /* force to select "Save" entry */ + efi_menu->active = efi_menu->count - 2; + fallthrough; case BKEY_SELECT: /* "Save" */ if (efi_menu->active == efi_menu->count - 2) { diff --git a/common/menu.c b/common/menu.c index 56401695de..da08f17747 100644 --- a/common/menu.c +++ b/common/menu.c @@ -502,6 +502,9 @@ enum bootmenu_key bootmenu_conv_key(int ichar) case CTL_CH('n'): key = BKEY_DOWN; break; + case CTL_CH('s'): + key = BKEY_SAVE; + break; case '+': key = BKEY_PLUS; break; diff --git a/include/menu.h b/include/menu.h index 1e88141d6b..64ce89b7d2 100644 --- a/include/menu.h +++ b/include/menu.h @@ -53,6 +53,7 @@ enum bootmenu_key { BKEY_PLUS, BKEY_MINUS, BKEY_SPACE, + BKEY_SAVE, BKEY_COUNT, }; From patchwork Thu Feb 2 09:24:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 649656 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp135701pva; Thu, 2 Feb 2023 01:26:33 -0800 (PST) X-Google-Smtp-Source: AK7set9IrBrVKirMkOpWwdZ6vQ6CDXTZr9QnOK7tjboNEGJTrheyuVy3qpSG9NAfSWIZbTuRsC/3 X-Received: by 2002:a05:6870:c1d2:b0:15f:bcf0:86c5 with SMTP id i18-20020a056870c1d200b0015fbcf086c5mr2598749oad.56.1675329992946; Thu, 02 Feb 2023 01:26:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675329992; cv=none; d=google.com; s=arc-20160816; b=BteQ6wi521WYlzmuco9nR2hibMDhA+lW35jBUnqYxi1VdpKL3NYfW/61fjUV8NNOUF Hqnl+lanqkYHCG5Bu8IpZDg3H6P9ecyzLVhNdNiYdmbgcySWa74KKemjiNiPX/wuxrZe 3VCJd9VZhnbdfvFVhSpXiM4Yxe00ywz0d6Nt4qaqsMYaoZX8RhArif142nx6Hvk7JRxt D/vMKfRRAliqRgIcfGueRRjoYHGeaafZd1Lv2nc6xExCf3boCUQCSTE+h26G6S6e5WDe kNcWG+FQcckK6qbImceLcxbSySd8bZTAPXtaRA7rIoc+UNBCuaewYmwXrrHcPwIOHqDM k3LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=TmiucDsYYK/JRfcyUDrXxMALN0RXoY9kaNm3Vr+SeCU=; b=vGtvAyJi+35d3g+quE6QCOFYM6XV2CTU679yaSTHNcdrGXgdMmfn2GPZjdWgMnlXdA 4zsxJpcl/0Uds/yLaos2XJu4It38P1LBGET2iFxUOEpvvd+AMEHrGDN4MtEs3VmajYn3 ugLsXqR7Pi8w5GJsCn1E5TPpE43XEthMiISMUU3qmf4rimsNvKVReQm3RqB812Z76mbc 3NZ4R/9+KEE627TGtpV5Fb59rsfNA+56ulVzturTR7sXE1uaNdEqI2O9fVZqzQ7Dje71 UZv8fp5aWTI0wQDV+OS3ivn1pZjQGtkFEe2S3dhIf0yZgnD8HRpERMsSiEx+951/vkAU l5Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aARNZS0H; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id mt14-20020a0568706b0e00b00143ae47975csi19027447oab.171.2023.02.02.01.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:26:32 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aARNZS0H; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A09785EFE; Thu, 2 Feb 2023 10:25:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="aARNZS0H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 57B6585ED6; Thu, 2 Feb 2023 10:25:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 D732885EDE for ; Thu, 2 Feb 2023 10:25:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x102c.google.com with SMTP id 88so1331181pjo.3 for ; Thu, 02 Feb 2023 01:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=TmiucDsYYK/JRfcyUDrXxMALN0RXoY9kaNm3Vr+SeCU=; b=aARNZS0HGFjaY1i7PpfsUXZ2ZyYCRu070YPNmyKqPO639NcXRuh1G4i16PsgtB9XWR uLhqW6uOtbBdPgtZ7AOCbzq3iRCQ7PVI+JBK9OZyLY7UvcbcotqzeHZAkXNOr71vVr5l Jz1pn7IERkx90MS6bgFrerABNKP4SawG/4e2f+HE3101zTpOpsvlTtad2/vnRd7exrR9 oA70vDUbRkkXDYlUde1+JH42D//EsTxipNPqI2Qjk3tXwWCj19eT4wDR4lGnNQPrZeZK ecfLyBIp9FBFjLzxAarejYq591cx7bY+GP0FqfXtmFeV1beJrM3w0/t9SRgWbvsffKmb eKnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=TmiucDsYYK/JRfcyUDrXxMALN0RXoY9kaNm3Vr+SeCU=; b=f08eTHUbZPMo0xPZDsN02X2oqQO4jyYrGIr1Yc640Gudugi/8F7hrHdk3TDo85s83e GJ01zKxTjlgll0mEImeS/Eo2J9SaNf9Dk6oH8nj9RLTGQVnSNJxsG00V6O2+2LeIduhQ IJlrx7Ge6ENrriRl4SMOLnF7DiWNVkcvdUtKEE6pLKbaeSQlJ9CHE81DE/hLjJMND32J vaQDbXuVKvERk8NL0uxhDr4tqvKT7lpIrWaOZnaq7f6YoKNH79L1psuGImHPG9w3sctP njH3aWHGL9zEo0zNBqMjmeKjQAIxLhLPViH2OK3XEv0S6l43hc091MyE3ysPJxUYRJUT tJyw== X-Gm-Message-State: AO0yUKW46ofVl7gsCdzMku+Um4zt+bS5fecVWmDqvK/UfPdn3LQ0qL0n EsuhpmeYdXi0eS/exwDjTSnTThruSi+5P8+NbRo= X-Received: by 2002:a17:902:da85:b0:198:b99c:f6ee with SMTP id j5-20020a170902da8500b00198b99cf6eemr3996392plx.65.1675329912964; Thu, 02 Feb 2023 01:25:12 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id w4-20020a170902a70400b0019619f27525sm13120349plq.302.2023.02.02.01.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:25:12 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima Subject: [PATCH 3/5] eficonfig: set EFICONFIG_ENTRY_NUM_MAX to INT_MAX - 1 Date: Thu, 2 Feb 2023 18:24:45 +0900 Message-Id: <20230202092447.28590-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202092447.28590-1-masahisa.kojima@linaro.org> References: <20230202092447.28590-1-masahisa.kojima@linaro.org> 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 eficonfig_append_menu_entryi() accepts the number of entries less than or equal to EFICONFIG_ENTRY_NUM_MAX. EFICONFIG_ENTRY_NUM_MAX is currently set as INT_MAX, so the invalid menu count check(efi_menu->count > EFICONFIG_ENTRY_NUM_MAX) in eficonfig_process_common() is always false. This commit sets EFICONFIG_ENTRY_NUM_MAX to (INT_MAX - 1). Reported-by: Coverity (CID 435659) Signed-off-by: Masahisa Kojima --- include/efi_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/efi_config.h b/include/efi_config.h index e5edbb5e09..01ce9b2b06 100644 --- a/include/efi_config.h +++ b/include/efi_config.h @@ -11,7 +11,7 @@ #include #include -#define EFICONFIG_ENTRY_NUM_MAX INT_MAX +#define EFICONFIG_ENTRY_NUM_MAX (INT_MAX - 1) #define EFICONFIG_VOLUME_PATH_MAX 512 #define EFICONFIG_FILE_PATH_MAX 512 #define EFICONFIG_FILE_PATH_BUF_SIZE (EFICONFIG_FILE_PATH_MAX * sizeof(u16)) From patchwork Thu Feb 2 09:24:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 649657 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp135771pva; Thu, 2 Feb 2023 01:26:44 -0800 (PST) X-Google-Smtp-Source: AK7set+q97OfVnZITufx0cllf/Ypx3xetx0CWdigd+7iChhZ00bOa1bFQTekoj3nfAG+9PYEqTgH X-Received: by 2002:a05:6870:f222:b0:169:c549:6843 with SMTP id t34-20020a056870f22200b00169c5496843mr1603019oao.46.1675330004546; Thu, 02 Feb 2023 01:26:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675330004; cv=none; d=google.com; s=arc-20160816; b=sPm9pUissdxk/DpqhK/0+OVOq9JRRITZhwpyT7rMD7D/5SsVU3xFemEvRt78ADR+sQ UZ/QS7YOSxFCwa7APSspzPBVj2wXPMObg3Ei3ST7K2KhDJPENldKIzco7SV6I9wYSjYC w6JpB438hHwUWKyt1pk34sebmmx2wSrXGCpDi7VsYkseMvKk/LwEYTq8AT3Fm+CPS27p nzUcW7c8/0w4FSdqkQAaQ9gehbwh1cnavAp1tAEKBKyIADbVCWWhlpcSO+8YthogeirJ 9ul0uXbD1jb/rlDLhROAH+RyV+b9TJbYp/JwD9LAoVk3LmJQXExEtAIdHXl73oGvAuXk mPTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=O454GUKk8eX6u2PaM/DvjAWEIf/pXOvNvuc59IeZG6w=; b=SGleA69tv0h1fov2tR/dbUHWddloHykyIcvNqkUBOIs5wFbhRve2YIWcRsCNeQ8bh+ WfEvnzpzL1LSHnJZQkQfmyFUh11Cc58EpSLuHiOkeMUBzF3xhWGQTCEgPlA0X4i0aorI ccAjId83bYtoNnq4UheWtBJdga/0NMuM4pUhVs0QgeHHD+6KGMqTqSd0+cBsDlnIhXuh pBvEXHh/YnRAEGlTG4zhxaK7qQFTTo5aP89OTMfUIRekZnW9Pgx+M62U54wSHb+oPUyA vlH6E0UsTP4vRehGMRtJs9i0Eicytcr1XBfnMsUgbc+5cRCBg/BJtSTILeeYaBhCsM4Y omdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bpIgBjzs; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id pb6-20020a0568701e8600b0014ff15936bbsi19416368oab.268.2023.02.02.01.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:26:44 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bpIgBjzs; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A5DC85EF1; Thu, 2 Feb 2023 10:26:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="bpIgBjzs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9DBF385EE9; Thu, 2 Feb 2023 10:25:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 761BF85EE1 for ; Thu, 2 Feb 2023 10:25:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x102c.google.com with SMTP id 88so1331280pjo.3 for ; Thu, 02 Feb 2023 01:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=O454GUKk8eX6u2PaM/DvjAWEIf/pXOvNvuc59IeZG6w=; b=bpIgBjzso8L0btTnATQQOUn87Swu7JanP/4g2bdc63H6yiFNF+hitn3f00PfGhCIrX tqNXK+m+SQioKNb3uZdstWTdVwZaHo2AxdLGkeHYAXgQUMxXUDnXKcaUSd8PKFnwzsh5 1bnsgCxnSaqKs+1sRUjDEPdaBaM70ZYFrMdoSnKvyeW1m9bg7s4yz4KYvZWVbMC75Fz2 hchJQCoJqStPc0l+xcqySxMAEJP+ebJJSgNJpO0NYHrm/R40pQHGkIOkFLYDBbJd/02R m040YHnyb4VKeuM0nGd291LoINYy9BBA3LbvtCk++64SaesQG8iCZ0f2PTbmXxpMNup5 R4Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=O454GUKk8eX6u2PaM/DvjAWEIf/pXOvNvuc59IeZG6w=; b=qSH7FVsCseNYRj32tKgEO2JO52jHYW70/PpMxXBsjTCZjy+4fs/ncbXGzFQfFjfL3e ogMZWO8sNQS1Zzfvh8vHr8enq7Nz4UYfMmg0R6IaMVjGWmWlh7oAs4Qi9a2dlQwa6JWx G+akjxfT8GblPMLc541rGHjWK1PFBFVfZHaxWaco1Lvfen9plFVIgxg0gYnNEf8+5Wcj LVjHOrOT70Mse4Mx2JvwV6ZcNh+IsobGMVXh7yH512rlCVa4kl+L4InNxf+Qw0n9NUeC pTXr0BWrsB4WZnk6IM9SVMFSrsoK9b1Kg6lJPl5yLa/wVcbvCJueTQoDrpS39eotnf/n HdfQ== X-Gm-Message-State: AO0yUKWz2q+jeZC7zt/zT4DD0TWz2vW1iLMQ2ErJqa6kHCW4wyEKoMlx KnpC8p574KDICxNEIbQpxIYVUWytQ9uhYIaAY7E= X-Received: by 2002:a17:902:ce8e:b0:196:341b:ed7 with SMTP id f14-20020a170902ce8e00b00196341b0ed7mr7134108plg.15.1675329915627; Thu, 02 Feb 2023 01:25:15 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id w4-20020a170902a70400b0019619f27525sm13120349plq.302.2023.02.02.01.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:25:15 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima Subject: [PATCH 4/5] eficonfig: include EFI_STATUS string in error message Date: Thu, 2 Feb 2023 18:24:46 +0900 Message-Id: <20230202092447.28590-5-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202092447.28590-1-masahisa.kojima@linaro.org> References: <20230202092447.28590-1-masahisa.kojima@linaro.org> 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 Current eficonfig_print_msg() does not show the return value of EFI Boot/Runtime Services when the service call fails. With this commit, user can know EFI_STATUS in the error message. Signed-off-by: Masahisa Kojima --- cmd/eficonfig.c | 95 +++++++++++++++++++++++++++++++++++++------ cmd/eficonfig_sbkey.c | 16 ++++---- include/efi_config.h | 2 +- 3 files changed, 93 insertions(+), 20 deletions(-) diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 0a17b8cf34..b0c8637676 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -151,19 +151,90 @@ static void eficonfig_menu_adjust(struct efimenu *efi_menu, bool add) #define eficonfig_menu_up(_a) eficonfig_menu_adjust(_a, false) #define eficonfig_menu_down(_a) eficonfig_menu_adjust(_a, true) +struct efi_status_str { + efi_status_t status; + char *str; +}; + +static const struct efi_status_str status_str_table[] = { + {EFI_LOAD_ERROR, "Load Error"}, + {EFI_INVALID_PARAMETER, "Invalid Parameter"}, + {EFI_UNSUPPORTED, "Unsupported"}, + {EFI_BAD_BUFFER_SIZE, "Bad Buffer Size"}, + {EFI_BUFFER_TOO_SMALL, "Buffer Too Small"}, + {EFI_NOT_READY, "Not Ready"}, + {EFI_DEVICE_ERROR, "Device Error"}, + {EFI_WRITE_PROTECTED, "Write Protected"}, + {EFI_OUT_OF_RESOURCES, "Out of Resources"}, + {EFI_VOLUME_CORRUPTED, "Volume Corrupted"}, + {EFI_VOLUME_FULL, "Volume Full"}, + {EFI_NO_MEDIA, "No Media"}, + {EFI_MEDIA_CHANGED, "Media Changed"}, + {EFI_NOT_FOUND, "Not Found"}, + {EFI_ACCESS_DENIED, "Access Denied"}, + {EFI_NO_RESPONSE, "No Response"}, + {EFI_NO_MAPPING, "No Mapping"}, + {EFI_TIMEOUT, "Timeout"}, + {EFI_NOT_STARTED, "Not Started"}, + {EFI_ALREADY_STARTED, "Already Started"}, + {EFI_ABORTED, "Aborted"}, + {EFI_ICMP_ERROR, "ICMP Error"}, + {EFI_TFTP_ERROR, "TFTP Error"}, + {EFI_PROTOCOL_ERROR, "Protocol Error"}, + {EFI_INCOMPATIBLE_VERSION, "Incompatible Version"}, + {EFI_SECURITY_VIOLATION, "Security Violation"}, + {EFI_CRC_ERROR, "CRC Error"}, + {EFI_END_OF_MEDIA, "End of Media"}, + {EFI_END_OF_FILE, "End of File"}, + {EFI_INVALID_LANGUAGE, "Invalid Language"}, + {EFI_COMPROMISED_DATA, "Compromised Data"}, + {EFI_IP_ADDRESS_CONFLICT, "IP Address Conflict"}, + {EFI_HTTP_ERROR, "HTTP Error"}, + {EFI_WARN_UNKNOWN_GLYPH, "Warn Unknown Glyph"}, + {EFI_WARN_DELETE_FAILURE, "Warn Delete Failure"}, + {EFI_WARN_WRITE_FAILURE, "Warn Write Failure"}, + {EFI_WARN_BUFFER_TOO_SMALL, "Warn Buffer Too Small"}, + {EFI_WARN_STALE_DATA, "Warn Stale Data"}, + {EFI_WARN_FILE_SYSTEM, "Warn File System"}, + {EFI_WARN_RESET_REQUIRED, "Warn Reset Required"}, + {0, ""}, +}; + +/** + * struct get_status_str - get status string + * + * @status: efi_status_t value to covert to string + * Return: pointer to the string + */ +static char *get_error_str(efi_status_t status) +{ + u32 i; + + for (i = 0; status_str_table[i].status != 0; i++) { + if (status == status_str_table[i].status) + return status_str_table[i].str; + } + return status_str_table[i].str; +} + /** * eficonfig_print_msg() - print message * * display the message to the user, user proceeds the screen * with any key press. * - * @items: pointer to the structure of each menu entry - * @count: the number of menu entry - * @menu_header: pointer to the menu header string - * Return: status code + * @msg: pointer to the error message + * @status: efi status code, set 0 if no status string output */ -void eficonfig_print_msg(char *msg) +void eficonfig_print_msg(const char *msg, efi_status_t status) { + char str[128]; + + if (status == 0) + snprintf(str, sizeof(str), "%s", msg); + else + snprintf(str, sizeof(str), "%s (%s)", msg, get_error_str(status)); + /* Flush input */ while (tstc()) getchar(); @@ -171,7 +242,7 @@ void eficonfig_print_msg(char *msg) printf(ANSI_CURSOR_HIDE ANSI_CLEAR_CONSOLE ANSI_CURSOR_POSITION - "%s\n\n Press any key to continue", 3, 4, msg); + "%s\n\n Press any key to continue", 3, 4, str); getchar(); } @@ -580,7 +651,7 @@ static efi_status_t eficonfig_file_selected(void *data) new_len = u16_strlen(info->file_info->current_path) + strlen(info->file_name); if (new_len >= EFICONFIG_FILE_PATH_MAX) { - eficonfig_print_msg("File path is too long!"); + eficonfig_print_msg("File path is too long!", 0); return EFI_INVALID_PARAMETER; } tmp = &info->file_info->current_path[u16_strlen(info->file_info->current_path)]; @@ -626,7 +697,7 @@ static efi_status_t eficonfig_select_volume(struct eficonfig_select_file_info *f ret = efi_locate_handle_buffer_int(BY_PROTOCOL, &efi_simple_file_system_protocol_guid, NULL, &count, (efi_handle_t **)&volume_handles); if (ret != EFI_SUCCESS) { - eficonfig_print_msg("No block device found!"); + eficonfig_print_msg("No block device found!", ret); return ret; } @@ -850,7 +921,7 @@ static efi_status_t eficonfig_show_file_selection(struct eficonfig_select_file_i ret = EFI_CALL(root->open(root, &f, file_info->current_path, EFI_FILE_MODE_READ, 0)); if (ret != EFI_SUCCESS) { - eficonfig_print_msg("Reading volume failed!"); + eficonfig_print_msg("Reading volume failed!", ret); free(efi_menu); ret = EFI_ABORTED; goto out; @@ -990,12 +1061,12 @@ static efi_status_t eficonfig_boot_edit_save(void *data) struct eficonfig_boot_option *bo = data; if (u16_strlen(bo->description) == 0) { - eficonfig_print_msg("Boot Description is empty!"); + eficonfig_print_msg("Boot Description is empty!", 0); bo->edit_completed = false; return EFI_NOT_READY; } if (u16_strlen(bo->file_info.current_path) == 0) { - eficonfig_print_msg("File is not selected!"); + eficonfig_print_msg("File is not selected!", 0); bo->edit_completed = false; return EFI_NOT_READY; } @@ -2658,7 +2729,7 @@ static efi_status_t eficonfig_init(void) avail_row = rows - (EFICONFIG_MENU_HEADER_ROW_NUM + EFICONFIG_MENU_DESC_ROW_NUM); if (avail_row <= 0) { - eficonfig_print_msg("Console size is too small!"); + eficonfig_print_msg("Console size is too small!", 0); return EFI_INVALID_PARAMETER; } /* TODO: Should we check the minimum column size? */ diff --git a/cmd/eficonfig_sbkey.c b/cmd/eficonfig_sbkey.c index caca27495e..7ae1953567 100644 --- a/cmd/eficonfig_sbkey.c +++ b/cmd/eficonfig_sbkey.c @@ -150,7 +150,7 @@ static efi_status_t eficonfig_process_enroll_key(void *data) free(buf); if (!size) { - eficonfig_print_msg("ERROR! File is empty."); + eficonfig_print_msg("ERROR! File is empty.", 0); ret = EFI_INVALID_PARAMETER; goto out; } @@ -163,11 +163,13 @@ static efi_status_t eficonfig_process_enroll_key(void *data) ret = EFI_CALL(f->read(f, &size, buf)); if (ret != EFI_SUCCESS) { - eficonfig_print_msg("ERROR! Failed to read file."); + eficonfig_print_msg("ERROR! Failed to read file.", ret); goto out; } if (!file_have_auth_header(buf, size)) { - eficonfig_print_msg("ERROR! Invalid file format. Only .auth variables is allowed."); + eficonfig_print_msg( + "ERROR! Invalid file format. Only .auth variables is allowed.", + 0); ret = EFI_INVALID_PARAMETER; goto out; } @@ -175,7 +177,7 @@ static efi_status_t eficonfig_process_enroll_key(void *data) ret = file_is_null_key((struct efi_variable_authentication_2 *)buf, size, &null_key); if (ret != EFI_SUCCESS) { - eficonfig_print_msg("ERROR! Invalid file format."); + eficonfig_print_msg("ERROR! Invalid file format.", ret); goto out; } @@ -202,7 +204,7 @@ static efi_status_t eficonfig_process_enroll_key(void *data) ret = efi_set_variable_int((u16 *)data, efi_auth_var_get_guid((u16 *)data), attr, size, buf, false); if (ret != EFI_SUCCESS) - eficonfig_print_msg("ERROR! Failed to update signature database"); + eficonfig_print_msg("ERROR! Failed to update signature database", ret); out: free(file_info.current_path); @@ -283,7 +285,7 @@ static efi_status_t eficonfig_process_show_siglist(void *data) break; } default: - eficonfig_print_msg("ERROR! Unsupported format."); + eficonfig_print_msg("ERROR! Unsupported format.", 0); return EFI_INVALID_PARAMETER; } } @@ -394,7 +396,7 @@ static efi_status_t enumerate_and_show_signature_database(void *varname) db = efi_get_var(varname, efi_auth_var_get_guid(varname), &db_size); if (!db) { - eficonfig_print_msg("There is no entry in the signature database."); + eficonfig_print_msg("There is no entry in the signature database.", 0); return EFI_NOT_FOUND; } diff --git a/include/efi_config.h b/include/efi_config.h index 01ce9b2b06..19b1686907 100644 --- a/include/efi_config.h +++ b/include/efi_config.h @@ -93,7 +93,7 @@ struct eficonfig_select_file_info { bool file_selected; }; -void eficonfig_print_msg(char *msg); +void eficonfig_print_msg(const char *msg, efi_status_t status); void eficonfig_print_entry(void *data); void eficonfig_display_statusline(struct menu *m); char *eficonfig_choice_entry(void *data); From patchwork Thu Feb 2 09:24:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 649658 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp135847pva; Thu, 2 Feb 2023 01:26:58 -0800 (PST) X-Google-Smtp-Source: AK7set89vGtetnNbdevPBVsi9xkR1GBrPbQoN5MBmPHJGVsqNtrGYjVG1N45ygZ68H0IIueVVXA7 X-Received: by 2002:a05:6870:c110:b0:169:c54d:f069 with SMTP id f16-20020a056870c11000b00169c54df069mr1958829oad.26.1675330018519; Thu, 02 Feb 2023 01:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675330018; cv=none; d=google.com; s=arc-20160816; b=aD8q3L9yLWF7gkwzLwkkcW7oNiCgWG9CL5wKxuxtpMOQXIFCzlsidiN0+R498ZB6vM hZ1k9N8s5+ZJls0Bwyi532c3Hp/tj/dNteTrCUOxDXyumk5aDUTuncU1mwGG8fpTKp46 QfQ7NTVcIgtc4mAVk0DzE/zaIoaq8ME0OGRB5ZANJI1kA2bPa8ycGcXZSy4yU3t5gZvT gDNIZuFLasd1wXdJlEB6f6ZE5rjP53Jb9woloU5UXdyHnD2fJ25+p0SURlItk+YpoXPS W+X7YytESt5BuiEdXVJanhQLwgfhzszYPUmLmadcSdZBG4cAFBqc/estDJIKTS5ZejaR 4r4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=YkdVmec8Fl4UESa3kEEinVuit1sXPSFVThoYSZy1S6E=; b=iE1KoNgDRUY2jK8d0XYEpgqQhUS1p2DFNBnPVv3lXL4DzWLXfC1D2nxo2GRamzi5A6 oOGZz2o7KPP6k1Y0VtRuf5VAv4T6qIq2ngfnK51l5Lb2LLlqFgORU9UQlCl0BV4mxf+2 hgVsffksDLMnkAhhP1MQxcl8BP1Nsh9zE+1c/uQ32D++/NDqr+OOaV1a9L3Jd1zWPbfl 5od4yWRU9TeDqgaay783p8hkPF74uTWrC1SE0S0MTNXUdyYTRMRb06yrHUgTtFjWB2hw 5gz74hIelP4HK3CtjOM44O8GrI8Jek8DdmKF5k/Hpq/lKB2seyz+7zUgXHrHDiC2lnGl vAfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gk4UBhBP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id lb5-20020a056871414500b001375188e083si18669044oab.47.2023.02.02.01.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:26:58 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gk4UBhBP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A892685EFC; Thu, 2 Feb 2023 10:26:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="gk4UBhBP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 04B6585F01; Thu, 2 Feb 2023 10:25:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 A30DC85ED6 for ; Thu, 2 Feb 2023 10:25:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pl1-x62f.google.com with SMTP id b5so1232889plz.5 for ; Thu, 02 Feb 2023 01:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=YkdVmec8Fl4UESa3kEEinVuit1sXPSFVThoYSZy1S6E=; b=gk4UBhBPTNuhORIfxTgJmOy5wm+d+dI7LogyIAGJweSMuSSigDzNBOF4amcpVKiKF/ cxvOqHdOm8blVekTH9LGX4z9EhcRrJMe22Pf9yW6umEobQ7gjlrV/EJFdvvgZ5gthVCK e/oBkNMMzUgxECfvdOgY6c3zKZ5d7RR+vm+cI7xmFHFns9aGj/A63yeDEQBrpTaGhsHJ hxsDF0iGjcc9N10TCLcmm/eRVyvASokmq8gAsSutswYfDIUqUENcBUdyoidAU+3P1SUW P3xcCpBU7f8jVUT93X0kQjin8RibC3ObdqHLa5FDLXFioA614k+6B39PFn8utQdUw8Vl bNgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=YkdVmec8Fl4UESa3kEEinVuit1sXPSFVThoYSZy1S6E=; b=AGzop75dOhZGbn8MnEtVFtbV5Qz4KD7jHEKuB72uvH7o072xbfMnvg3lltk1K8jER0 foP+t8TOdcs80PA8bynXriL69Ji8oyuDnYoR24d1ia66lcRuEmFenKH47z7N9kPc5+In e2aJtHLYuKb/Hek7JYyoK8aCh6C2QT+fRkz3SZI3f6BsdNu7Fi6gHI0ZMR9SUTmH22QG whSnT4SrlRfzxaaDP2EliDaVdBsIUcIh7c/fa+hR8VNxstJagGelsf0ZK5GE8xM9Rf4T skFkkB+mrwyn3ygQBu1LsENdGuYI+/z4spZsMalkx/wWthoN3IXfHxKu/SDKYrDxvQTm 9LCg== X-Gm-Message-State: AO0yUKWo0pVCvhYirNTZTgRkC7xeyapE0bdtoJDhzUB2VjzbUOl19v7n KwpR5H3Uj36B3L0FeMy8R7qSico6kZOWrnJo7V8= X-Received: by 2002:a17:902:f202:b0:194:3fa4:3f46 with SMTP id m2-20020a170902f20200b001943fa43f46mr4380808plc.29.1675329917674; Thu, 02 Feb 2023 01:25:17 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id w4-20020a170902a70400b0019619f27525sm13120349plq.302.2023.02.02.01.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:25:17 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima Subject: [PATCH 5/5] eficonfig: add error message of SetVariable Date: Thu, 2 Feb 2023 18:24:47 +0900 Message-Id: <20230202092447.28590-6-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202092447.28590-1-masahisa.kojima@linaro.org> References: <20230202092447.28590-1-masahisa.kojima@linaro.org> 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 This commits add the error message when EFI Runtime Service SetVariable() failed. Signed-off-by: Masahisa Kojima --- cmd/eficonfig.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index b0c8637676..c5cbf27631 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -30,6 +30,8 @@ static const char *eficonfig_change_boot_order_desc = " Press SPACE to activate or deactivate the entry\n" " CTRL+S to save, ESC to quit"; +static const char *set_variable_fail_str = "SetVariable failed!"; + static struct efi_simple_text_output_protocol *cout; static int avail_row; @@ -1274,6 +1276,9 @@ static efi_status_t eficonfig_set_boot_option(u16 *varname, struct efi_device_pa EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, size, p, false); + if (ret != EFI_SUCCESS) + eficonfig_print_msg(set_variable_fail_str, ret); + free(p); return ret; @@ -1309,8 +1314,10 @@ efi_status_t eficonfig_append_bootorder(u16 index) EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, new_size, new_bootorder, false); - if (ret != EFI_SUCCESS) + if (ret != EFI_SUCCESS) { + eficonfig_print_msg(set_variable_fail_str, ret); goto out; + } out: free(bootorder); @@ -2155,6 +2162,8 @@ static efi_status_t eficonfig_process_save_boot_order(void *data) EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, size, new_bootorder, false); + if (ret != EFI_SUCCESS) + eficonfig_print_msg(set_variable_fail_str, ret); save_data->selected = true; out: @@ -2394,7 +2403,7 @@ static efi_status_t delete_boot_option(u16 boot_index) ret = efi_set_variable_int(varname, &efi_global_variable_guid, 0, 0, NULL, false); if (ret != EFI_SUCCESS) { - log_err("delete boot option(%ls) failed\n", varname); + eficonfig_print_msg("Delete boot option(%ls) failed!", ret); return ret; } @@ -2415,6 +2424,8 @@ static efi_status_t delete_boot_option(u16 boot_index) EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, size, bootorder, false); + if (ret != EFI_SUCCESS) + eficonfig_print_msg(set_variable_fail_str, ret); return ret; } @@ -2672,13 +2683,18 @@ efi_status_t eficonfig_generate_media_device_boot_option(void) EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, opt[i].size, opt[i].lo, false); - if (ret != EFI_SUCCESS) + if (ret != EFI_SUCCESS) { + eficonfig_print_msg(set_variable_fail_str, ret); goto out; + } ret = eficonfig_append_bootorder(boot_index); if (ret != EFI_SUCCESS) { efi_set_variable_int(var_name, &efi_global_variable_guid, 0, 0, NULL, false); + if (ret != EFI_SUCCESS) + eficonfig_print_msg(set_variable_fail_str, ret); + goto out; } }