public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/1] sandbox: add bootmethod EFI boot-manager
@ 2024-10-08 22:32 Heinrich Schuchardt
  2024-10-09  1:58 ` Simon Glass
  2024-10-11 14:27 ` Mattijs Korpershoek
  0 siblings, 2 replies; 5+ messages in thread
From: Heinrich Schuchardt @ 2024-10-08 22:32 UTC (permalink / raw)
  To: Simon Glass
  Cc: Tom Rini, Sughosh Ganu, Mattijs Korpershoek, Ilias Apalodimas,
	Mark Kettenis, u-boot, Heinrich Schuchardt

The EFI boot-manager is the default method to boot EFI binaries.
We should be able to use it on the Sandbox.

* Enable EFI boot-manager bootmethod on the sandbox.
* Adjust unit tests to reflect the additional boot method.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 arch/sandbox/dts/test.dts |  4 ++++
 test/boot/bootmeth.c      | 28 +++++++++++++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 8412506c17a..1248ed66089 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -119,6 +119,10 @@
 			compatible = "u-boot,distro-efi";
 		};
 
+		efimgr {
+			compatible = "u-boot,efi-bootmgr";
+		};
+
 		theme {
 			font-size = <30>;
 			menu-inset = <3>;
diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c
index 518d99c4a27..fe175ccb755 100644
--- a/test/boot/bootmeth.c
+++ b/test/boot/bootmeth.c
@@ -21,11 +21,13 @@ static int bootmeth_cmd_list(struct unit_test_state *uts)
 	ut_assert_nextlinen("---");
 	ut_assert_nextline("    0    0  extlinux            Extlinux boot from a block device");
 	ut_assert_nextline("    1    1  efi                 EFI boot from an .efi file");
-	if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
-		ut_assert_nextline(" glob    2  firmware0           VBE simple");
+	if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) {
+		ut_assert_nextline(" glob    2  efimgr              EFI bootmgr flow");
+		ut_assert_nextline(" glob    3  firmware0           VBE simple");
+	}
 	ut_assert_nextlinen("---");
 	ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
-		 "(3 bootmeths)" : "(2 bootmeths)");
+		 "(4 bootmeths)" : "(2 bootmeths)");
 	ut_assert_console_end();
 
 	return 0;
@@ -56,11 +58,13 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
 	ut_assert_nextlinen("---");
 	ut_assert_nextline("    0    0  extlinux            Extlinux boot from a block device");
 	ut_assert_nextline("    -    1  efi                 EFI boot from an .efi file");
-	if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
-		ut_assert_nextline(" glob    2  firmware0           VBE simple");
+	if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) {
+		ut_assert_nextline(" glob    2  efimgr              EFI bootmgr flow");
+		ut_assert_nextline(" glob    3  firmware0           VBE simple");
+	}
 	ut_assert_nextlinen("---");
 	ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
-		 "(3 bootmeths)" : "(2 bootmeths)");
+		 "(4 bootmeths)" : "(2 bootmeths)");
 	ut_assert_console_end();
 
 	/* Check the -a flag with the reverse order */
@@ -71,11 +75,13 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
 	ut_assert_nextlinen("---");
 	ut_assert_nextline("    1    0  extlinux            Extlinux boot from a block device");
 	ut_assert_nextline("    0    1  efi                 EFI boot from an .efi file");
-	if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
-		ut_assert_nextline(" glob    2  firmware0           VBE simple");
+	if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) {
+		ut_assert_nextline(" glob    2  efimgr              EFI bootmgr flow");
+		ut_assert_nextline(" glob    3  firmware0           VBE simple");
+	}
 	ut_assert_nextlinen("---");
 	ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
-		 "(3 bootmeths)" : "(2 bootmeths)");
+		 "(4 bootmeths)" : "(2 bootmeths)");
 	ut_assert_console_end();
 
 	/* Now reset the order to empty, which should show all of them again */
@@ -84,7 +90,7 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
 	ut_assertnull(env_get("bootmeths"));
 	ut_assertok(run_command("bootmeth list", 0));
 	ut_assert_skip_to_line(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
-		 "(3 bootmeths)" : "(2 bootmeths)");
+		 "(4 bootmeths)" : "(2 bootmeths)");
 
 	/* Try reverse order */
 	ut_assertok(run_command("bootmeth order \"efi extlinux\"", 0));
@@ -116,7 +122,7 @@ static int bootmeth_cmd_order_glob(struct unit_test_state *uts)
 	ut_assert_nextline("Order  Seq  Name                Description");
 	ut_assert_nextlinen("---");
 	ut_assert_nextline("    0    1  efi                 EFI boot from an .efi file");
-	ut_assert_nextline(" glob    2  firmware0           VBE simple");
+	ut_assert_nextline(" glob    3  firmware0           VBE simple");
 	ut_assert_nextlinen("---");
 	ut_assert_nextline("(2 bootmeths)");
 	ut_assertnonnull(env_get("bootmeths"));
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-18  1:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08 22:32 [PATCH 1/1] sandbox: add bootmethod EFI boot-manager Heinrich Schuchardt
2024-10-09  1:58 ` Simon Glass
2024-10-11 14:27 ` Mattijs Korpershoek
2024-10-17 23:23   ` Simon Glass
2024-10-18  1:00     ` Heinrich Schuchardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox