]> git.baikalelectronics.ru Git - uboot.git/commit
efi_selftest: add selftests for loadfile2 used to load initramfs
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Fri, 21 Feb 2020 07:55:46 +0000 (09:55 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 28 Feb 2020 18:37:14 +0000 (19:37 +0100)
commitec1e2cbee2d12e856b4e740cc43f678444e57832
tree8d0f7f249030371a7a874c833c3898c395a9d1f9
parent620ec9fb85e1c44f4961f6f4b6f1031aabaf9c72
efi_selftest: add selftests for loadfile2 used to load initramfs

Provide a unit test loading an initial ramdisk using the
EFI_LOAD_FILE2_PROTOCOL. The test is only executed on request.

An example usage - given a file image with a file system in partition 1
holding file initrd - is:

* Configure the sandbox with

  CONFIG_EFI_SELFTEST=y
  CONFIG_EFI_LOAD_FILE2_INITRD=y
  CONFIG_EFI_INITRD_FILESPEC="host 0:1 initrd"

* Run ./u-boot and execute

    host bind 0 image
    setenv efi_selftest load initrd
    bootefi selftest

This would provide a test output like:

    Testing EFI API implementation

    Selected test: 'load initrd'

    Setting up 'load initrd'
    Setting up 'load initrd' succeeded

    Executing 'load initrd'
    Loaded 12378613 bytes
    CRC32 2997478465
    Executing 'load initrd' succeeded

Now the size and CRC32 can be compared to the provided file.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_selftest/Makefile
lib/efi_selftest/efi_selftest_load_initrd.c [new file with mode: 0644]