From a320986c44774f3729454249a94904365f020a58 Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Sat, 18 Nov 2023 18:13:08 +0000 Subject: [PATCH] package/Makefile.in: add PARALLEL_JOBS to post-build/post-image scripts Post-build, post-image, and other build scripts may run some commands in parallel, for example to parallelize xargs, Makefiles, etc. Export PARALLEL_JOBS to these scripts so they can enforce the same job limits that other Buildroot packages use. Signed-off-by: Brandon Maier Signed-off-by: Arnout Vandecappelle --- docs/manual/customize-post-image.adoc | 4 ++-- docs/manual/customize-rootfs.adoc | 1 + docs/manual/debugging-buildroot.adoc | 1 + package/Makefile.in | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/manual/customize-post-image.adoc b/docs/manual/customize-post-image.adoc index 1f11cf915f..849e941de3 100644 --- a/docs/manual/customize-post-image.adoc +++ b/docs/manual/customize-post-image.adoc @@ -33,8 +33,8 @@ arguments that are only used for the post-image scripts you can use Again just like for the post-build scripts, the scripts have access to the environment variables +BR2_CONFIG+, +HOST_DIR+, +STAGING_DIR+, -+TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+, +CONFIG_DIR+ and -+BASE_DIR+. ++TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+, +CONFIG_DIR+, +BASE_DIR+, +and +PARALLEL_JOBS+. The post-image scripts will be executed as the user that executes Buildroot, which should normally _not_ be the root user. Therefore, any diff --git a/docs/manual/customize-rootfs.adoc b/docs/manual/customize-rootfs.adoc index 1384c1d2d3..d334093748 100644 --- a/docs/manual/customize-rootfs.adoc +++ b/docs/manual/customize-rootfs.adoc @@ -75,6 +75,7 @@ In addition, you may also use these environment variables: - +BINARIES_DIR+: the place where all binary files (aka images) are stored - +BASE_DIR+: the base output directory + - +PARALLEL_JOBS+: the number of jobs to use when running parallel processes. Below three more methods of customizing the target filesystem are described, but they are not recommended. diff --git a/docs/manual/debugging-buildroot.adoc b/docs/manual/debugging-buildroot.adoc index f575fc48ee..b9068ead52 100644 --- a/docs/manual/debugging-buildroot.adoc +++ b/docs/manual/debugging-buildroot.adoc @@ -41,3 +41,4 @@ The script has access to the following variables: - +BINARIES_DIR+: the place where all binary files (aka images) are stored - +BASE_DIR+: the base output directory + - +PARALLEL_JOBS+: the number of jobs to use when running parallel processes. diff --git a/package/Makefile.in b/package/Makefile.in index 5476234c7e..47a89f1ae1 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -331,7 +331,8 @@ EXTRA_ENV = \ BR2_DL_DIR=$(BR2_DL_DIR) \ BUILD_DIR=$(BUILD_DIR) \ CONFIG_DIR=$(CONFIG_DIR) \ - O=$(CANONICAL_O) + O=$(CANONICAL_O) \ + PARALLEL_JOBS=$(PARALLEL_JOBS) ################################################################################ # settings we need to pass to configure