From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mx.groups.io with SMTP id smtpd.web11.55777.1675696343215714323 for ; Mon, 06 Feb 2023 07:12:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FKUKI2wR; spf=pass (domain: gmail.com, ip: 209.85.218.49, mailfrom: ritul.bits@gmail.com) Received: by mail-ej1-f49.google.com with SMTP id ml19so35254848ejb.0 for ; Mon, 06 Feb 2023 07:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lIyGqPgi2VAXY4iH+mqTghsSNeyeV8lhCagrG1SiSag=; b=FKUKI2wReaJLbcD6MaEROcqFkWbwCt6dWTXlgGj1M3RuhDR5fYyjk6pd6iCTagNVST BljbfxVFH2e6I0cHBflAcnF5OWZIulAcnzfPE0gED+aYK58X8HoF9k8PHKTPCZ+pg9Gx cHvhbfLcDrVFovOMeAOo0JIGDNnuCdj2rztSbbZrjPp0HYCw9xGr4dwvyC85fM033QQP 4mh4aKaDVNsEFs5ByxbO4lY39AWS3Hc7ieo0VJNNqJjFwD9biAMFKUUFb22EY3FxBA70 LAU81RajhU4PBWTfPkn+y5O8C2XKW9uIOjb2tbyf8dWPGId6ygbsm02mYLDrh6TtlONL 4dMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lIyGqPgi2VAXY4iH+mqTghsSNeyeV8lhCagrG1SiSag=; b=paDm/40orcmFYDD0xsGSwhxVIIChFGEXnAIYq4GBPOGdSpYMOsmaVz3EZ5e0wWLfd1 ZDz10PEd2ZpY1ugjqXYr8jMIExvKxke1YCQc+gEeU1dlgjOSxH7/llAHVvbDqn0UgkG0 /ZhyqON9/cqMWVgTy85dL7PKxdxFcxdDh2olVFqzmAIWEVlmbEgo+vfPZZtr5r/t3jDd HYUV95F0RKRQh3jN/5ZFqU2R6UZi3yaYuzOetuTBqZ23dzdl+Sahkstrda+5/o05K3+n s4l0WFaFLtOnTmbqobbCx5UUCN5bvny58F2fhVy2M6VdtGPFMnsAD8BQL+iNMp+/QUku WKIA== X-Gm-Message-State: AO0yUKVAAm0Sg5xVUgn/iyF8uvRLj2zHF0dGKVAXgvx1bGxUjjKxnywu LmAbu25uDPj3FIpVSa8Z8lcvKM73wfPY9weiZGM= X-Google-Smtp-Source: AK7set9/X9C0lfExj3e9ypNkXoKM/skGKGDFlBGgcMiX+m9gAcTCNY0jagcPYT/7RM+1X8ziHeEynIam2xrRb7yxVpY= X-Received: by 2002:a17:906:6611:b0:880:575f:b20c with SMTP id b17-20020a170906661100b00880575fb20cmr5210683ejp.177.1675696341619; Mon, 06 Feb 2023 07:12:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: ritul guru Date: Mon, 6 Feb 2023 20:42:08 +0530 Message-ID: Subject: Re: [edk2-devel] regarding build uefipayload in debug mode in linux To: "Guo, Gua" Cc: "devel@edk2.groups.io" , Mike Maslenkin Content-Type: multipart/alternative; boundary="00000000000031957005f40975c8" --00000000000031957005f40975c8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable getting below error: build -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/UefiUniversalPayloadEnt= ry.txt -D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE Build environment: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29 Build start time: 20:37:47, Feb.06 2023 WORKSPACE =3D /home/a/src/opensource/edk2 EDK_TOOLS_PATH =3D /home/a/src/opensource/edk2/BaseTools CONF_PATH =3D /home/a/src/opensource/edk2/Conf PYTHON_COMMAND =3D /usr/bin/python3.8 Processing meta-data . Architecture(s) =3D IA32 X64 Build target =3D DEBUG Toolchain =3D CLANGDWARF Active Platform =3D /home/a/src/opensource/edk2/UefiPayloadPkg/UefiPayloadPkg.dsc Active Module =3D /home/a/src/opensource/edk2/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloa= dEntry.inf .build: : warning: The PCD was not specified by any INF module in the platform for the given architecture. PCD: [gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister] Platform: [UefiPayloadPkg.dsc] Arch: ['IA32'] build: : warning: The PCD was not specified by any INF module in the platform for the given architecture. PCD: [gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister] Platform: [UefiPayloadPkg.dsc] Arch: ['IA32'] done! Generating code . done! Generating makefile . done! Building ... /home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLi= b.inf [IA32] "clang" -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=3DBaseUefiCpuLibStrings -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-unaligned-access -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-implicit-float -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -m32 -Oz -flto -march=3Di586 -target i686-pc-linux-gnu -g -malign-double -D DISABLE_NEW_DEPRECATED_INTERFACES -c -o /home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/U= efiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib/OUTPUT/./BaseUefiCpuLib.obj -I/home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/Ia32 -I/home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib -I/home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32= /UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib/DEBUG -I/home/a/src/opensource/edk2/MdePkg -I/home/a/src/opensource/edk2/MdePkg/Include -I/home/a/src/opensource/edk2/MdePkg/Test/UnitTest/Include -I/home/a/src/opensource/edk2/MdePkg/Include/Ia32 -I/home/a/src/opensource/edk2/UefiCpuPkg -I/home/a/src/opensource/edk2/UefiCpuPkg/Include /home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLi= b.c /bin/sh: 1: clang: not found make: *** [GNUmakefile:344: /home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/U= efiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib/OUTPUT/BaseUefiCpuLib.obj] Error 127 build.py... : error 7000: Failed to execute command make tbuild [/home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/= UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib] build.py... : error F002: Failed to build module /home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLi= b.inf [IA32, CLANGDWARF, DEBUG] - Failed - Build end time: 20:37:54, Feb.06 2023 Build total time: 00:00:07 - Failed - error happened when run command: build -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/UefiUniversalPayloadEnt= ry.txt -D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE Traceback (most recent call last): File "UefiPayloadPkg/UniversalPayloadBuild.py", line 172, in main() File "UefiPayloadPkg/UniversalPayloadBuild.py", line 168, in main BuildUniversalPayload(args, MacroList) File "UefiPayloadPkg/UniversalPayloadBuild.py", line 108, in BuildUniversalPayload RunCommand(BuildModule) File "UefiPayloadPkg/UniversalPayloadBuild.py", line 51, in RunCommand raise Exception("ERROR: when run command: %s"%cmd) Exception: ERROR: when run command: build -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/UefiUniversalPayloadEnt= ry.txt -D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE *Thanks & RegardsRitul Guru+91-9916513186* On Mon, Feb 6, 2023 at 8:23 PM ritul guru wrote: > thanks, > > ./cbfstool coreboot.rom remove -r COREBOOT -n fallback/payload > > ./cbfstool coreboot.rom add-payload -r COREBOOT -n fallback/payload -f > ShimLayer.elf > > ./cbfstool coreboot.rom remove -r COREBOOT -n img/UniversalPayload > > ./cbfstool coreboot.rom add-flat-binary -r COREBOOT -n > img/UniversalPayload -f UniversalPayload.elf -l 0x200000 -e 0x100 -c lzma > > > with above commands, we can inject shim.elf and uefipayload.elf into > coreboot image, and should be able to boot from this payload? > > > > *Thanks & RegardsRitul Guru+91-9916513186* > > > On Mon, Feb 6, 2023 at 7:56 PM Guo, Gua wrote: > >> I think you can run =E2=80=9C. edksetup.sh=E2=80=9D in your local and WO= RKSPACE will be >> setup automatically. >> >> >> >> *From:* ritul guru >> *Sent:* Monday, February 6, 2023 10:22 PM >> *To:* Guo, Gua >> *Cc:* devel@edk2.groups.io; Mike Maslenkin >> *Subject:* Re: [edk2-devel] regarding build uefipayload in debug mode in >> linux >> >> >> >> workspace needs to be set to any value? >> >> >> >> 0 $ bash UefiPayloadPkg/UniversalPayloadBuild.sh -t GCC5 -a IA32 -a X64 >> -D CPU_TIMER_LIB_ENABLE=3DFALSE >> python_exe=3D >> Traceback (most recent call last): >> File "UefiPayloadPkg/UniversalPayloadBuild.py", line 172, in >> main() >> File "UefiPayloadPkg/UniversalPayloadBuild.py", line 168, in main >> BuildUniversalPayload(args, MacroList) >> File "UefiPayloadPkg/UniversalPayloadBuild.py", line 58, in >> BuildUniversalPayload >> BuildDir =3D os.path.join(os.environ['WORKSPACE'], >> os.path.normpath("Build/UefiPayloadPkgX64")) >> File "/usr/lib/python3.8/os.py", line 675, in __getitem__ >> raise KeyError(key) from None >> KeyError: 'WORKSPACE' >> >> >> >> >> >> >> >> *Thanks & Regards Ritul Guru +91-9916513186* >> >> >> >> >> >> On Mon, Feb 6, 2023 at 5:17 PM Guo, Gua wrote: >> >> UniversalPayload.sh have Clang tool chain dependency. >> >> >> >> I assume your machine is ubuntu-20.10, please download it. And set use >> export PATH=3D$PATH: to prevent the issue. >> >> >> >> >> https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/cl= ang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz >> >> >> >> Thanks, >> >> Gua >> >> >> >> *From:* ritul guru >> *Sent:* Monday, February 6, 2023 7:37 PM >> *To:* Guo, Gua >> *Cc:* devel@edk2.groups.io; Mike Maslenkin >> *Subject:* Re: [edk2-devel] regarding build uefipayload in debug mode in >> linux >> >> >> >> Thanks, >> >> >> >> 17:05 $ ./UefiPayloadPkg/UniversalPayloadBuild.sh -t GCC5 -a IA32 -a X64 >> -D CPU_TIMER_LIB_ENABLE=3DFALSE >> python_exe=3D/usr/bin/python3.8 >> "llvm-objcopy" --version >> /bin/sh: 1: llvm-objcopy: not found >> - Failed - error happened when run command: "llvm-objcopy" --version >> - Failed - Please check if LLVM is installed or if CLANG_BIN is set >> correctly >> =E2=9C=98-1 ~/src/opensource/edk2 [master =E2=86=93=C2=B722|=E2=9C=9A 1] >> >> >> >> >> >> I am seeing above errors, is clang required for UniversalPayloadBuild.sh >> compilation? >> >> >> >> >> >> >> >> >> >> *Thanks & Regards Ritul Guru +91-9916513186* >> >> >> >> >> >> On Mon, Feb 6, 2023 at 6:23 AM Guo, Gua wrote: >> >> I just quickly check your command, look like it incorrect UefiPayload >> >> >> >> For Uefi Payload >> >> - build -p "UefiPayloadPkg/UefiPayloadPkg.dsc" -b DEBUG -t GCC5 -a >> IA32 -a X64 -D BOOTLOADER=3DCOREBOOT >> >> >> >> For Uefi Universal Payload >> >> - *Coreboot * >> >> git clone https://github.com/StarLabsLtd/coreboot.git Coreboot >> >> cd Coreboot >> >> git submodule update --init >> >> make iasl >> >> make crossgcc >> >> make defconfig KBUILD_DEFCONFIG=3Dconfig.starlabs_qemu >> >> make >> >> >> >> - *Edk2* >> >> git clone https://github.com/tianocore/edk2.git Edk2 >> >> cd Edk2 >> >> git submodule update --init >> >> source ./edksetup.sh >> >> make -C ./BaseTools >> >> bash UefiPayloadPkg/UniversalPayloadBuild.sh -t GCC5 -a IA32 -D >> CPU_TIMER_LIB_ENABLE=3DFALSE >> >> >> >> - *ShimLayer* >> >> git clone >> https://github.com/UniversalScalableFirmware/upl.coreboot.shimlayer >> ShimLayer >> >> cd ShimLayer >> >> bash CorebootShimBuild.sh >> >> >> >> - *Test Procedure* >> >> >> 1. Copy "ShimLayer/Build/ShimLayer.elf" and >> "Edk2/Build/UefiPayloadPkgX64/UniversalPayload.elf" to =E2=80=9CCoreb= oot/build=E2=80=9D. >> >> 2. cd Coreboot/build >> >> 3. Do the following commands. >> >> ./cbfstool coreboot.rom remove -r COREBOOT -n fallback/payload >> >> ./cbfstool coreboot.rom add-payload -r COREBOOT -n fallback/payload -f >> ShimLayer.elf >> >> ./cbfstool coreboot.rom remove -r COREBOOT -n img/UniversalPayload >> >> ./cbfstool coreboot.rom add-flat-binary -r COREBOOT -n >> img/UniversalPayload -f UniversalPayload.elf -l 0x200000 -e 0x100 -c lzm= a >> >> qemu-system-x86_64 -bios coreboot.rom -serial stdio -M q35 >> >> >> >> Thanks, >> >> Gua >> >> *From:* devel@edk2.groups.io *On Behalf Of *ritul >> guru >> *Sent:* Friday, February 3, 2023 11:08 PM >> *To:* Mike Maslenkin >> *Cc:* devel@edk2.groups.io >> *Subject:* Re: [edk2-devel] regarding build uefipayload in debug mode in >> linux >> >> >> >> Thanks, >> >> >> >> build -p "UefiPayloadPkg/UefiPayloadPkg.dsc" *-b DEBUG* -t GCC5 -a IA32 >> -a X64 -D COREBOOT >> >> >> >> I used above cmd, added DEBUG option by seeing NO debug messages coming >> from uefipayload. >> >> any idea how to enable debug messages coming from uefipayload built with >> above cmd? >> >> >> >> >> >> >> >> >> >> >> >> *Thanks & Regards Ritul Guru +91-9916513186* >> >> >> >> >> >> On Fri, Feb 3, 2023 at 4:46 AM Mike Maslenkin >> wrote: >> >> Hi Ritul Guru. >> >> There is a misprint in path to dsc file. >> The path should be "UefiPayloadPkg/UefiPayloadPkg.dsc" >> But there is another issue with your command line exists. >> The instructions you are referred to [1] contain a sentence: >> "NOTE: Pure 32bit UEFI payload support could be added if required >> later.", i.e. it won't build. >> So, you need to build either pure X64 or X64 build with IA32 entry. >> >> The command line for the latter is: >> "build -p UefiPayloadPkg/UefiPayloadPkg.dsc -t GCC5 -a IA32 -a X64" >> >> *[1] >> https://github.com/tianocore/edk2/blob/master/UefiPayloadPkg/BuildAndInt= egrationInstructions.txt#L55 >> >> Regards, >> Mike. >> >> >> >> On Fri, Feb 3, 2023 at 1:37 AM ritul guru wrote: >> > >> > >> > Hi, >> > I was following below link to build UEfiPayload for coreboot to boot >> from, >> > >> > >> https://github.com/tianocore/edk2/blob/master/UefiPayloadPkg/BuildAndInt= egrationInstructions.txt >> > >> > but getting below error, >> > would appreciate help, thanks. >> > >> > >> > ~/src/opensource/edk2 [master| ] >> > 03:04 $ build -p UefiPayloadPkg\UefiPayloadPkg.dsc -t GCC5 -a IA32 >> > Build environment: >> Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29 >> > Build start time: 03:04:57, Feb.03 2023 >> > >> > WORKSPACE =3D /home//src/opensource/edk2 >> > EDK_TOOLS_PATH =3D /home//src/opensource/edk2/BaseTools >> > CONF_PATH =3D /home//src/opensource/edk2/Conf >> > PYTHON_COMMAND =3D /usr/bin/python3.8 >> > >> > >> > build.py... >> > : error C0DE: Unknown fatal error when processing >> [/home//src/opensource/edk2/UefiPayloadPkgUefiPayloadPkg.dsc] >> > >> > (Please send email to devel@edk2.groups.io for help, attaching >> following call stack trace!) >> > >> > (Python 3.8.10 on linux) Traceback (most recent call last): >> > File >> "/home//src/opensource/edk2/BaseTools/BinWrappers/PosixLike/../../Source= /Python/build/build.py", >> line 2692, in Main >> > MyBuild =3D Build(Target, Workspace, Option,LogQ) >> > File >> "/home//src/opensource/edk2/BaseTools/BinWrappers/PosixLike/../../Source= /Python/build/build.py", >> line 815, in __init__ >> > self.InitPreBuild() >> > File >> "/home//src/opensource/edk2/BaseTools/BinWrappers/PosixLike/../../Source= /Python/build/build.py", >> line 1015, in InitPreBuild >> > self.LoadConfiguration() >> > File >> "/home//src/opensource/edk2/BaseTools/BinWrappers/PosixLike/../../Source= /Python/build/build.py", >> line 971, in LoadConfiguration >> > self.GetToolChainAndFamilyFromDsc (self.PlatformFile) >> > File >> "/home//src/opensource/edk2/BaseTools/BinWrappers/PosixLike/../../Source= /Python/build/build.py", >> line 905, in GetToolChainAndFamilyFromDsc >> > dscobj =3D self.BuildDatabase[File, BuildArch] >> > File >> "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/WorkspaceD= atabase.py", >> line 104, in __getitem__ >> > BuildObject =3D self.CreateBuildObject(FilePath, Arch, Target, >> Toolchain) >> > File >> "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/WorkspaceD= atabase.py", >> line 120, in CreateBuildObject >> > MetaFileStorage(self.WorkspaceDb, FilePath, FileType) >> > File >> "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/MetaFileTa= ble.py", >> line 426, in __new__ >> > reval =3D Class._FILE_TABLE_[FileType](*Args) >> > File >> "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/MetaFileTa= ble.py", >> line 303, in __init__ >> > MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DSC, >> Temporary, FromItem) >> > File >> "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/MetaFileTa= ble.py", >> line 39, in __init__ >> > MetaFile.TimeStamp, >> > File >> "/home//src/opensource/edk2/BaseTools/Source/Python/Common/Misc.py", lin= e >> 1539, in TimeStamp >> > return os.stat(self.Path)[8] >> > File >> "/home//src/opensource/edk2/BaseTools/Source/Python/Common/LongFilePathO= s.py", >> line 51, in stat >> > return os.stat(LongFilePath(path)) >> > FileNotFoundError: [Errno 2] No such file or directory: >> '/home//src/opensource/edk2/UefiPayloadPkgUefiPayloadPkg.dsc' >> > >> > >> > >> > >> > >> > Thanks & Regards >> > Ritul Guru >> > +91-9916513186 >> >>=20 >> >> --00000000000031957005f40975c8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
getting below error:

