Files
u-boot/cmd
Jerome Forissier ec89a4f7a3 cmd: add spawn and wait commands
Add a spawn command which runs another command in the background, as
well as a wait command to suspend the shell until one or more background
jobs have completed. The job_id environment variable is set by spawn and
wait accepts optional job ids, so that one can selectively wait on any
job.

Example:

 => date; spawn sleep 5; spawn sleep 3; date; echo "waiting..."; wait; date
 Date: 2025-02-21 (Friday)    Time: 17:04:52
 Date: 2025-02-21 (Friday)    Time: 17:04:52
 waiting...
 Date: 2025-02-21 (Friday)    Time: 17:04:57
 =>

Another example showing how background jobs can make initlizations
faster. The board is i.MX93 EVK, with one spinning HDD connected to
USB1 via a hub, and a network cable plugged into ENET1.

 # From power up / reset
 u-boot=> setenv autoload 0
 u-boot=> setenv ud "usb start; dhcp"
 u-boot=> time run ud
 [...]
 time: 8.058 seconds

 # From power up / reset
 u-boot=> setenv autoload 0
 u-boot=> setenv ud "spawn usb start; spawn dhcp; wait"
 u-boot=> time run ud
 [...]
 time: 4.475 seconds

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-23 13:19:44 -06:00
..
2025-04-03 11:43:22 -06:00
2024-02-15 10:38:34 +01:00
2024-12-30 13:21:55 -06:00
2024-07-15 12:12:17 -06:00
2024-12-30 13:21:55 -06:00
2024-07-15 12:12:17 -06:00
2024-10-09 22:04:56 -06:00
2024-07-15 12:12:17 -06:00
2024-08-02 15:16:51 -03:00
2024-07-15 12:12:17 -06:00
2024-08-13 06:12:40 +02:00
2024-09-12 17:35:37 +02:00
2024-09-12 17:35:37 +02:00
2022-03-15 16:19:29 -04:00
2024-10-29 16:17:47 -06:00
2024-09-12 17:35:37 +02:00
2024-10-18 14:10:21 -06:00
2025-02-05 16:22:55 +01:00
2025-04-02 20:00:59 -06:00
2024-09-12 17:35:37 +02:00
2024-08-13 06:23:05 +02:00
2025-04-23 13:19:44 -06:00
2024-12-30 13:21:55 -06:00
2025-01-26 11:06:56 +01:00
2025-04-23 13:19:44 -06:00
2024-03-07 09:23:10 -05:00
2024-09-18 13:07:19 -06:00
2024-07-15 12:12:17 -06:00
2024-12-17 13:17:41 -06:00
2024-07-15 12:12:17 -06:00
2024-12-17 13:17:41 -06:00
2024-11-14 18:14:05 -06:00
2025-04-08 11:43:23 -06:00
2024-09-12 17:35:37 +02:00
2024-05-22 08:55:29 -06:00
2022-09-02 13:40:42 -04:00
2024-12-24 17:02:23 +01:00
2024-12-02 07:40:39 -06:00
2025-04-10 20:55:53 -06:00
2025-01-14 14:29:29 -06:00
2024-06-24 13:34:52 -06:00
2025-04-23 13:19:44 -06:00
2020-08-07 22:31:32 -04:00
2024-10-17 03:12:47 +02:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2025-01-28 08:58:41 +02:00
2024-12-31 19:00:46 -06:00
2024-10-10 16:02:20 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-11-14 18:14:05 -06:00
2024-09-18 13:00:59 -06:00
2024-07-15 12:12:17 -06:00