Skip to contentSkip to conversation

efi: Update README.efi to clarify build and test instructions

PATCH Superseded Bin Meng 3 participants 6 messages Aug 15, 2015 – Aug 17, 2015

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH v2 1/1 efi: Update README.efi to clarify build and test instructions

The doc has a misleading 'make menuconfig' when building the EFI application and payload. Clarify this and also update information on test with QEMU.

---

Changes in v2:
- incorporate comments from Igor, clarify boolean options

 doc/README.efi | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
doc/README.efi +21 -11
index 7c95579..38b9ab1 100644
@@ -47,20 +47,25 @@ machine. You can use devices, boot a kernel, etc.
 Build Instructions
 ------------------
 First choose a board that has EFI support and obtain an EFI implementation
-for that board. It will be either 32-bit or 64-bit.
+for that board. It will be either 32-bit or 64-bit. Alternatively, you can
+opt for using QEMU [1] and the OVMF [2], as detailed below.
 
-To build U-Boot as an EFI application (32-bit EFI required), enable
-CONFIG_EFI and CONFIG_EFI_APP. The efi-x86 config is set up for this.
+To build U-Boot as an EFI application (32-bit EFI required), enable CONFIG_EFI
+and CONFIG_EFI_APP. The efi-x86 config (efi-x86_defconfig) is set up for this.
 
-To build U-Boot as an EFI payload (32-bit or 64-bit EFI can be used), adjust
-an existing config to enable CONFIG_EFI, CONFIG_EFI_STUB and either
-CONFIG_EFI_STUB_32BIT or CONFIG_EFI_STUB_64BIT.
+To build U-Boot as an EFI payload (32-bit or 64-bit EFI can be used), adjust an
+existing config (like qemu-x86_defconfig) to enable CONFIG_EFI, CONFIG_EFI_STUB
+and either CONFIG_EFI_STUB_32BIT or CONFIG_EFI_STUB_64BIT. All of these are
+boolean Kconfig options.
 
 Then build U-Boot as normal, e.g.
 
+For building an EFI application, run:
+   make efi-x86_defconfig
+   make
+
+For building an EFI payload, run:
    make qemu-x86_defconfig
-   make menuconfig    (or make xconfig if you prefer)
-   # change the settings as above
    make
 
 You will end up with one of these files:
@@ -71,8 +76,9 @@ You will end up with one of these files:
 
 Trying it out
 -------------
-Qemu is an emulator and it can emulate an x86 machine. You can run the
-payload with something like this:
+QEMU is an emulator and it can emulate an x86 machine. Please make sure your
+QEMU version is 2.3.0 or above to test this. You can run the payload with
+something like this:
 
    mkdir /tmp/efi
    cp /path/to/u-boot*.efi /tmp/efi
@@ -80,7 +86,8 @@ payload with something like this:
 
 Add -nographic if you want to use the terminal for output. Once it starts
 type 'fs0:u-boot-payload.efi' to run the payload or 'fs0:u-boot-app.efi' to
-run the application. 'bios.bin' is the EFI 'BIOS'.
+run the application. 'bios.bin' is the EFI 'BIOS'. Check [2] to obtain a
+prebuilt EFI BIOS for QEMU or you can build one from source as well.
 
 To try it on real hardware, put u-boot-app.efi on a suitable boot medium,
 such as a USB stick. Then you can type something like this to start it:
@@ -235,3 +242,6 @@ common/cmd_efi.c
 Ben Stoltz, Simon Glass
 Google, Inc
 July 2015
+
+[1] http://www.qemu.org
+[2] http://www.tianocore.org/ovmf/
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v2 1/1 efi: Update README.efi to clarify build and test instructions

Hello Bin,
a couple more of last-minute comments below:

Quoted 2 lines · Bin Meng

+For building an EFI payload, run:
make qemu-x86_defconfig

Since qemu-x86_defconfig was an example, maybe this could be written as:

