From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 E0389203564C5 for ; Tue, 28 Nov 2017 03:57:49 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2017 04:02:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,468,1505804400"; d="scan'208";a="1249439453" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.50]) by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2017 04:02:12 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jaben Carsey Date: Tue, 28 Nov 2017 20:02:07 +0800 Message-Id: <20171128120207.186068-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.0.gvfs.1.preview.4 In-Reply-To: <20171128120207.186068-1-ruiyu.ni@intel.com> References: <20171128120207.186068-1-ruiyu.ni@intel.com> Subject: [PATCH 2/2] ShellPkg/DynamicCommand: Fix bug that cannot start in boot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2017 11:57:50 -0000 When dynamic command drivers are built into FV and start during boot, they fails. Because Shell protocol doesn't exist during boot. The patch sets Shell protocol and also set PcdShellLibAutoInitialize to FALSE to ensure that 1. Shell protocol check doesn't happen in driver's entry point. 2. Driver can get the Shell protocol in DynamicCommand.Handler(). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Jaben Carsey --- ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.c | 1 + ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.c | 1 + ShellPkg/ShellPkg.dsc | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.c b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.c index 6f3997fff4..b10c59f49c 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.c @@ -38,6 +38,7 @@ DpCommandHandler ( ) { gEfiShellParametersProtocol = ShellParameters; + gEfiShellProtocol = Shell; return RunDp (gImageHandle, SystemTable); } diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.c b/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.c index 928ef08468..9e6489dd6f 100644 --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.c +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.c @@ -39,6 +39,7 @@ TftpCommandHandler ( ) { gEfiShellParametersProtocol = ShellParameters; + gEfiShellProtocol = Shell; return RunTftp (gImageHandle, SystemTable); } diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index 65e8959455..86382139a5 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -120,9 +120,14 @@ [Components] !endif #$(NO_SHELL_PROFILES) } - ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf + ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { + + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE + } ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.inf ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf { + + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE PerformanceLib|MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf } -- 2.15.0.gvfs.1.preview.4