From patchwork Mon Sep 16 06:47:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 275113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 467182C00F1 for ; Mon, 16 Sep 2013 16:47:39 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VLSak-0002yU-Ad; Mon, 16 Sep 2013 06:47:26 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VLSae-0002yO-Si for fwts-devel@lists.ubuntu.com; Mon, 16 Sep 2013 06:47:20 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VLSae-0002aF-7o; Mon, 16 Sep 2013 06:47:20 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] uefi: uefidump: fix the boot load option Boot#### larger than Boot1000 doesn't be parsered (LP:#1225850) Date: Mon, 16 Sep 2013 14:47:15 +0800 Message-Id: <1379314035-8872-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 1.7.9.5 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Some firmware/BIOS create the Boot path not in order, some of Boot load options are created larger than "Boot1000", such as Boot1001, Boot2001 etc. The uefidump checks the boot path with the "Boot0" causes these Boot load options cannot be parsered. Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Alex Hung --- src/uefi/uefidump/uefidump.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c index c072847..e4b6546 100644 --- a/src/uefi/uefidump/uefidump.c +++ b/src/uefi/uefidump/uefidump.c @@ -18,6 +18,7 @@ */ #include #include +#include #include "fwts.h" #include "fwts_uefi.h" @@ -747,7 +748,6 @@ static uefidump_info uefidump_info_table[] = { { "LangCodes", uefidump_info_langcodes }, { "Lang", uefidump_info_lang }, { "Timeout", uefidump_info_timeout }, - { "Boot0", uefidump_info_bootdev }, { "dump-type0-", uefidump_info_dump_type0 }, { "SecureBoot", uefidump_info_secure_boot }, { "SetupMode", uefidump_info_setup_mode }, @@ -781,6 +781,14 @@ static void uefidump_var(fwts_framework *fw, fwts_uefi_var *var) } } + /* Check the boot load option Boot####. #### is a printed hex value */ + if ((strlen(varname) == 8) && (strncmp(varname, "Boot", 4) == 0) + && isxdigit(varname[4]) && isxdigit(varname[5]) + && isxdigit(varname[6]) && isxdigit(varname[7])) { + uefidump_info_bootdev(fw, var); + return; + } + /* otherwise just do a plain old hex dump */ uefidump_var_hexdump(fw, var); }