[PATCH v10 00/10] enable menu-driven UEFI variable maintenance

Masahisa Kojima masahisa.kojima at linaro.org
Thu Aug 4 10:26:48 CEST 2022


Hi Ilias, Akashi-san,

On Wed, 27 Jul 2022 at 10:56, Takahiro Akashi
<takahiro.akashi at linaro.org> wrote:
>
> On Wed, Jul 27, 2022 at 10:08:00AM +0900, Takahiro Akashi wrote:
> > On Fri, Jul 22, 2022 at 11:45:49AM +0300, Ilias Apalodimas wrote:
> > > Hi Kojima-san,
> > >
> > > On Fri, 22 Jul 2022 at 05:36, Masahisa Kojima
> > > <masahisa.kojima at linaro.org> wrote:
> > > >
> > > > This series adds the menu-driven UEFI boot variable maintenance
> > > > through the "eficonfig" new command.
> > > > This series also adds the removable media support in bootmenu.
> > > >
> > > > Initrd file selection and python based unit test are added in v10.
> > > >
> > > > Source code can be cloned with:
> > > > $ git clone https://git.linaro.org/people/masahisa.kojima/u-boot.git -b eficonfig_upstream_v10
> > > >
> > > > [Major Changes]
> > > > - rebased v2022.07
> > > > - add initrd file selection
> > >
> > > I tried to load an initrd, which on typical distros is not part of the
> > > ESP.  While
> > > => ls virtio 0:2
> > >
> > > reads the filesystem contents fine, whenI try to navigate to that
> > > virtio (and ext4 filesystem) device through the menu I am getting:
> > > "Reading volume failed!"
> > >
> > > Any ideas?
> >
> > eficonfig_select_file()
> >   efi_file_open_int()
> >     file_open()
> >       exists = fs_exists(fh->path);
> >       ...
> >
> > It seems that fat and ext4 work in a different way against a *directory* here.
> > For instance, try this both on fat and ext4
> > ("test -e" internally uses fs_exists().)
> > => test -e virtio X:Y /
> > => echo $?
> >
> > I think eficonfig_select_file() can be rewritten with fs_opendir()/fs_readdir().
>
> Correction:
> Not all file systems support fs_opendir/fs_readdir interfaces, so this is not
> a viable solution in general.
> (Please note that UEFI spec says nothing about file systems other than fat, though.)

lib/efi_loader/efi_file.c calls fs_opendir()/fs_readdir() to access
the directory information,
and ext4 file system code does not support fs_opendir()/fs_readdir().
I could not find any generic method to read directory information for
the file system
that U-Boot supports. It seems that it requires much effort to support
creating the
file selection menu other than FAT file system.

Thanks,
Masahisa Kojima

>
> -Takahiro Akashi
>
> > (Or much more preferably, efi_open(), and essentially fs_exists(), should be fixed.)
> >
> > -Takahiro Akashi
> >
> > > Regards
> > > /Ilias
> > > > - add python based unit test
> > > > - there is detailed changelog in each commit
> > > >
> > > > Masahisa Kojima (10):
> > > >   efi_loader: move udevice pointer into struct efi_object
> > > >   eficonfig: menu-driven addition of UEFI boot option
> > > >   eficonfig: add "Edit Boot Option" menu entry
> > > >   menu: add KEY_PLUS and KEY_MINUS handling
> > > >   eficonfig: add "Change Boot Order" menu entry
> > > >   eficonfig: add "Delete Boot Option" menu entry
> > > >   bootmenu: add removable media entries
> > > >   doc:bootmenu: add description for UEFI boot support
> > > >   doc:eficonfig: add documentation for eficonfig command
> > > >   test: unit test for eficonfig
> > > >
> > > >  cmd/Kconfig                                   |    7 +
> > > >  cmd/Makefile                                  |    1 +
> > > >  cmd/bootmenu.c                                |  106 +-
> > > >  cmd/eficonfig.c                               | 2103 +++++++++++++++++
> > > >  common/menu.c                                 |    6 +
> > > >  configs/sandbox_defconfig                     |    1 +
> > > >  doc/usage/cmd/bootmenu.rst                    |   74 +
> > > >  doc/usage/cmd/eficonfig.rst                   |   63 +
> > > >  doc/usage/index.rst                           |    1 +
> > > >  include/efi_config.h                          |   91 +
> > > >  include/efi_loader.h                          |   67 +
> > > >  include/menu.h                                |    2 +
> > > >  lib/efi_driver/efi_block_device.c             |    3 +-
> > > >  lib/efi_loader/efi_bootmgr.c                  |    7 +
> > > >  lib/efi_loader/efi_boottime.c                 |   52 +-
> > > >  lib/efi_loader/efi_console.c                  |   70 +
> > > >  lib/efi_loader/efi_disk.c                     |   65 +-
> > > >  lib/efi_loader/efi_file.c                     |   75 +-
> > > >  lib/efi_loader/efi_helper.c                   |   13 +
> > > >  test/py/tests/test_eficonfig/conftest.py      |   40 +
> > > >  .../py/tests/test_eficonfig/test_eficonfig.py |  325 +++
> > > >  21 files changed, 3109 insertions(+), 63 deletions(-)
> > > >  create mode 100644 cmd/eficonfig.c
> > > >  create mode 100644 doc/usage/cmd/eficonfig.rst
> > > >  create mode 100644 include/efi_config.h
> > > >  create mode 100644 test/py/tests/test_eficonfig/conftest.py
> > > >  create mode 100644 test/py/tests/test_eficonfig/test_eficonfig.py
> > > >
> > > > --
> > > > 2.17.1
> > > >


More information about the U-Boot mailing list