[U-Boot] [PATCH v8 3/8] cmd: add efidebug command

Heinrich Schuchardt xypron.glpk at gmx.de
Sat Feb 23 10:16:23 UTC 2019


On 2/22/19 9:10 AM, AKASHI Takahiro wrote:
> Currently, there is no easy way to add or modify UEFI variables.
> In particular, bootmgr supports BootOrder/BootXXXX variables, it is
> quite hard to define them as u-boot variables because they are represented
> in a complicated and encoded format.
> 
> The new command, efidebug, helps address these issues and give us
> more friendly interfaces:
>  * efidebug boot add: add BootXXXX variable
>  * efidebug boot rm: remove BootXXXX variable
>  * efidebug boot dump: display all BootXXXX variables
>  * efidebug boot next: set BootNext variable
>  * efidebug boot order: set/display a boot order (BootOrder)
> 
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk at gmx.de>



=> efidebug boot add 00AA iPXE scsi 0:1 snp-arm32.efi --foo
=> efidebug boot dump
Boot00AA:
        attributes: A-- (0x00000001)
        label: iPXE
        file_path:
/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0xa88c6020,0x1,0x800)/\snp-arm32.efi
        data: --foo

I would not have expected a backslash here.

=> efidebug boot add 00AA iPXE scsi 0:1 /snp-arm32.efi --foo
=> bootefi bootmgr $fdtcontroladdr
=> efidebug boot dump
Boot00AA:
        attributes: A-- (0x00000001)
        label: iPXE
        file_path:
/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0xa88c6020,0x1,0x800)/\\snp-arm32.efi
        data: --foo

I would not have expected a double backslash.

This extra backslash is introduced by efi_dp_from_name():

if (!is_net) {
        /* Add leading / to fs paths, because they're absolute */
        snprintf(filename, sizeof(filename), "/%s", path);
} else {
        snprintf(filename, sizeof(filename), "%s", path);
}

I will send a separate patch.

Best regards

Heinrich


More information about the U-Boot mailing list