From f3d914cfdd5ac611d99f04096497f4cd13dd6aaa Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Fri, 16 Dec 2022 13:20:16 -0500 Subject: fastboot: Add OEM run command This adds the UUU UCmd functionality as an OEM command. While the fastboot tool allows sending arbitrary commands as long as they are prefixed with "oem". This allows running generic U-Boot commands over fastboot without UUU, which is especially useful when not using USB. This is really the route we should have gone in the first place when adding these commands. While we're here, clean up the UUU Kconfig a bit. Signed-off-by: Sean Anderson Reviewed-by: Heiko Schocher --- doc/android/fastboot.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc') diff --git a/doc/android/fastboot.rst b/doc/android/fastboot.rst index 7611f07038e..1ad8a897c85 100644 --- a/doc/android/fastboot.rst +++ b/doc/android/fastboot.rst @@ -28,6 +28,7 @@ The following OEM commands are supported (if enabled): - ``oem partconf`` - this executes ``mmc partconf %x 0`` to configure eMMC with = boot_ack boot_partition - ``oem bootbus`` - this executes ``mmc bootbus %x %s`` to configure eMMC +- ``oem run`` - this executes an arbitrary U-Boot command Support for both eMMC and NAND devices is included. @@ -227,6 +228,23 @@ and on the U-Boot side you should see:: Starting kernel ... +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_OEM_RUN`` to use this functionality. This will enable +``oem run`` command, which can be used with the fastboot client. For example, +to print "Hello at 115200 baud" (or whatever ``CONFIG_BAUDRATE`` is), run:: + + $ fastboot oem run:'echo Hello at $baudrate baud' + +You can run any command you would normally run on the U-Boot command line, +including multiple commands (using e.g. ``;`` or ``&&``) and control structures +(``if``, ``while``, etc.). The exit code of ``fastboot`` will reflect the exit +code of the command you ran. + References ---------- -- cgit v1.2.3