mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 13:16:35 +00:00
system: add option to pass extra args to post-build and post-image scripts
It can be useful to have different configuration use the same post-build and/or post-image scripts as they share a common infrastructure, but yet have minor differentiation. This option allows passing zero or more additional arguments to each post-build or post-image script. The same set of extra arguments are passed to all scripts, it is not possible to pass different arguments to each script. [Peter: fix help text, post-image gets called with the images dir] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
parent
575dac6922
commit
f1f97b3a05
4
Makefile
4
Makefile
@ -512,7 +512,7 @@ endif
|
|||||||
|
|
||||||
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
|
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
|
||||||
$(call MESSAGE,"Executing post-build script $(s)"); \
|
$(call MESSAGE,"Executing post-build script $(s)"); \
|
||||||
$(s) $(TARGET_DIR)$(sep))
|
$(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
|
||||||
|
|
||||||
ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
|
ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
|
||||||
LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
|
LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
|
||||||
@ -558,7 +558,7 @@ endif
|
|||||||
target-post-image:
|
target-post-image:
|
||||||
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
|
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
|
||||||
$(call MESSAGE,"Executing post-image script $(s)"); \
|
$(call MESSAGE,"Executing post-image script $(s)"); \
|
||||||
$(s) $(BINARIES_DIR)$(sep))
|
$(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
|
||||||
|
|
||||||
toolchain-eclipse-register:
|
toolchain-eclipse-register:
|
||||||
./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH)
|
./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH)
|
||||||
|
@ -69,15 +69,20 @@ specify a space-separated list of scripts in the
|
|||||||
found in the +System configuration+ menu as well.
|
found in the +System configuration+ menu as well.
|
||||||
|
|
||||||
Each of those scripts will be called with the path to the +images+
|
Each of those scripts will be called with the path to the +images+
|
||||||
output directory as first and unique argument, and will be executed
|
output directory as first argument, and will be executed with the main
|
||||||
with the main Buildroot source directory as the current
|
Buildroot source directory as the current directory. Those scripts will
|
||||||
directory. Those scripts will be executed as the user that executes
|
be executed as the user that executes Buildroot, which should normally
|
||||||
Buildroot, which should normally not be the root user. Therefore, any
|
not be the root user. Therefore, any action requiring root permissions
|
||||||
action requiring root permissions in one of these _post-image scripts_
|
in one of these _post-image scripts_ will require special handling
|
||||||
will require special handling (usage of fakeroot or sudo), which is
|
(usage of fakeroot or sudo), which is left to the script developer.
|
||||||
left to the script developer.
|
|
||||||
|
|
||||||
Just like for the _post-build scripts_ mentioned above, you also have
|
Just like for the _post-build scripts_ mentioned above, you also have
|
||||||
access to the following environment variables from your _post-image
|
access to the following environment variables from your _post-image
|
||||||
scripts_: +BUILDROOT_CONFIG+, +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+,
|
scripts_: +BUILDROOT_CONFIG+, +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+,
|
||||||
+BINARIES_DIR+ and +BASE_DIR+.
|
+BINARIES_DIR+ and +BASE_DIR+.
|
||||||
|
|
||||||
|
Additionally, each of the +BR2_ROOTFS_POST_BUILD_SCRIPT+ and
|
||||||
|
+BR2_ROOTFS_POST_IMAGE_SCRIPT+ scripts will be passed the arguments
|
||||||
|
specified in +BR2_ROOTFS_POST_SCRIPT_ARGS+ (if that is not empty).
|
||||||
|
All the scripts will be passed the exact same set of arguments, it
|
||||||
|
is not possible to pass different sets of arguments to each script.
|
||||||
|
@ -272,9 +272,9 @@ config BR2_ROOTFS_POST_BUILD_SCRIPT
|
|||||||
add-ons and the like, so the generated files can be used directly
|
add-ons and the like, so the generated files can be used directly
|
||||||
without further processing.
|
without further processing.
|
||||||
|
|
||||||
These scripts are called with the target directory name as first and
|
These scripts are called with the target directory name as first
|
||||||
only argument. Make sure the exit code of those scripts are 0,
|
argument. Make sure the exit code of those scripts are 0, otherwise
|
||||||
otherwise make will stop after calling them.
|
make will stop after calling them.
|
||||||
|
|
||||||
config BR2_ROOTFS_POST_IMAGE_SCRIPT
|
config BR2_ROOTFS_POST_IMAGE_SCRIPT
|
||||||
string "Custom scripts to run after creating filesystem images"
|
string "Custom scripts to run after creating filesystem images"
|
||||||
@ -291,7 +291,23 @@ config BR2_ROOTFS_POST_IMAGE_SCRIPT
|
|||||||
action.
|
action.
|
||||||
|
|
||||||
These scripts are called with the images directory name as
|
These scripts are called with the images directory name as
|
||||||
first and only argument. The script is executed from the
|
first argument. The script is executed from the main Buildroot
|
||||||
main Buildroot source directory as the current directory.
|
source directory as the current directory.
|
||||||
|
|
||||||
|
config BR2_ROOTFS_POST_SCRIPT_ARGS
|
||||||
|
string "Extra post-{build,image} arguments"
|
||||||
|
depends on BR2_ROOTFS_POST_BUILD_SCRIPT != "" || BR2_ROOTFS_POST_IMAGE_SCRIPT != ""
|
||||||
|
help
|
||||||
|
Pass these aditional arguments to each post-build or post-image
|
||||||
|
scripts.
|
||||||
|
|
||||||
|
Note that all the post-build and post-image scripts will be passed
|
||||||
|
the same set of arguments, you can not pass different arguments to
|
||||||
|
each script.
|
||||||
|
|
||||||
|
Note also, as stated in their respective help text, that the first
|
||||||
|
argument to each post-build or post-image script is the target
|
||||||
|
directory / images directory. The arguments in this option will be
|
||||||
|
passed *after* those.
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
Loading…
x
Reference in New Issue
Block a user