make <selected defconfig, i.e. qemu-x86_defconfig> change EFI settings according to what described above make

Quoted 1 line

Trying it out

Would it be worth mentioning somewhere here that the payload/application obtained out of the build process should be deployed as
/efi/boot/bootx64.efi or /efi/boot/bootia32.efi, to make it load automatically from the BIOS?

Strictly speaking this is not U-Boot business, but it might simplify the life of the users to state it explicitly.

One other thing that I haven't fully investigated yet (so maybe it's already explained elsewhere) is: after the application/payload is built for x86 EFI,
how to deal with the environment partition?

If this is the end of the x86/efi specific documentation and one should refer to something else, it would be good to have a link/reference to the next doc.

Signature · 1 line
igor
author
#2 lore raw

PATCH v2 1/1 efi: Update README.efi to clarify build and test instructions

Hi Igor,

Quoted 6 lines · Igor

Hello Bin,
a couple more of last-minute comments below:

On 15 August 2015 at 04:44, Bin Meng <[email protected]> wrote:

Quoted 9 lines
Quoted 2 lines

+For building an EFI payload, run:
make qemu-x86_defconfig

Since qemu-x86_defconfig was an example, maybe this could be written as:

make <selected defconfig, i.e. qemu-x86_defconfig> change EFI settings according to what described above make

OK.

Quoted 9 lines
Quoted 2 lines

Trying it out

Would it be worth mentioning somewhere here that the payload/application obtained out of the build process should be deployed as
/efi/boot/bootx64.efi or /efi/boot/bootia32.efi, to make it load automatically from the BIOS?

No, I don't think this should be documented. This is EFI spec, not U-Boot. And if we document this, what if someone else (not you) who don't like the automatically loading the application complains? Each doc should just describe its own scope.

Quoted 3 lines

Strictly speaking this is not U-Boot business, but it might simplify the life of the users to state it explicitly.

Yep, and it is a balance. I am not saying current doc is perfect, but we just simply cannot document everything, or overdocumeting.

Quoted 5 lines

One other thing that I haven't fully investigated yet (so maybe it's already explained elsewhere) is: after the application/payload is built for x86 EFI,
how to deal with the environment partition?

What environment partition?

Quoted 4 lines

If this is the end of the x86/efi specific documentation and one should refer to something else, it would be good to have a link/reference to the next doc.

Regards,
Bin

#3 lore raw

PATCH v2 1/1 efi: Update README.efi to clarify build and test instructions

Quoted 3 lines · Bin Meng

Hi Igor,

On Mon, Aug 17, 2015 at 3:10 PM, Stoppa, Igor <[email protected]> wrote:

[...]

Quoted 7 lines
Quoted 5 lines

One other thing that I haven't fully investigated yet (so maybe it's already explained elsewhere) is: after the application/payload is built for x86 EFI,
how to deal with the environment partition?

What environment partition?

I'm referring to this:

http://www.denx.de/wiki/view/DULG/UBootEnvVariables

I thought it would become a partition, but maybe I've assumed too much and it is implemented in some other way?

Signature · 1 line
igor
#4 lore raw

PATCH v2 1/1 efi: Update README.efi to clarify build and test instructions

Quoted 6 lines · Igor

I'm referring to this:

http://www.denx.de/wiki/view/DULG/UBootEnvVariables

I thought it would become a partition, but maybe I've assumed too much and it is implemented in some other way?

ah, I see now that I should use CONFIG_ENV_IS_IN_FAT

Signature · 1 line
igor
#5 lore raw

PATCH v2 1/1 efi: Update README.efi to clarify build and test instructions

In reply to Bin Meng
Quoted 6 lines · Bin Meng

The doc has a misleading 'make menuconfig' when building the EFI application and payload. Clarify this and also update information on test with QEMU.

Quoted 7 lines

---

Changes in v2:
- incorporate comments from Igor, clarify boolean options

 doc/README.efi | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)