[PATCH 1/2] cmd: fastboot: Add keyed abort option
Mattijs Korpershoek
mkorpershoek at kernel.org
Mon Jun 15 14:30:43 CEST 2026
Hi Simon,
On Sun, Jun 14, 2026 at 05:49, Simon Glass <sjg at chromium.org> wrote:
> Hi Sam,
>
> On 2026-06-02T08:45:46, Sam Day via B4 Relay
> <devnull+me.samcday.com at kernel.org> wrote:
>> cmd: fastboot: Add keyed abort option
>>
>> Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
>> abort fastboot mode (rather than only ctrl-c).
>>
>> Signed-off-by: Sam Day <me at samcday.com>
>>
>> cmd/Kconfig | 6 ++++++
>> cmd/fastboot.c | 9 ++++++++-
>> 2 files changed, 14 insertions(+), 1 deletion(-)
>
>> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
>> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
>> while (1) {
>> if (g_dnl_detach())
>> break;
>> - if (ctrlc())
>> + if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
>> + if (tstc()) {
>> + getchar();
>> + puts("\rOperation aborted.\n");
>> + break;
>> + }
>> + } else if (ctrlc()) {
>> break;
>> + }
>
> I wonder if you could create a shared function (gadget_abort_check()
> ?) to keep this and the code in usb_mass_storage.c in sync?
While I usually advocate to avoid code duplication, I don't think it's
needed to create a new function here. It's only a couple of very simple
lines.
To me this can stay as is.
>
>> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
>> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
>> + if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
>> + if (tstc()) {
>> + getchar();
>> + puts("\rOperation aborted.\n");
>> + break;
>> + }
>
> Can you please update doc/android/fastboot.rst to mention the new
> Kconfig and the abort behaviour. There is currently nothing in that
> file about how to leave fastboot mode at all.
For the current behaviour, I have send:
https://lore.kernel.org/all/20260615-fastboot-doc-ctrl-c-v1-1-f932dea17c0a@kernel.org/
>
> Regards,
> Simon
More information about the U-Boot
mailing list