From: jcarsey Date: Mon, 16 May 2011 22:12:20 +0000 (+0000) Subject: add support to easily remove profiles and shell levels. the libraries will not do... X-Git-Tag: edk2-stable201903~14837 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=82571fb5d1c9093fd2387fc4a35a9f6fe5d541f4;p=mirror_edk2.git add support to easily remove profiles and shell levels. the libraries will not do anything (but no longer fail), if the PCDs are changed to remove their functionality. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11666 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c index 66345b4b72..13c829afb5 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c @@ -56,7 +56,7 @@ UefiShellDebug1CommandsLibConstructor ( // check our bit of the profiles mask // if ((PcdGet8(PcdShellProfileMask) & BIT1) == 0) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } // diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c index d802a5d7d4..109fa72178 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c @@ -57,7 +57,7 @@ UefiShellDriver1CommandsLibConstructor ( // check our bit of the profiles mask // if ((PcdGet8(PcdShellProfileMask) & BIT0) == 0) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } // diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c index 3b515cd81c..28a9a9c326 100644 --- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c @@ -57,7 +57,7 @@ ShellInstall1CommandsLibConstructor ( // check our bit of the profiles mask // if ((PcdGet8(PcdShellProfileMask) & BIT2) == 0) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } gShellInstall1HiiHandle = HiiAddPackages (&gShellInstall1HiiGuid, gImageHandle, UefiShellInstall1CommandsLibStrings, NULL); diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c index bae834f164..72c5d07d52 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c @@ -58,7 +58,7 @@ ShellLevel1CommandsLibConstructor ( // if shell level is less than 2 do nothing // if (PcdGet8(PcdShellSupportLevel) < 1) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } gShellLevel1HiiHandle = HiiAddPackages (&gShellLevel1HiiGuid, gImageHandle, UefiShellLevel1CommandsLibStrings, NULL); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c index e54d5f3ede..fed233c33a 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c @@ -77,7 +77,7 @@ ShellLevel2CommandsLibConstructor ( // if shell level is less than 2 do nothing // if (PcdGet8(PcdShellSupportLevel) < 2) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } gShellLevel2HiiHandle = HiiAddPackages (&gShellLevel2HiiGuid, gImageHandle, UefiShellLevel2CommandsLibStrings, NULL); diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c index ef708cb17c..3c4fe54260 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c @@ -57,7 +57,7 @@ ShellLevel3CommandsLibConstructor ( // if shell level is less than 3 do nothing // if (PcdGet8(PcdShellSupportLevel) < 3) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } gShellLevel3HiiHandle = HiiAddPackages (&gShellLevel3HiiGuid, gImageHandle, UefiShellLevel3CommandsLibStrings, NULL); diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c index d8fa88db7e..b0de1ae694 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c @@ -58,7 +58,7 @@ ShellNetwork1CommandsLibConstructor ( // check our bit of the profiles mask // if ((PcdGet8(PcdShellProfileMask) & BIT3) == 0) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } gShellNetwork1HiiHandle = HiiAddPackages (&gShellNetwork1HiiGuid, gImageHandle, UefiShellNetwork1CommandsLibStrings, NULL); diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index b0e91da804..d929bccc41 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -27,7 +27,7 @@ UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf @@ -57,10 +57,15 @@ # NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf +[PcdsFixedAtBuild] + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE + gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000 +!ifdef $(NO_SHELL_PROFILES) + gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask|0x00 +!endif -[PcdsFixedAtBuild.common] - -[Components.common] +[Components] ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf @@ -69,34 +74,14 @@ ShellPkg/Application/Shell/Shell.inf { - DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf - ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf +!ifndef $(NO_SHELL_PROFILES) NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf - FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf - ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf - SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - - - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000 +!endif } - - ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf { - - ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - } - ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf { - - ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - } - ShellPkg/Application/ShellExecTestApp/SA.inf