From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.groups.io with SMTP id smtpd.web11.51319.1675683435762084038 for ; Mon, 06 Feb 2023 03:37:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OqFUW4tn; spf=pass (domain: gmail.com, ip: 209.85.218.47, mailfrom: ritul.bits@gmail.com) Received: by mail-ej1-f47.google.com with SMTP id gr7so33280764ejb.5 for ; Mon, 06 Feb 2023 03:37:15 -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=h54yq2xvUpkZnh/u9CVoe7rZ7+uLW3db7A9HqYGtu/0=; b=OqFUW4tn1TqLVI9BcZaoKQAax2V6Qc8etNhAQJI+l9xS4JmlVdTvDQ/MCc6xAKoNpF cMkHIDEiFvPkunvh8Krerb7TXdL3zNv62IwT4bkk4n/4o2Y210N8yV09YiKrmEOGK+SR VuNyde5IT16VeIHG8Cvhnd/Dl5PLWFPv1lgZ2KzTcrXm2YZl4Ggf1an3KJEh/Heqms41 bABVePygPUXuJNI70oKCvdCCD4lIzZzYV8HI06U0O2FnKHmRVxJFCA/4emxjkJRAPerC lUskUWMfPBUvDVJ0Cimg5FEyuz3XVwl5TmZLqbtqM9BqDDMtpdo95CGdEt8j1VhAGcVA KdUg== 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=h54yq2xvUpkZnh/u9CVoe7rZ7+uLW3db7A9HqYGtu/0=; b=b8X9uiQTORXa1dexvVl2ymJsMjiQ7xIRJMATt8tOiXA5zsGH9jenTuQXPqMoMwGDMM 9c4iRQfNURPM34fMv5Zpfh9tvtIE9qjpn0DGJxuM4MpRhxKMTb6dYVc6oxi81YT9hJjB /IIhmcHFfscnTZcW44Nbnk59pzXS5dxQG1NyuQH6s9SZRBkU9t/w/j+qYBnfAX9GBtes NLbh7Ix1ZdTRcl+tFNrsPfNxxptxaBnjQ1Xo8Rj5IAb8U7YxWjq8wevje8cLZb0I5SIP C/BU67Sh50QiPxPeLTNKZ8FsRF0j/v6GNw7tZEhDGINaxRBnRQn3Uq8pyBxqACXJC/Vy pm9w== X-Gm-Message-State: AO0yUKWBuV20fbw+wPYTNNfS1v5wg+lc/YZlBHWBb2JbnAQxOQBDU3rj bmPOGtz6W5qLvWRDa18yzhGILDO8/3ZzGNSDYX0= X-Google-Smtp-Source: AK7set8hL9x5zRJSHwZlin3JFoGjCOMKSVKcHdDZg5og3r3Ja/McSUCLR459Rv/Wlxg9plOWSlc42av3D7mr43b21uQ= X-Received: by 2002:a17:906:6611:b0:880:575f:b20c with SMTP id b17-20020a170906661100b00880575fb20cmr5001646ejp.177.1675683434023; Mon, 06 Feb 2023 03:37:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: ritul guru Date: Mon, 6 Feb 2023 17:07:01 +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="000000000000d74ceb05f406735c" --000000000000d74ceb05f406735c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 & RegardsRitul 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 > --000000000000d74ceb05f406735c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks,

17:05 $ ./UefiPayloadPkg/UniversalP= ayloadBuild.sh -t GCC5 -a IA32 -a X64 -D CPU_TIMER_LIB_ENABLE=3DFALSE
py= thon_exe=3D/usr/bin/python3.8
"llvm-objcopy" --version
/bin= /sh: 1: llvm-objcopy: not found
- Failed - error happened when run comma= nd: "llvm-objcopy" --version
- Failed - Please check if LLVM i= s installed or if CLANG_BIN is set correctly
=E2=9C=98-1 ~/src/opensourc= e/edk2 [master =E2=86=93=C2=B722|=E2=9C=9A 1]


= I am seeing above errors, is clang required for UniversalPayloadBuild.sh co= mpilation?



Thanks & Regards
Ritul Guru
+91-99= 16513186


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

I just quickly check your command, look like i= t incorrect 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_D= EFCONFIG=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<= /u>

    bash UefiPayloadPkg/Uni= versalPayloadBuild.sh -t GCC5 -a IA32 -D CPU_TIMER_LIB_ENABLE=3DFALSE

    =C2=A0

    • ShimLayer

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

    cd ShimLayer<= /u>

    bash CorebootShimBuild.= sh

    =C2=A0

    • Test Procedure
    1. Copy "ShimLayer/Build/ShimLayer.elf" and "Edk2/Build/Uefi= PayloadPkgX64/UniversalPayload.elf" to =E2=80=9CCoreboot/build=E2=80= =9D.

    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 ShimLayer.elf<= /p>

    ./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

--000000000000d74ceb05f406735c--