build -p UefiPayloadPk= g/UefiPayloadPkg.dsc -b DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadE= ntry/UniversalPayloadEntry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2= /Build/UefiPayloadPkgX64/UefiUniversalPayloadEntry.txt =C2=A0-D UNIVERSAL_P= AYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE
Build environment: Linux-5= .10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29
Build start time= : 20:37:47, Feb.06 2023

WORKSPACE =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /ho= me/a/src/opensource/edk2
EDK_TOOLS_PATH =C2=A0 =3D /home/a/src/opensourc= e/edk2/BaseTools
CONF_PATH =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /home/a/src/op= ensource/edk2/Conf
PYTHON_COMMAND =C2=A0 =3D /usr/bin/python3.8

<= br>Processing meta-data .
Architecture(s) =C2=A0=3D IA32 X64
Build ta= rget =C2=A0 =C2=A0 =3D DEBUG
Toolchain =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D CL= ANGDWARF

Active Platform =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /home= /a/src/opensource/edk2/UefiPayloadPkg/UefiPayloadPkg.dsc
Active Module = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /home/a/src/opensource/edk2/Ue= fiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
.build: : warnin= g: The PCD was not specified by any INF module in the platform for the give= n architecture.
PCD: [gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister]=
Platform: [UefiPayloadPkg.dsc]
Arch: ['IA32']
build: : wa= rning: The PCD was not specified by any INF module in the platform for the = given architecture.
PCD: [gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegi= ster]
Platform: [UefiPayloadPkg.dsc]
Arch: ['IA32']
done!<= br>Generating code . done!
Generating makefile . done!
Building ... /= home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib= .inf [IA32]
"clang" =C2=A0-g -Os -fshort-wchar -fno-builtin -f= no-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-= common -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=3DBaseUefiCp= uLibStrings -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautol= ogical-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-vari= able -Wno-varargs -Wno-unknown-warning-option -Wno-unused-but-set-variable = -Wno-unused-const-variable -Wno-unaligned-access -fno-stack-protector -mms-= bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-= incompatible-library-redeclaration -fno-asynchronous-unwind-tables -mno-sse= -mno-mmx -msoft-float -mno-implicit-float -ftrap-function=3Dundefined_beha= vior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -W= no-null-dereference -m32 -Oz -flto -march=3Di586 -target i686-pc-linux-gnu = -g -malign-double -D DISABLE_NEW_DEPRECATED_INTERFACES -c -o /home/a/src/op= ensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/UefiCpuPkg/Libr= ary/BaseUefiCpuLib/BaseUefiCpuLib/OUTPUT/./BaseUefiCpuLib.obj -I/home/a/src= /opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/Ia32 -I/home/a/src/opens= ource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib -I/home/a/src/opensource/edk2/= Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/UefiCpuPkg/Library/BaseUefiCp= uLib/BaseUefiCpuLib/DEBUG -I/home/a/src/opensource/edk2/MdePkg -I/home/a/sr= c/opensource/edk2/MdePkg/Include -I/home/a/src/opensource/edk2/MdePkg/Test/= UnitTest/Include -I/home/a/src/opensource/edk2/MdePkg/Include/Ia32 -I/home/= a/src/opensource/edk2/UefiCpuPkg -I/home/a/src/opensource/edk2/UefiCpuPkg/I= nclude /home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUe= fiCpuLib.c
/bin/sh: 1: clang: not found
make: *** [GNUmakefile:344: /= home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/Ue= fiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib/OUTPUT/BaseUefiCpuLib.obj] E= rror 127


