[PATCH v2 0/4] Attempt to collect standard extensions for build output

We would like 'buildman -k' to keep the build outputs. This series tries to do this by adding more common extensions to the list.
It also includes a few minor fixes.
Changes in v2: - Redo patch based on dropping the binman restriction
Simon Glass (4): buildman: Keep all common output files buildman: Show progress when regenerating the board.cfg file buildman: Start the clock when the build starts kontron_sl28: Use u-boot-update.bin instead of u-boot.update
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 2 +- doc/board/kontron/sl28.rst | 4 ++-- tools/buildman/boards.py | 15 ++++++++++++--- tools/buildman/builder.py | 3 ++- tools/buildman/builderthread.py | 12 ++++++++---- tools/buildman/control.py | 3 ++- 6 files changed, 27 insertions(+), 12 deletions(-)

Make a list of common output extensions and use it to ensure that the -k option preserves all of these.
Signed-off-by: Simon Glass sjg@chromium.org Suggested-by: Tom Rini trini@konsulko.com ---
Changes in v2: - Redo patch based on dropping the binman restriction
tools/buildman/builderthread.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 25f460c207db..6a61f64da1d4 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -23,6 +23,9 @@ from u_boot_pylib import command RETURN_CODE_RETRY = -1 BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl']
+# Common extensions for images +COMMON_EXTS = ['.bin', '.rom', '.itb', '.img'] + def mkdir(dirname, parents=False): """Make a directory if it doesn't already exist.
@@ -636,10 +639,11 @@ class BuilderThread(threading.Thread):
# Now write the actual build output if keep_outputs: - copy_files( - result.out_dir, build_dir, '', - ['u-boot*', '*.bin', '*.map', '*.img', 'MLO', 'SPL', - 'include/autoconf.mk', 'spl/u-boot-spl*']) + to_copy = ['u-boot*', '*.map', 'MLO', 'SPL', + 'include/autoconf.mk', 'spl/u-boot-spl*', + 'tpl/u-boot-tpl*', 'vpl/u-boot-vpl*'] + to_copy += [f'*{ext}' for ext in COMMON_EXTS] + copy_files(result.out_dir, build_dir, '', to_copy)
def _send_result(self, result): """Send a result to the builder for processing

On Thu, Sep 07, 2023 at 10:00:17AM -0600, Simon Glass wrote:
Make a list of common output extensions and use it to ensure that the -k option preserves all of these.
Signed-off-by: Simon Glass sjg@chromium.org Suggested-by: Tom Rini trini@konsulko.com
Reviewed-by: Tom Rini trini@konsulko.com

On Thu, Sep 07, 2023 at 10:00:17AM -0600, Simon Glass wrote:
Make a list of common output extensions and use it to ensure that the -k option preserves all of these.
Signed-off-by: Simon Glass sjg@chromium.org Suggested-by: Tom Rini trini@konsulko.com
Reviewed-by: Tom Rini trini@konsulko.com

This can take a while, so show a message when starting.
Signed-off-by: Simon Glass sjg@chromium.org Reported-by Tom Rini trini@konsulko.com ---
(no changes since v1)
tools/buildman/boards.py | 15 ++++++++++++--- tools/buildman/control.py | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index eef3f19f7ad6..341a5056dfd2 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -19,6 +19,7 @@ import time from buildman import board from buildman import kconfiglib
+from u_boot_pylib.terminal import print_clear, tprint
### constant variables ### OUTPUT_FILE = 'boards.cfg' @@ -863,11 +864,19 @@ class Boards: Returns: bool: True if all is well, False if there were warnings """ - if not force and output_is_new(output, CONFIG_DIR, '.'): + if not force: if not quiet: - print(f'{output} is up to date. Nothing to do.') - return True + tprint('\rChecking for Kconfig changes...', newline=False) + is_new = output_is_new(output, CONFIG_DIR, '.') + print_clear() + if is_new: + if not quiet: + print(f'{output} is up to date. Nothing to do.') + return True + if not quiet: + tprint('\rGenerating board list...', newline=False) params_list, warnings = self.build_board_list(CONFIG_DIR, '.', jobs) + print_clear() for warn in warnings: print(warn, file=sys.stderr) self.format_and_output(params_list, output) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index f2ffb7f5b4aa..8f6850c52113 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -621,7 +621,8 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None, if not brds: brds = get_boards_obj(output_dir, args.regen_board_list, args.maintainer_check, args.full_check, - args.threads, args.verbose) + args.threads, args.verbose and + not args.print_arch and not args.print_prefix) if isinstance(brds, int): return brds

