From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E532921165273 for ; Wed, 13 Jun 2018 20:01:38 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 20:01:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,221,1526367600"; d="scan'208";a="66848642" Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.110]) by orsmga002.jf.intel.com with ESMTP; 13 Jun 2018 20:01:37 -0700 From: BobCF To: edk2-devel@lists.01.org Cc: Bob Feng , Liming Gao Date: Thu, 14 Jun 2018 11:01:23 +0800 Message-Id: <20180614030123.55508-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Subject: [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:01:39 -0000 When packing HiiPcd into PcdNvStoreDefaultValueBuffer, The boolean type pcd value packing incorrect. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao --- BaseTools/Source/Python/AutoGen/GenVar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/Python/AutoGen/GenVar.py index 3675be8de9..bf3d225c21 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -294,11 +294,11 @@ class VariableMgr(object): if tail: for value_char in tail.split(","): Buffer += pack("=B",int(value_char,16)) data_len += len(tail.split(",")) elif data_type == "BOOLEAN": - Buffer += pack("=B",True) if var_value.upper() == "TRUE" else pack("=B",False) + Buffer += pack("=B",True) if var_value.upper() in ["TRUE","1"] else pack("=B",False) data_len += 1 elif data_type == DataType.TAB_UINT8: Buffer += pack("=B",GetIntegerValue(var_value)) data_len += 1 elif data_type == DataType.TAB_UINT16: -- 2.16.2.windows.1