summaryrefslogtreecommitdiff
path: root/cmd/efidebug.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-11-09 08:05:41 -0600
committerTom Rini <trini@konsulko.com>2024-11-09 08:05:41 -0600
commitf448c4517b55f4018271cdf014615eb54121d863 (patch)
treeb7974f966aacb07af9630b3c3e8cd0be56e17e61 /cmd/efidebug.c
parenta7a96a37cbd875994bc8d25adb0536bf00e4a30e (diff)
parent70b78d52937b5f18afbbc4257bd3b89b0e75a186 (diff)
Merge tag 'efi-2025-01-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-01-rc2-2 Documentation: * correct title and author of rst2pdf generated pdf * describe CONFIG_DEBUG_SBI_CONSOLE * remove vile language UEFI * correct printf codes in mkeficapsule * add an EFI test app * move default filename to a function * move get_efi_pxe_arch() to efi_helper * allow reporting the host defaults in efidebug * drop sandbox PXE architecture Other: * do not reserve extra 16 KiB of stack in lmb * disable the sandbox virtio blk device * provide -N command line flag to control EFI default boot file name on the sandbox * provide a unit test for the efi bootmeth
Diffstat (limited to 'cmd/efidebug.c')
-rw-r--r--cmd/efidebug.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index e040fe75fa1..02f1e080e88 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -511,6 +511,27 @@ static int do_efi_show_images(struct cmd_tbl *cmdtp, int flag,
return CMD_RET_SUCCESS;
}
+/**
+ * do_efi_show_defaults() - show UEFI default filename and PXE architecture
+ *
+ * @cmdtp: Command table
+ * @flag: Command flag
+ * @argc: Number of arguments
+ * @argv: Argument array
+ * Return: CMD_RET_SUCCESS on success, CMD_RET_RET_FAILURE on failure
+ *
+ * Implement efidebug "defaults" sub-command.
+ * Shows the default EFI filename and PXE architecture
+ */
+static int do_efi_show_defaults(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
+{
+ printf("Default boot path: EFI\\BOOT\\%s\n", efi_get_basename());
+ printf("PXE arch: 0x%02x\n", efi_get_pxe_arch());
+
+ return CMD_RET_SUCCESS;
+}
+
static const char * const efi_mem_type_string[] = {
[EFI_RESERVED_MEMORY_TYPE] = "RESERVED",
[EFI_LOADER_CODE] = "LOADER CODE",
@@ -1561,6 +1582,8 @@ static struct cmd_tbl cmd_efidebug_sub[] = {
"", ""),
U_BOOT_CMD_MKENT(dh, CONFIG_SYS_MAXARGS, 1, do_efi_show_handles,
"", ""),
+ U_BOOT_CMD_MKENT(defaults, CONFIG_SYS_MAXARGS, 1, do_efi_show_defaults,
+ "", ""),
U_BOOT_CMD_MKENT(images, CONFIG_SYS_MAXARGS, 1, do_efi_show_images,
"", ""),
U_BOOT_CMD_MKENT(memmap, CONFIG_SYS_MAXARGS, 1, do_efi_show_memmap,
@@ -1653,6 +1676,8 @@ U_BOOT_LONGHELP(efidebug,
" - show UEFI drivers\n"
"efidebug dh\n"
" - show UEFI handles\n"
+ "efidebug defaults\n"
+ " - show default EFI filename and PXE architecture\n"
"efidebug images\n"
" - show loaded images\n"
"efidebug memmap\n"