This can take a while, so show a message when starting.
Signed-off-by: Simon Glass sjg@chromium.org Reported-by Tom Rini trini@konsulko.com ---
(no changes since v1)
tools/buildman/boards.py | 15 ++++++++++++--- tools/buildman/control.py | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-)
Applied to u-boot-dm/next, thanks!

The Kconfig and maintainer processing can take a while, sometimes 5 seconds or more. This skews the timing printed by buildmand when the build completes. Start the clock when the threads start to avoid this problem.
Signed-off-by: Simon Glass sjg@chromium.org Suggested-by: Tom Rini trini@konsulko.com ---
(no changes since v1)
tools/buildman/builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index ecbd368c47a5..5305477c5be6 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -328,7 +328,7 @@ class Builder: self._build_period_us = None self._complete_delay = None self._next_delay_update = datetime.now() - self._start_time = datetime.now() + self._start_time = None self._step = step self._error_lines = 0 self.no_subdirs = no_subdirs @@ -1778,6 +1778,7 @@ class Builder: self._prepare_output_space() if not self._ide: tprint('\rStarting build...', newline=False) + self._start_time = datetime.now() self.setup_build(board_selected, commits) self.process_result(None) self.thread_exceptions = []

The Kconfig and maintainer processing can take a while, sometimes 5 seconds or more. This skews the timing printed by buildmand when the build completes. Start the clock when the threads start to avoid this problem.
Signed-off-by: Simon Glass sjg@chromium.org Suggested-by: Tom Rini trini@konsulko.com ---
(no changes since v1)
tools/buildman/builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-dm/next, thanks!

A '.update' extension does not get preserved by buildman, so change it.
Signed-off-by: Simon Glass sjg@chromium.org Acked-by: Michael Walle michael@walle.cc ---
(no changes since v1)
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 2 +- doc/board/kontron/sl28.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi index 83750ab001b2..aacf181e2dd0 100644 --- a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +++ b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi @@ -64,7 +64,7 @@
&binman { u-boot-update { - filename = "u-boot.update"; + filename = "u-boot-update.bin";
fit { description = "FIT update image"; diff --git a/doc/board/kontron/sl28.rst b/doc/board/kontron/sl28.rst index 44435d90c624..2cb8ec62be42 100644 --- a/doc/board/kontron/sl28.rst +++ b/doc/board/kontron/sl28.rst @@ -39,12 +39,12 @@ Update image ------------
After the build finished, there will be an update image called -u-boot.update. This can either be used in the DFU mode (which isn't +u-boot-update.bin. This can either be used in the DFU mode (which isn't supported yet) or encapsulated in an EFI UpdateCapsule.
To build the capsule use the following command
- $ tools/mkeficapsule -f u-boot.update -i 1 UpdateUboot + $ tools/mkeficapsule -f u-boot-update.bin -i 1 UpdateUboot
Afterward you can copy this file to your ESP into the /EFI/UpdateCapsule/ folder. On the next EFI boot this will automatically update your

A '.update' extension does not get preserved by buildman, so change it.
Signed-off-by: Simon Glass sjg@chromium.org Acked-by: Michael Walle michael@walle.cc ---
(no changes since v1)
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 2 +- doc/board/kontron/sl28.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied to u-boot-dm/next, thanks!
participants (2)
-
Simon Glass
-
Tom Rini