armbian-next: take a breath: config might mark aggregation required; aggregation requires prepare_host, and thus runs in default-build

This commit is contained in:
Ricardo Pardini
2023-01-29 23:49:52 +01:00
parent bef7f8fee4
commit bb6975707a
4 changed files with 19 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ function cli_rootfs_run() {
declare -g -r RELEASE="${RELEASE}" # make readonly for finding who tries to change it declare -g -r RELEASE="${RELEASE}" # make readonly for finding who tries to change it
declare -g -r NEEDS_BINFMT="yes" # make sure binfmts are installed during prepare_host_interactive declare -g -r NEEDS_BINFMT="yes" # make sure binfmts are installed during prepare_host_interactive
# prep_conf_main_only_rootfs_ni is prep_conf_main_only_rootfs_ni() + aggregate_packages_in_logging_section() . # prep_conf_main_only_rootfs_ni is prep_conf_main_only_rootfs_ni() + mark_aggregation_required_in_default_build_start()
prep_conf_main_only_rootfs_ni < /dev/null # no stdin for this, so it bombs if tries to be interactive. prep_conf_main_only_rootfs_ni < /dev/null # no stdin for this, so it bombs if tries to be interactive.
declare -g -r ARCH="${ARCH}" # make readonly for finding who tries to change it declare -g -r ARCH="${ARCH}" # make readonly for finding who tries to change it

View File

@@ -6,6 +6,10 @@ function assert_requires_aggregation() {
fi fi
} }
function mark_aggregation_required_in_default_build_start() {
declare -i -g -r aggregation_required_in_default_build_start=1 # global, readonly.
}
function aggregate_packages_in_logging_section() { function aggregate_packages_in_logging_section() {
# Aggregate packages, in its own logging section; this decides internally on KERNEL_ONLY=no # Aggregate packages, in its own logging section; this decides internally on KERNEL_ONLY=no
# We need aggregation to be able to build bsp packages, which contain scripts coming from the aggregation. # We need aggregation to be able to build bsp packages, which contain scripts coming from the aggregation.

View File

@@ -33,7 +33,8 @@ function prep_conf_main_build_single() {
LOG_SECTION="ni_check_basic_host" do_with_logging check_basic_host LOG_SECTION="ni_check_basic_host" do_with_logging check_basic_host
fi fi
aggregate_packages_in_logging_section # can't aggregate here, since it needs a prepared host... mark to do it later.
mark_aggregation_required_in_default_build_start
display_alert "Configuration prepared for BOARD build" "${BOARD}.${BOARD_TYPE}" "info" display_alert "Configuration prepared for BOARD build" "${BOARD}.${BOARD_TYPE}" "info"
} }
@@ -73,7 +74,10 @@ function prep_conf_main_minimal_ni() {
# Lean version, for building rootfs, that doesn't need BOARD/BOARDFAMILY; never interactive. # Lean version, for building rootfs, that doesn't need BOARD/BOARDFAMILY; never interactive.
function prep_conf_main_only_rootfs_ni() { function prep_conf_main_only_rootfs_ni() {
prep_conf_main_minimal_ni prep_conf_main_minimal_ni
aggregate_packages_in_logging_section
# can't aggregate here, since it needs a prepared host... mark to do it later.
mark_aggregation_required_in_default_build_start
display_alert "Configuration prepared for minimal+rootfs" "prep_conf_main_only_rootfs_ni" "info" display_alert "Configuration prepared for minimal+rootfs" "prep_conf_main_only_rootfs_ni" "info"
} }

View File

@@ -43,6 +43,14 @@ function main_default_start_build() {
# Prepare ccache, cthreads, etc for the build # Prepare ccache, cthreads, etc for the build
LOG_SECTION="prepare_compilation_vars" do_with_logging prepare_compilation_vars LOG_SECTION="prepare_compilation_vars" do_with_logging prepare_compilation_vars
# from mark_aggregation_required_in_default_build_start() possibly marked during config
if [[ ${aggregation_required_in_default_build_start:-0} -gt 0 ]]; then
display_alert "Configuration requires aggregation" "running aggregation now" "debug"
aggregate_packages_in_logging_section
else
display_alert "Configuration does not require aggregation" "skipping aggregation" "debug"
fi
return 0 return 0
} }