[PATCH v2] fastboot: Add OEM run command

Sean Anderson sean.anderson at seco.com
Fri Dec 2 22:34:52 CET 2022


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.

--Sean

> 
> [...]
> 
>> diff --git a/include/fastboot.h b/include/fastboot.h
>> index 57daaf1298..8b6b4b934a 100644
>> --- a/include/fastboot.h
>> +++ b/include/fastboot.h
>> @@ -45,6 +45,7 @@ enum {
>>       FASTBOOT_COMMAND_OEM_BOOTBUS,
>>   #endif
>>   #if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
>> +    FASTBOOT_COMMAND_OEM_RUN,
>>       FASTBOOT_COMMAND_ACMD,
> 
> That OEM_RUN entry should be here, no ?
> 
>>       FASTBOOT_COMMAND_UCMD,
> 
> [...]



More information about the U-Boot mailing list