[PATCH v2 0/3] fdt: introduce "fsapply" command

Andre Przywara andre.przywara at arm.com
Fri Feb 10 12:02:10 CET 2023


updating the series, basically just changing the name of the command
to "fsapply", as suggested by Simon.
The first two patches are still the same fixes, Simon said he merged
them to u-boot-dm in July already, but I don't see them there or in
I am still looking into a test for fsapply, but wanted to get at least
the fixes merged now, hence this new version.

This is an attempt to simplify the usage of user provided devicetree
overlays. The idea is to let the user drop all desired .dtbo files into
one directory (for instance on the EFI system partition), and U-Boot just
applies all of them, with generic commands:
=> fdt move $fdtcontroladdr $fdt_addr_r
=> fdt resize
=> fdt fsapply mmc 0:1 overlays/

This would pick all files ending in .dtbo from the /overlays directory
found on the first partition of the first MMC device. Ideally the device
type, number and partition name would be provided by the distroboot
scripting, so it checks the media it scans for boot scripts anyways.

Patch 1 fixes the "fdt move" operation in the sandbox. Since hostfs does
not support fs_opendir/fs_readdir, which fsapply relies on, this cannot
be tested in the sandbox, but I figured this bug is worth fixing anyway.
Patch 2 avoids a redundant call to "fdt addr", if we just want to move
(actually copy) the DTB. This is needed when we want to build on the
control DT, since this might live in an area where it cannot be changed
or grow enough.
Patch 3 then implements the main attraction: It uses the U-Boot
filesystem API to fs_readdir() the given directory, reads all files
ending in ".dtbo" into memory, and tries to apply them to the working DT.

Please let me know what you think of the idea in general and the
implementation in particular.
The first two patches are actually bug fixes, and should be applied


Changelog v1 ... v2:
- add Simon's tags
- change command name from "apply-all" to "fsapply"

Andre Przywara (3):
  cmd: fdt: move: Use map_sysmem to convert pointers
  cmd: fdt: allow standalone "fdt move"
  fdt: introduce fsapply command

 cmd/fdt.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 107 insertions(+), 14 deletions(-)


More information about the U-Boot mailing list