All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 5/6] efi_loader: Allow to compile helloworld.efi w/o bundling it
Date: Thu, 17 Nov 2016 18:31:06 +0100	[thread overview]
Message-ID: <1479403867-54792-6-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1479403867-54792-1-git-send-email-agraf@suse.de>

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>
---
 arch/arm/lib/Makefile                    |  2 +-
 arch/x86/config.mk                       |  2 +-
 arch/x86/lib/Makefile                    |  2 +-
 cmd/Kconfig                              | 15 ++++++++++++++-
 configs/qemu-x86_efi_payload64_defconfig |  1 +
 lib/efi_loader/Makefile                  |  3 +++
 test/py/tests/test_efi_loader.py         |  2 +-
 7 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index a812306..0051f76 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -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)
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 03c71f7..1697dca 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -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
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index ff402dc..723288f 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -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
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 2a2f23e..b16c603 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -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
diff --git a/configs/qemu-x86_efi_payload64_defconfig b/configs/qemu-x86_efi_payload64_defconfig
index c081ead..eaf0e32 100644
--- a/configs/qemu-x86_efi_payload64_defconfig
+++ b/configs/qemu-x86_efi_payload64_defconfig
@@ -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
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index f466408..fa8b91a 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -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
diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
index 1c42653..7bf0170 100644
--- a/test/py/tests/test_efi_loader.py
+++ b/test/py/tests/test_efi_loader.py
@@ -104,7 +104,7 @@ def test_efi_setup_static(u_boot_console):
     global net_set_up
     net_set_up = True
 
- at pytest.mark.buildconfigspec('cmd_bootefi_hello')
+ at pytest.mark.buildconfigspec('cmd_bootefi_hello_compile')
 def test_efi_helloworld_net(u_boot_console):
     """Run the helloworld.efi binary via TFTP.
 
-- 
1.8.5.6

  parent reply	other threads:[~2016-11-17 17:31 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 17:31 [U-Boot] [PATCH v2 0/6] efi_laoder: Add travis test coverage Alexander Graf
2016-11-17 17:31 ` [U-Boot] [PATCH v2 1/6] tests: net: Offset downloads to 4MB Alexander Graf
2016-11-19 13:48   ` Simon Glass
2016-11-21 13:54   ` Tom Rini
2016-11-27 14:54   ` [U-Boot] [U-Boot,v2,1/6] " Tom Rini
2016-11-17 17:31 ` [U-Boot] [PATCH v2 2/6] Travis: Expose build dir as variable Alexander Graf
2016-11-21 13:56   ` Tom Rini
2016-11-27 14:54   ` [U-Boot] [U-Boot,v2,2/6] " Tom Rini
2016-11-17 17:31 ` [U-Boot] [PATCH v2 3/6] travis: Add python path for environments Alexander Graf
2016-11-21 13:56   ` Tom Rini
2016-11-27 14:55   ` [U-Boot] [U-Boot, v2, " Tom Rini
2016-11-17 17:31 ` [U-Boot] [PATCH v2 4/6] tests: Add efi_loader hello world test Alexander Graf
2016-11-19 13:48   ` Simon Glass
2016-11-21 13:57   ` Tom Rini
2016-11-27 14:55   ` [U-Boot] [U-Boot, v2, " Tom Rini
2016-11-17 17:31 ` Alexander Graf [this message]
2016-11-17 21:40   ` [U-Boot] [PATCH v3 5/6] efi_loader: Allow to compile helloworld.efi w/o bundling it Alexander Graf
2016-11-21 13:58     ` Tom Rini
2016-11-27 14:55     ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-11-19 13:48   ` [U-Boot] [PATCH v2 " Simon Glass
2016-11-19 14:13     ` Alexander Graf
2016-11-19 20:02       ` Simon Glass
2016-11-19 21:47         ` Alexander Graf
2016-11-19 23:56           ` Simon Glass
2016-11-20  0:13             ` Alexander Graf
2016-11-22 17:50               ` Simon Glass
2016-11-22 18:27                 ` Tom Rini
2016-11-22 18:48                   ` Alexander Graf
2016-11-22 20:49                 ` Alexander Graf
2016-11-17 17:31 ` [U-Boot] [PATCH v2 6/6] Travis: Remove sleep test from integratorcp_cm926ejs-qemu test Alexander Graf
2016-11-21 14:00   ` Tom Rini
2016-11-27 14:55   ` [U-Boot] [U-Boot, v2, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479403867-54792-6-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.