From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.web11.58857.1675702274671087385 for ; Mon, 06 Feb 2023 08:51:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e5uKZsr/; spf=pass (domain: gmail.com, ip: 209.85.218.41, mailfrom: ritul.bits@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id mc11so35941985ejb.10 for ; Mon, 06 Feb 2023 08:51:14 -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=D7QoFB957gxkN2jW1bK6ICWofx3Y6+W1v1WIE1kXaTk=; b=e5uKZsr/HZRi/ZcjHqS1B204Yy072dEEj7O9Q1fiFpHeNg9xE7eeeEPCQ9NsJbOFC0 zhjywT7GLk/zCparL47b/Yre6DMagcnssxU9pqLRo7szB8JyKqiGDVvkEWCkckCUEwEG 3Qwnr3mCzScR7b6Yz57jCk7TlFJEDxc/cuTiTzdYEVGtTG7LjWdADYabGlDnzhDW4Mea YMHc0jXAmRAOSwF80gVYizxPoABZkLAJ7goRpGR7Q2xNQ06KTvfp6ArVqYaouIqx27oe FtU7gy8QhsITjb5EkP5Yri9cLGQrQjwN3uUWiKh3TENT0vSjYV640ZVAA9Bbw/52Xs1h SdJg== 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=D7QoFB957gxkN2jW1bK6ICWofx3Y6+W1v1WIE1kXaTk=; b=fXZ/o48+bpSU+dkm/KKXxNslNrJzbICNQmrpDeJuTcM9Jn9ZQEoh0NRFRwoEfs5cj4 FxDNA8q7InYvT3k8X+EFfTc7qkxVB989jQsjiSPGNk1nk74xHwEXRSbpUe8hmWiFLGFN Zf+y0u9WeXKp3uY9kvui+WuR+xrR+PXzb+HTvokPIspJv7IcjF4//z5WYOVpINQRZD8z kxMWOrHAEEFaecjE/er4G53v6VkBAcBdMhhudo3RDHNGtWKBpuUivRqMlw9Xus04oaRc AV/dI160tky5XHaZ6oHT401Ym4R2SPA7zSHacBy51qsd6Iq83//Y2PYUTQAJNdGhv10w Ic3w== X-Gm-Message-State: AO0yUKXRX9mDu8Rg5tR2nZwstSCiRhiw9ZMyL45pG61LS2Duq5da56kr tvF6c2OSbmxvDjroEZvFauWdyEMbzeGO5EFQTSE= X-Google-Smtp-Source: AK7set/BONZg+JT9pl+XuDq8SlNiSk3kWgMLHwUTlU+IJlvLSZNlmPZ7VahTUFs+FZmxKBkHHIMTEp9NuLnqYhqWJSU= X-Received: by 2002:a17:906:6611:b0:880:575f:b20c with SMTP id b17-20020a170906661100b00880575fb20cmr5316470ejp.177.1675702273063; Mon, 06 Feb 2023 08:51:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: ritul guru Date: Mon, 6 Feb 2023 22:21:00 +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="000000000000bc3f8705f40ad6ae" --000000000000bc3f8705f40ad6ae Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable PATH=3D$PATH:/usr/bin/clang yes, set it as above. *Thanks & RegardsRitul Guru+91-9916513186* On Mon, Feb 6, 2023 at 8:43 PM Guo, Gua wrote: > Do you set clang bin path ? > > > > *From:* ritul guru > *Sent:* Monday, February 6, 2023 11:12 PM > *To:* Guo, Gua > *Cc:* devel@edk2.groups.io; Mike Maslenkin > *Subject:* Re: [edk2-devel] regarding build uefipayload in debug mode in > linux > > > > 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/UefiUniversalPayloadE= ntry.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/UniversalPayl= oadEntry.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/BaseUefiCpu= Lib.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-pragma= s > -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= /UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib/OUTPUT/./BaseUefiCpuLib.o= bj > -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/IA= 32/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/BaseUefiCpu= Lib.c > /bin/sh: 1: clang: not found > make: *** [GNUmakefile:344: > /home/a/src/opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32= /UefiCpuPkg/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/IA3= 2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib] > > > build.py... > : error F002: Failed to build module > /home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpu= Lib.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/UefiUniversalPayloadE= ntry.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/UefiUniversalPayloadE= ntry.txt > -D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE > > > > > > > > *Thanks & Regards Ritul 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 & Regards Ritul 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 WOR= KSPACE 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/cla= ng+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=9CCorebo= ot/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 lzma > > 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/BuildAndInte= grationInstructions.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/BuildAndInte= grationInstructions.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/WorkspaceDa= tabase.py", > line 104, in __getitem__ > > BuildObject =3D self.CreateBuildObject(FilePath, Arch, Target, > Toolchain) > > File > "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/WorkspaceDa= tabase.py", > line 120, in CreateBuildObject > > MetaFileStorage(self.WorkspaceDb, FilePath, FileType) > > File > "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/MetaFileTab= le.py", > line 426, in __new__ > > reval =3D Class._FILE_TABLE_[FileType](*Args) > > File > "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/MetaFileTab= le.py", > line 303, in __init__ > > MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DSC, > Temporary, FromItem) > > File > "/home//src/opensource/edk2/BaseTools/Source/Python/Workspace/MetaFileTab= le.py", > line 39, in __init__ > > MetaFile.TimeStamp, > > File > "/home//src/opensource/edk2/BaseTools/Source/Python/Common/Misc.py", line > 1539, in TimeStamp > > return os.stat(self.Path)[8] > > File > "/home//src/opensource/edk2/BaseTools/Source/Python/Common/LongFilePathOs= .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 > > --000000000000bc3f8705f40ad6ae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
PATH=3D$PATH:/usr/bin/clang

yes, set = it as above.

Thanks & Regards
Ritul Guru
+91-9916513186


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

Do you set clang bin path ?

=C2=A0

From: ritul guru <ritul.bits@gmail.com>
Sent: Monday, February 6, 2023 11:12 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

getting below error:

=C2=A0

build -p UefiPayloadPkg/UefiPayloadPkg.dsc -b = DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEnt= ry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2/Build/UefiPayloadPkgX64= /UefiUniversalPayloadEntry.txt =C2=A0-D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE
Build environment: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-gli= bc2.29
Build start time: 20:37:47, Feb.06 2023

WORKSPACE =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /home/a/src/opensource/edk2
EDK_TOOLS_PATH =C2=A0 =3D /home/a/src/opensource/edk2/BaseTools
CONF_PATH =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /home/a/src/opensource/edk2/Conf PYTHON_COMMAND =C2=A0 =3D /usr/bin/python3.8


Processing meta-data .
Architecture(s) =C2=A0=3D IA32 X64
Build target =C2=A0 =C2=A0 =3D DEBUG
Toolchain =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D CLANGDWARF

Active Platform =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /home/a/src/opensourc= e/edk2/UefiPayloadPkg/UefiPayloadPkg.dsc
Active Module =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D /home/a/src/open= source/edk2/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
.build: : warning: The PCD was not specified by any INF module in the platf= orm 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 platfo= rm 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/= BaseUefiCpuLib.inf [IA32]
"clang" =C2=A0-g -Os -fshort-wchar -fno-builtin -fno-strict-alias= ing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -ffuncti= on-sections -fdata-sections -DSTRING_ARRAY_NAME=3DBaseUefiCpuLibStrings -Wn= o-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unuse= d-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-unused-but-s= et-variable -Wno-unused-const-variable -Wno-unaligned-access -fno-stack-pro= tector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-r= edeclaration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float= -mno-implicit-float -ftrap-function=3Dundefined_behavior_has_been_optimize= d_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -m32 -Oz -flto -march=3Di586 -target i686-pc-linux-g= nu -g -malign-double -D DISABLE_NEW_DEPRECATED_INTERFACES -c -o /home/a/src= /opensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/UefiCpuPkg/L= ibrary/BaseUefiCpuLib/BaseUefiCpuLib/OUTPUT/./BaseUefiCpuLib.obj -I/home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/Ia32 -I/ho= me/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib -I/home/a/src/op= ensource/edk2/Build/UefiPayloadPkgX64/DEBUG_CLANGDWARF/IA32/UefiCpuPkg/Libr= ary/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/Uef= iCpuPkg -I/home/a/src/opensource/edk2/UefiCpuPkg/Include /home/a/src/opensource/edk2/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuL= ib.c
/bin/sh: 1: clang: not found
make: *** [GNUmakefile:344: /home/a/src/opensource/edk2/Build/UefiPayloadPk= gX64/DEBUG_CLANGDWARF/IA32/UefiCpuPkg/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_CLAN= GDWARF/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/UefiPay= loadPkg.dsc -b DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadEntry/Univ= ersalPayloadEntry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2/Build/Ue= fiPayloadPkgX64/UefiUniversalPayloadEntry.txt =C2=A0-D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE
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 108, = in BuildUniversalPayload
=C2=A0 =C2=A0 RunCommand(BuildModule)
=C2=A0 File "UefiPayloadPkg/UniversalPayloadBuild.py", line 51, i= n RunCommand
=C2=A0 =C2=A0 raise Exception("ERROR: when run command: %s"%cmd)<= br> Exception: ERROR: when run command: build -p UefiPayloadPkg/UefiPayloadPkg.= dsc -b DEBUG -a IA32 -a X64 -m UefiPayloadPkg/UefiPayloadEntry/UniversalPay= loadEntry.inf -t CLANGDWARF -y /home/a/src/opensource/edk2/Build/UefiPayloa= dPkgX64/UefiUniversalPayloadEntry.txt =C2=A0-D UNIVERSAL_PAYLOAD=3DTRUE -D CPU_TIMER_LIB_ENABLE=3DFALSE

=C2=A0

=C2=A0

Thanks & Regards
Ritul Guru
+91-9916513186

=C2=A0

=C2=A0

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

thanks,

=C2=A0

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

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

./cbfstool coreboot.rom remove -r COREBOOT -n img/UniversalPayload<= /u>

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

=C2=A0

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

=C2=A0

Thanks & Regards
Ritul Guru
+91-9916513186

=C2=A0

=C2=A0

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<= /span>

=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

--000000000000bc3f8705f40ad6ae--