build.py...
: error 7000: Failed to execute command<= br>make tbuild [/home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_C= LANGDWARF/IA32/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib]

build.py...
: error F002: Failed to build module
/home/a/src/opensou= rce/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf [IA32, CLANGD= WARF, DEBUG]

- Failed -
Build end time: 20:37:54, Feb.06 2023
= Build total time: 00:00:07

- Failed - error happened when run comman= d: build -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -a IA32 -a X64 -m Ue= fiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf -t CLANGDWARF -y /h= ome/a/src/opensource/edk2/Build/UefiPayloadPkgX64/UefiUniversalPayloadEntry= .txt =C2=A0-D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE
T= raceback (most recent call last):
=C2=A0 File "UefiPayloadPkg/Unive= rsalPayloadBuild.py", line 172, in <module>
=C2=A0 =C2=A0 mai= n()
=C2=A0 File "UefiPayloadPkg/UniversalPayloadBuild.py", lin= e 168, in main
=C2=A0 =C2=A0 BuildUniversalPayload(args, MacroList)
= =C2=A0 File "UefiPayloadPkg/UniversalPayloadBuild.py", line 108, = in BuildUniversalPayload
=C2=A0 =C2=A0 RunCommand(BuildModule)
=C2=A0= File "UefiPayloadPkg/UniversalPayloadBuild.py", line 51, in RunC= ommand
=C2=A0 =C2=A0 raise Exception("ERROR: when run command: %s&q= uot;%cmd)
Exception: ERROR: when run command: build -p UefiPayloadPkg/Ue= fiPayloadPkg.dsc -b DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadEntry= /UniversalPayloadEntry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2/Bui= ld/UefiPayloadPkgX64/UefiUniversalPayloadEntry.txt =C2=A0-D UNIVERSAL_PAYLO= AD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE


Thanks & Regards
Ritul Guru
+91-99= 16513186


On Mon, Feb 6, 2023 at 8:23= PM ritul guru <ritul.bits@gmail= .com> wrote:
thanks,

./cbfstool coreboot.rom remove -r COREBOOT -n fallback/= payload

./cbfstool core= boot.rom add-payload -r COREBOOT -n fallback/payload -f ShimLayer.elf

./cbfstool coreboot.rom remo= ve -r COREBOOT -n img/UniversalPayload

./cbfstool coreboot.rom add-flat-binary -r COREBOOT -n img/= UniversalPayload -f UniversalPayload.elf -l 0x200000 -e 0x100 -c lzma


with above commands, we can inject shim.elf and uefipayload.elf into core= boot image, and should be able to boot from this payload?

Thanks & Regards
Ritul Guru
+91-991651= 3186


On Mon, Feb 6, 2023 at 7:56 PM = Guo, Gua <gua.guo= @intel.com> wrote:

I think you can run =E2=80=9C. edksetup.sh=E2= =80=9D in your local and WORKSPACE will be setup automatically.

=C2=A0

From: ritul guru <ritul.bits@gmail.com>
Sent: Monday, February 6, 2023 10:22 PM
To: Guo, Gua <gua.guo@intel.com>
Cc: devel@= edk2.groups.io; Mike Maslenkin <mike.maslenkin@gmail.com>
Subject: Re: [edk2-devel] regarding build uefipayload in debug mode = in linux

=C2=A0

workspace needs to be set to any value?=C2=A0<= u>

=C2=A0

0 $ bash UefiPayloadPkg/UniversalPayloadBuild.= sh -t GCC5 -a IA32 -a X64 -D CPU_TIMER_LIB_ENABLE=3DFALSE
python_exe=3D
Traceback (most recent call last):
=C2=A0 File "UefiPayloadPkg/UniversalPayloadBuild.py", line 172, = in <module>
=C2=A0 =C2=A0 main()
=C2=A0 File "UefiPayloadPkg/UniversalPayloadBuild.py", line 168, = in main
=C2=A0 =C2=A0 BuildUniversalPayload(args, MacroList)
=C2=A0 File "UefiPayloadPkg/UniversalPayloadBuild.py", line 58, i= n BuildUniversalPayload
=C2=A0 =C2=A0 BuildDir =C2=A0 =C2=A0 =3D os.path.join(os.environ['WORKS= PACE'], os.path.normpath("Build/UefiPayloadPkgX64"))
=C2=A0 File "/usr/lib/python3.8/os.py", line 675, in __getitem__<= br> =C2=A0 =C2=A0 raise KeyError(key) from None
KeyError: 'WORKSPACE'

=C2=A0

=C2=A0

Thanks & Regards
Ritul Guru
+91-9916513186

=C2=A0

=C2=A0

On Mon, Feb 6, 2023 at 5:17 PM Guo, Gua <gua.guo@intel.com> w= rote:

UniversalPayload.sh have Clang tool chain dependency= .

=C2=A0

I assume your machine is ubuntu-20.10, please downlo= ad it. And set use export PATH=3D$PATH:<Clang bin path> to prevent th= e issue.

=C2=A0

https://github.com/llvm/llvm-project/releases/d= ownload/llvmorg-11.1.0/clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.= xz

=C2=A0

Thanks,

Gua

=C2=A0

From: ritul guru <ritul.bits@gmail.com>
Sent: Monday, February 6, 2023 7:37 PM
To: Guo, Gua <gua.guo@intel.com>
Cc: devel@= edk2.groups.io; Mike Maslenkin <mike.maslenkin@gmail.com>
Subject: Re: [edk2-devel] regarding build uefipayload in debug mode = in linux

=C2=A0

Thanks,

=C2=A0

17:05 $ ./UefiPayloadPkg/UniversalPayloadBuild= .sh -t GCC5 -a IA32 -a X64 -D CPU_TIMER_LIB_ENABLE=3DFALSE
python_exe=3D/usr/bin/python3.8
"llvm-objcopy" --version
/bin/sh: 1: llvm-objcopy: not found
- Failed - error happened when run command: "llvm-objcopy" --vers= ion
- Failed - Please check if LLVM is installed or if CLANG_BIN is set correct= ly
=E2=9C=98-1 ~/src/opensource/= edk2 [master =E2=86=93=C2=B722|= =E2=9C=9A 1]

=C2=A0

=C2=A0

I am seeing above errors, is clang required fo= r UniversalPayloadBuild.sh compilation?

=C2=A0

=C2=A0

=C2=A0

Thanks & Regards
Ritul Guru
+91-9916513186

=C2=A0

=C2=A0

On Mon, Feb 6, 2023 at 6:23 AM Guo, Gua <gua.guo@intel.com> w= rote:

I just quickly check your command, look like it inco= rrect UefiPayload

=C2=A0

For Uefi Payload

  • build -p "UefiPayloadPkg/UefiPayloadPkg.dsc" -b DEBUG -t GCC5 -a = IA32 -a X64 -D BOOTLOADER=3DCOREBOOT

=C2=A0

For Uefi Universal Payload

  • Coreboot =

git clone https://github.com/StarLabsLtd/coreboot.git Coreboot=

cd Coreboot

git submodule update --init

make iasl

make crossgcc

make defconfig KBUILD_DEFCONFIG=3Dconfig.starlabs_qemu

make

=C2=A0

  • Edk2
  • =

git clone https://github.com/tianocore/edk2.git Edk2

cd Edk2

git submodule update --init

source ./edksetup.sh

make -C ./BaseTools

bash UefiPayloadPkg/UniversalPayloadBuild.sh -t GCC5 -a IA32 -D CPU_TIMER_L= IB_ENABLE=3DFALSE

=C2=A0

  • ShimLayer=

git clone https://github.com/UniversalScalableFirmware/upl.coreboot.shimlayer=C2= =A0 ShimLayer

cd ShimLayer

bash CorebootShimBuild.sh

=C2=A0

  • Test Procedure
  1. Copy "ShimLayer/Build/ShimLayer.elf" and "Edk2/Build/UefiPay= loadPkgX64/UniversalPayload.elf" to =E2=80=9CCoreboot/build=E2=80=9D.<= u>

2.=C2=A0=C2=A0=C2=A0 cd Coreboot/build

3.=C2=A0=C2=A0=C2=A0 Do the following commands.

./cbfstool coreboot.rom remove -r COREBOOT -n fallback/payload

./cbfstool coreboot.rom add-payload -r COREBOOT -n fallback/payload -f Shim= Layer.elf

./cbfstool coreboot.rom remove -r COREBOOT -n img/UniversalPayload

./cbfstool coreboot.rom add-flat-binary -r COREBOOT -n img/UniversalPayload= -f UniversalPayload.elf -l 0x200000 -e 0x100 -c lzma

qemu-system-x86_64 -bios coreboot.rom -serial stdio -M q35

=C2=A0

Thanks,

Gua

From: devel@edk2.groups= .io <devel= @edk2.groups.io> On Behalf Of ritul guru
Sent: Friday, February 3, 2023 11:08 PM
To: Mike Maslenkin <mike.maslenkin@gmail.com>
Cc: devel@= edk2.groups.io
Subject: Re: [edk2-devel] regarding build uefipayload in debug mode = in linux

=C2=A0

Thanks,

=C2=A0

build -p "UefiPayloadPkg/UefiPayloadPkg.d= sc" -b DEBUG -t GCC5 -a IA32 -a X64 -D COREBOOT

=C2=A0

I used above cmd, added DEBUG option by seeing= NO debug messages coming from uefipayload.

any idea how to enable debug messages coming f= rom uefipayload built with above cmd?

=C2=A0

=C2=A0

=C2=A0

=C2=A0

Thanks & Regards
Ritul Guru
+91-9916513186

=C2=A0

=C2=A0

On Fri, Feb 3, 2023 at 4:46 AM Mike Maslenkin <mike.maslenkin@= gmail.com> wrote:

Hi Ritul Guru.

There is a misprint in path to dsc file.
The path should be "UefiPayloadPkg/UefiPayloadPkg.dsc"
But there is another issue with your command line exists.
The instructions you are referred to [1]=C2=A0 contain a sentence:
"NOTE: Pure 32bit UEFI payload support could be added if required
later.", i.e. it won't build.
So, you need to build either pure X64 or X64 build with IA32 entry.

The command line for the latter is:
"build -p UefiPayloadPkg/UefiPayloadPkg.dsc -t GCC5 -a IA32 -a X64&quo= t;

*[1] https://github.com/tianocore/edk2/blob/master/UefiPayloadPkg/BuildAndIntegr= ationInstructions.txt#L55

Regards,
Mike.



On Fri, Feb 3, 2023 at 1:37 AM ritul guru <ritul.bits@gmail.com> wrote:
>
>
> Hi,
> I was following below link to build UEfiPayload for coreboot to boot f= rom,
>
> https://github.com/tianocore/edk2/blob/master/UefiPayloadPkg/BuildAndIntegr= ationInstructions.txt
>
> but getting below error,
> would appreciate help, thanks.
>
>
> ~/src/opensource/edk2 [master| ]
> 03:04 $ build -p UefiPayloadPkg\UefiPayloadPkg.dsc -t GCC5 -a IA32
> Build environment: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-wit= h-glibc2.29
> Build start time: 03:04:57, Feb.03 2023
>
> WORKSPACE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D /home//src/opensource/edk2 > EDK_TOOLS_PATH=C2=A0 =C2=A0=3D /home//src/opensource/edk2/BaseTools > CONF_PATH=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D /home//src/opensource/edk2/Co= nf
> PYTHON_COMMAND=C2=A0 =C2=A0=3D /usr/bin/python3.8
>
>
> build.py...
>=C2=A0 : error C0DE: Unknown fatal error when processing [/home//src/op= ensource/edk2/UefiPayloadPkgUefiPayloadPkg.dsc]
>
> (Please send email to devel@edk2.groups.io for help, attaching following call sta= ck trace!)
>
> (Python 3.8.10 on linux) Traceback (most recent call last):
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/BinWrapper= s/PosixLike/../../Source/Python/build/build.py", line 2692, in Main >=C2=A0 =C2=A0 =C2=A0MyBuild =3D Build(Target, Workspace, Option,LogQ) >=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/BinWrapper= s/PosixLike/../../Source/Python/build/build.py", line 815, in __init__=
>=C2=A0 =C2=A0 =C2=A0self.InitPreBuild()
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/BinWrapper= s/PosixLike/../../Source/Python/build/build.py", line 1015, in InitPre= Build
>=C2=A0 =C2=A0 =C2=A0self.LoadConfiguration()
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/BinWrapper= s/PosixLike/../../Source/Python/build/build.py", line 971, in LoadConf= iguration
>=C2=A0 =C2=A0 =C2=A0self.GetToolChainAndFamilyFromDsc (self.PlatformFil= e)
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/BinWrapper= s/PosixLike/../../Source/Python/build/build.py", line 905, in GetToolC= hainAndFamilyFromDsc
>=C2=A0 =C2=A0 =C2=A0dscobj =3D self.BuildDatabase[File, BuildArch]
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/Source/Pyt= hon/Workspace/WorkspaceDatabase.py", line 104, in __getitem__
>=C2=A0 =C2=A0 =C2=A0BuildObject =3D self.CreateBuildObject(FilePath, Ar= ch, Target, Toolchain)
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/Source/Pyt= hon/Workspace/WorkspaceDatabase.py", line 120, in CreateBuildObject >=C2=A0 =C2=A0 =C2=A0MetaFileStorage(self.WorkspaceDb, FilePath, FileTyp= e)
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/Source/Pyt= hon/Workspace/MetaFileTable.py", line 426, in __new__
>=C2=A0 =C2=A0 =C2=A0reval =3D Class._FILE_TABLE_[FileType](*Args)
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/Source/Pyt= hon/Workspace/MetaFileTable.py", line 303, in __init__
>=C2=A0 =C2=A0 =C2=A0MetaFileTable.__init__(self, Cursor, MetaFile, MODE= L_FILE_DSC, Temporary, FromItem)
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/Source/Pyt= hon/Workspace/MetaFileTable.py", line 39, in __init__
>=C2=A0 =C2=A0 =C2=A0MetaFile.TimeStamp,
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/Source/Pyt= hon/Common/Misc.py", line 1539, in TimeStamp
>=C2=A0 =C2=A0 =C2=A0return os.stat(self.Path)[8]
>=C2=A0 =C2=A0File "/home//src/opensource/edk2/BaseTools/Source/Pyt= hon/Common/LongFilePathOs.py", line 51, in stat
>=C2=A0 =C2=A0 =C2=A0return os.stat(LongFilePath(path))
> FileNotFoundError: [Errno 2] No such file or directory: '/home//sr= c/opensource/edk2/UefiPayloadPkgUefiPayloadPkg.dsc'
>
>
>
>
>
> Thanks & Regards
> Ritul Guru
> +91-9916513186

--00000000000031957005f40975c8--