RFC: Devices for files and partitions

Simon Glass sjg at chromium.org
Wed Jul 7 01:05:19 CEST 2021


Hi,

At present U-Boot avoids the concept of 'opening' a file. Being in a
bootloader environment, it is normally better to take the action
immediately and avoid any caching, for example, since there is no
background task to clean up afterwards.

Having said that, the concept of a file is quite useful, for example
to write the output of a command to a file, or to open a file and read
it a line at a time.

Another case has come to light in that EFI wants to access files using
a file handle. This currently uses parallel data structures and does
not map very well in U-Boot.

Finally, partitions has a similar issue, where defining them as a
device can have benefits, e.g. to specify the device to use directly,
rather than with the 'type dev:part' approach, perhaps providing them
in the devicetree, etc.

For the above reasons, I propose that we implement, as an option,
support for files and partitions within driver model.

Regards,
Simon


More information about the U-Boot mailing list