EdkiiShellTool icon indicating copy to clipboard operation
EdkiiShellTool copied to clipboard

Cant build on ubuntu 20.04/WSL2

Open nieknooijens opened this issue 3 years ago • 1 comments

Hi there.

As a software engineer for Omron NL I was searching for a solution to load microcode from the EFI-shell (would help us with an issue we have in one of our IPC's) and I stumbled upon this project (since it had the PatchMicroCode function). Unfortunately I'm unable to compile it. Since I work from home due to the pandemic I can't access my linux machines (VPN they use is windows only) so Instead I've set up WSL2 with ubuntu 20.04, downloaded EDK2 and compiled the basetools, MdePkg and OVMF package. all worked fine. I then proceeded by copying the EdkiiShellToolPkg to the edk2 folder and set the ACTIVE_PLATFORM to EdkiiShellToolPkg/EdkiiShellToolPkg.dsc

unfortunately I ended up with this: `Build environment: Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29 Build start time: 14:00:32, Jun.14 2021

WORKSPACE = /home/noonie/edk2 EDK_TOOLS_PATH = /home/noonie/edk2/BaseTools

Processing meta-data .CONF_PATH = /home/noonie/edk2/Conf PYTHON_COMMAND = /usr/bin/python3.8

Architecture(s) = X64 Build target = DEBUG Toolchain = GCC5

Active Platform = /home/noonie/edk2/EdkiiShellToolPkg/EdkiiShellToolPkg.dsc

build.py... /home/noonie/edk2/EdkiiShellToolPkg/EdkiiShellToolPkg.dsc(...): error 4000: Instance of library class [RegisterFilterLib] is not found in [/home/noonie/edk2/MdePkg/Library/BaseLib/BaseLib.inf] [X64] consumed by module [/home/noonie/edk2/EdkiiShellToolPkg/Gcd/Gcd.inf]

  • Failed - Build end time: 14:00:32, Jun.14 2021 Build total time: 00:00:00

`

Any idea what's going wrong?

thanks! Niek

Edit: when compiling against edk2-stable202011 it works, but a newer EDK2 will break this project!

nieknooijens avatar Jun 14 '21 12:06 nieknooijens

@nieknooijens, add library class RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf to [LibraryClasses]. It should look something like this:

[LibraryClasses]
  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
  ...
  RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf

Also, AtaInfo will not compile correctly with GCC. If you need this component, fix it like in this commit: https://github.com/jyao1/EdkiiShellTool/commit/ca3b57812bb1bfbbe3a94ffbf0633c664d44abd0. Otherwise, just comment out this line: EdkiiShellToolPkg.dsc#L121

yeggor avatar Oct 12 '21 10:10 yeggor