[PATCH v2] fastboot: Add OEM run command

Marek Vasut marex at denx.de
Sun Dec 4 13:46:38 CET 2022


On 12/2/22 22:34, Sean Anderson wrote:
> On 12/2/22 16:22, Marek Vasut wrote:
>> On 12/2/22 22:03, Sean Anderson wrote:
>>
>> [...]
>>
>>> +Running Shell Commands
>>> +----------------------
>>> +
>>> +Normally, arbitrary U-Boot command execution is not enabled. This is so
>>> +fastboot can be used to update systems using verified boot. However, such
>>> +functionality can be useful for production or when verified boot is not in use.
>>> +Enable ``CONFIG_FASTBOOT_UUU_SUPPORT`` to use this functionality. This will
>>> +enable the ``UCmd`` and ``ACmd`` commands for use with UUU [3]_. It also
>>> +enables the ``oem run`` command, which can be used with the fastboot client.
>>> +For example, to print "Hello world", run::
>>> +
>>> +    $ fastboot oem run:echo Hello world
>>> +
>>
>> Does this also support more complex shell constructs, e.g. run:"echo hello ; echo world" ? Or how does one represent the ; in that command ?
> 
> Yes.
> 
>> Does variable expansion and access work as it should ?
> 
> Yes. But it has to be escaped properly (for your shell).
> 
> Under the hood this just calls into run_command, and fastboot effectively
> does ' '.join(argv) for oem commands.
> 
> TBH I haven't dug into this too much, as I just need to run some basic commands
> for my intended use case.

It would be nice to have an example of how to run

fastboot oem run:echo Hello ; echo world

or

fastboot oem run:echo Hello && echo world

or

fastboot oem run:setenv Hello world ; echo $Hello

that should cover all the cases.


More information about the U-Boot mailing list