efi_loader: Allow to compile helloworld.efi w/o bundling it
authorAlexander Graf <agraf@suse.de>
Thu, 17 Nov 2016 21:40:10 +0000 (22:40 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 27 Nov 2016 14:53:39 +0000 (09:53 -0500)
Today we can compile a self-contained hello world efi test binary that
allows us to quickly verify whether the EFI loader framwork works.

We can use that binary outside of the self-contained test case though,
by providing it to a to-be-tested system via tftp.

This patch separates compilation of the helloworld.efi file from
including it in the u-boot binary for "bootefi hello". It also modifies
the efi_loader test case to enable travis to pick up the compiled file.
Because we're now no longer bloating the resulting u-boot binary, we
can enable compilation always, giving us good travis test coverage.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/lib/Makefile
arch/x86/config.mk
arch/x86/lib/Makefile
cmd/Kconfig
configs/qemu-x86_efi_payload64_defconfig
configs/stm32f429-discovery_defconfig
lib/efi_loader/Makefile
test/py/tests/test_efi_loader.py

index a812306..0051f76 100644 (file)
@@ -100,5 +100,5 @@ CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
 CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
 CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
 
-extra-$(CONFIG_CMD_BOOTEFI_HELLO) += $(EFI_CRT0) $(EFI_RELOC)
+extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
 extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)
index 03c71f7..1697dca 100644 (file)
@@ -66,7 +66,7 @@ LDFLAGS_FINAL += --gc-sections -pie
 
 endif
 
-ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
 
 ifneq ($(CONFIG_EFI_STUB_64BIT),)
 EFI_LDS := elf_x86_64_efi.lds
index ff402dc..723288f 100644 (file)
@@ -64,6 +64,6 @@ extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o reloc_x86_64_efi.o
 
 endif
 
-ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
 extra-y += $(EFI_CRT0) $(EFI_RELOC)
 endif
index 2a2f23e..b16c603 100644 (file)
@@ -181,9 +181,22 @@ config CMD_BOOTEFI
        help
          Boot an EFI image from memory.
 
+config CMD_BOOTEFI_HELLO_COMPILE
+       bool "Compile a standard EFI hello world binary for testing"
+       depends on CMD_BOOTEFI && (ARM || X86)
+       default y
+       help
+         This compiles a standard EFI hello world application with U-Boot so
+         that it can be used with the test/py testing framework. This is useful
+         for testing that EFI is working at a basic level, and for bringing
+         up EFI support on a new architecture.
+
+         No additional space will be required in the resulting U-Boot binary
+         when this option is enabled.
+
 config CMD_BOOTEFI_HELLO
        bool "Allow booting a standard EFI hello world for testing"
-       depends on CMD_BOOTEFI && (ARM || X86)
+       depends on CMD_BOOTEFI_HELLO_COMPILE
        help
          This adds a standard EFI hello world application to U-Boot so that
          it can be used with the 'bootefi hello' command. This is useful
index c081ead..eaf0e32 100644 (file)
@@ -52,3 +52,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
 CONFIG_EFI_STUB_64BIT=y
+# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
index 24e2221..bb161d4 100644 (file)
@@ -10,3 +10,4 @@ CONFIG_SYS_PROMPT="U-Boot > "
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIMER=y
 CONFIG_OF_LIBFDT=y
+# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
index f466408..fa8b91a 100644 (file)
@@ -10,6 +10,9 @@
 CFLAGS_helloworld.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
 
+efiprogs-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += helloworld.efi
+always := $(efiprogs-y)
+
 obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
 obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o
 obj-y += efi_memory.o
index 1c42653..7bf0170 100644 (file)
@@ -104,7 +104,7 @@ def test_efi_setup_static(u_boot_console):
     global net_set_up
     net_set_up = True
 
-@pytest.mark.buildconfigspec('cmd_bootefi_hello')
+@pytest.mark.buildconfigspec('cmd_bootefi_hello_compile')
 def test_efi_helloworld_net(u_boot_console):
     """Run the helloworld.efi binary via TFTP.