All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 00/14] efi: make efi and bootmgr more usable
@ 2018-11-05  9:06 AKASHI Takahiro
  2018-11-05  9:06 ` [U-Boot] [PATCH v2 01/14] efi_loader: allow device == NULL in efi_dp_from_name() AKASHI Takahiro
                   ` (13 more replies)
  0 siblings, 14 replies; 39+ messages in thread
From: AKASHI Takahiro @ 2018-11-05  9:06 UTC (permalink / raw)
  To: u-boot

This patch set is a collection of patches to enhance efi user interfaces
/commands. It will help improve user experience on efi boot and make it
more usable *without* edk2's shell utility.

Let's see how it works:
=> efishell boot add 1 SHELL mmc 0:1 /Shell.efi ""
=> efishell boot add 2 HELLO mmc 0:1 /hello.efi ""
=> efishell boot dump
Boot0001:
	attributes: A-- (0x00000001)
	label: SHELL
	file_path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0x086246ba,0x800,0x40000)/\\Shell.efi
	data: 
Boot0002:
	attributes: A-- (0x00000001)
	label: HELLO
	file_path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0x086246ba,0x800,0x40000)/\\hello.efi
	data: 

=> efishell boot order 1 2
=> efishell boot order
 1: Boot0001: SHELL
 2: Boot0002: HELLO

=> run -e Boot0002 (or bootefi bootmgr - 2)	; '-' means no dtb specified
WARNING: booting without device tree
Booting: HELLO
## Starting EFI application at 000000007db8b040 ...
Hello, world!
## Application terminated, r = 0

=> env set -e PlatformLang en			; important!
   (or you can do "efishell setvar PlatformLang en")
=> env print -e
Boot0001: {boot,run}(blob)
00000000:  01 00 00 00 68 00 53 00  ....h.S.
00000010:  48 00 45 00 4c 00 4c 00  H.E.L.L.
00000020:  00 00 01 04 14 00 b9 73  .......s
00000030:  1d e6 84 a3 cc 4a ae ab  .....J..
00000040:  82 e8 28 f3 62 8b 03 1a  ..(.b...
00000050:  05 00 00 03 1a 05 00 00  ........
00000060:  04 01 2a 00 01 00 00 00  ..*.....
00000070:  00 08 00 00 00 00 00 00  ........
00000080:  00 00 04 00 00 00 00 00  ........
00000090:  ba 46 62 08 00 00 00 00  .Fb.....
000000a0:  00 00 00 00 00 00 00 00  ........
000000b0:  01 01 04 04 1c 00 5c 00  ......\.
000000c0:  5c 00 53 00 68 00 65 00  \.S.h.e.
000000d0:  6c 00 6c 00 2e 00 65 00  l.l...e.
000000e0:  66 00 69 00 00 00 7f ff  f.i....
000000f0:  04 00 00                 ...
Boot0002: {boot,run}(blob)
00000000:  01 00 00 00 68 00 48 00  ....h.H.
00000010:  45 00 4c 00 4c 00 4f 00  E.L.L.O.
00000020:  00 00 01 04 14 00 b9 73  .......s
00000030:  1d e6 84 a3 cc 4a ae ab  .....J..
00000040:  82 e8 28 f3 62 8b 03 1a  ..(.b...
00000050:  05 00 00 03 1a 05 00 00  ........
00000060:  04 01 2a 00 01 00 00 00  ..*.....
00000070:  00 08 00 00 00 00 00 00  ........
00000080:  00 00 04 00 00 00 00 00  ........
00000090:  ba 46 62 08 00 00 00 00  .Fb.....
000000a0:  00 00 00 00 00 00 00 00  ........
000000b0:  01 01 04 04 1c 00 5c 00  ......\.
000000c0:  5c 00 68 00 65 00 6c 00  \.h.e.l.
000000d0:  6c 00 6f 00 2e 00 65 00  l.o...e.
000000e0:  66 00 69 00 00 00 7f ff  f.i....
000000f0:  04 00 00                 ...
BootOrder: {boot,run}(blob)
00000000:  01 00 02 00              ....
OsIndicationsSupported: {ro,boot}(blob)
00000000:  00 00 00 00 00 00 00 00  ........
PlatformLang: {boot,run}(blob)
00000000:  65 6e                    en

=> run -e Boot0001 or bootefi bootmgr

   (shell ...)

"setvar" command now supports efi shell-like syntax:

=> env set -e foo =S\"akashi\" =0x012345 =Habcdef  
=> env print -e foo                              
foo: {boot,run}(blob)
00000000:  61 6b 61 73 68 69 45 23  akashiE#
00000010:  01 00 ab cd ef           .....


Other useful sub commands are:
=> efishell devices				; print uefi devices
=> efishell drivers				; print uefi drivers
=> efishell images				; print loaded images
=> efishell dh					; print uefi handles
=> efishell memmap				; dump uefi memory map

# I admit there is some room to improve the output from those commands.

Enjoy!
-Takahiro Akashi

Changes in v2 (Nov 5, 2018)
* modify efi_dp_from_name() for use in efishell
* rename efi_marshal_load_option() to efi_serialize_load_option(),
  taking a "struct efi_load_option" as an argument
* improve a format in dumping uefi variables
* enhance a setvar syntax as efi's shell does
* change a syntax from "bootefi bootmgr -2" to "bootefi bootmgr - 2"
* add -e option to run command
* add -e option to env command
* add more sub-commands

AKASHI Takahiro (14):
  efi_loader: allow device == NULL in efi_dp_from_name()
  efi_loader: bootmgr: add load option helper functions
  efi_loader: bootmgr: allow for running a given load option
  cmd: add efishell command
  cmd: efishell: add devices command
  cmd: efishell: add drivers command
  cmd: efishell: add images command
  cmd: efishell: add memmap command
  cmd: efishell: add dh command
  cmd: bootefi: carve out fdt parameter handling
  cmd: bootefi: run an EFI application of a specific load option
  cmd: run: add "-e" option to run an EFI application
  cmd: efishell: export uefi variable helper functions
  cmd: env: add "-e" option for handling UEFI variables

 cmd/Makefile                     |   2 +-
 cmd/bootefi.c                    |  71 ++-
 cmd/efishell.c                   | 970 +++++++++++++++++++++++++++++++
 cmd/efishell.h                   |   6 +
 cmd/nvedit.c                     |  63 +-
 common/cli.c                     |  30 +
 include/command.h                |   5 +
 include/efi_loader.h             |  26 +-
 lib/efi_loader/efi_bootmgr.c     | 101 ++--
 lib/efi_loader/efi_device_path.c |  11 +-
 10 files changed, 1223 insertions(+), 62 deletions(-)
 create mode 100644 cmd/efishell.c
 create mode 100644 cmd/efishell.h

-- 
2.19.0

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

end of thread, other threads:[~2019-01-07  8:22 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05  9:06 [U-Boot] [PATCH v2 00/14] efi: make efi and bootmgr more usable AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 01/14] efi_loader: allow device == NULL in efi_dp_from_name() AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 02/14] efi_loader: bootmgr: add load option helper functions AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 03/14] efi_loader: bootmgr: allow for running a given load option AKASHI Takahiro
2018-12-02 23:22   ` Alexander Graf
2018-12-03  3:20     ` AKASHI Takahiro
2018-12-03 13:54       ` Alexander Graf
2018-11-05  9:06 ` [U-Boot] [PATCH v2 04/14] cmd: add efishell command AKASHI Takahiro
2018-12-02 23:42   ` Alexander Graf
2018-12-03  6:42     ` AKASHI Takahiro
2018-12-03 14:01       ` Alexander Graf
2018-11-05  9:06 ` [U-Boot] [PATCH v2 05/14] cmd: efishell: add devices command AKASHI Takahiro
2018-12-02 23:46   ` Alexander Graf
2018-12-03  7:02     ` AKASHI Takahiro
2018-12-23  3:11       ` Alexander Graf
2018-12-25 12:00         ` AKASHI Takahiro
2018-12-26  8:00           ` Alexander Graf
2019-01-07  8:22             ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 06/14] cmd: efishell: add drivers command AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 07/14] cmd: efishell: add images command AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 08/14] cmd: efishell: add memmap command AKASHI Takahiro
2018-12-02 23:48   ` Alexander Graf
2018-12-03  7:10     ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 09/14] cmd: efishell: add dh command AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 10/14] cmd: bootefi: carve out fdt parameter handling AKASHI Takahiro
2018-12-02 23:50   ` Alexander Graf
2018-12-03  7:33     ` AKASHI Takahiro
2018-12-23  3:11       ` Alexander Graf
2018-12-25 12:05         ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 11/14] cmd: bootefi: run an EFI application of a specific load option AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 12/14] cmd: run: add "-e" option to run an EFI application AKASHI Takahiro
2018-12-02 23:53   ` Alexander Graf
2018-12-03  7:57     ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 13/14] cmd: efishell: export uefi variable helper functions AKASHI Takahiro
2018-12-02 23:54   ` Alexander Graf
2018-12-03  8:08     ` AKASHI Takahiro
2018-12-23  3:13       ` Alexander Graf
2018-12-25 12:14         ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 14/14] cmd: env: add "-e" option for handling UEFI variables AKASHI Takahiro

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.