armbian-next: move aggregation to after prepare_host(), and thus out of config, and with correct Python deps

This commit is contained in:
Ricardo Pardini 2023-01-06 01:33:52 +01:00
parent 8d55a3258b
commit d152574ea8
No known key found for this signature in database
GPG Key ID: 3D38CA12A66C5D02
3 changed files with 21 additions and 10 deletions

View File

@ -1,6 +1,22 @@
#!/usr/bin/env bash
function aggregate_all_packages() {
# This used to be called from config (main-config), but now it's moved default-build, after prepare_host, so Python hostdeps are available.
# So the aggregation results (hash, etc) are not available for config-dump.
function aggregate_packages() {
if [[ "${KERNEL_ONLY}" != "yes" ]]; then
display_alert "Aggregating packages" "rootfs" "info"
aggregate_all_packages_python
call_extension_method "post_aggregate_packages" "user_config_post_aggregate_packages" <<- 'POST_AGGREGATE_PACKAGES'
*After all aggregations are done*
Called after aggregating all package lists.
Packages will still be installed after this is called. It is not possible to change anything, though.
POST_AGGREGATE_PACKAGES
fi
}
function aggregate_all_packages_python() {
prepare_pip_packages_for_python_tools # although aggregation can run without any package, it does benefit
# Get a temporary file for the output. This is not WORKDIR yet, since we're still in configuration phase.
temp_file_for_aggregation="$(mktemp)"

View File

@ -363,15 +363,7 @@ function do_main_configuration() {
[[ -n $APT_PROXY_ADDR ]] && display_alert "Using custom apt-cacher-ng address" "$APT_PROXY_ADDR" "info"
# Time to calculate packages... or is it? @TODO move this to rootfs/image build stage
if [[ "${KERNEL_ONLY}" != "yes" ]]; then
aggregate_all_packages
call_extension_method "post_aggregate_packages" "user_config_post_aggregate_packages" <<- 'POST_AGGREGATE_PACKAGES'
*After all aggregations are done*
Called after aggregating all package lists.
Packages will still be installed after this is called. It is not possible to change anything, though.
POST_AGGREGATE_PACKAGES
fi
# @TODO: allow to run aggregation, for CONFIG_DEFS_ONLY? rootfs_aggregate_packages
# Give the option to configure DNS server used in the chroot during the build process
[[ -z $NAMESERVER ]] && NAMESERVER="1.0.0.1" # default is cloudflare alternate

View File

@ -26,6 +26,9 @@ function main_default_build_single() {
# Check and install dependencies, directory structure and settings
LOG_SECTION="prepare_host" do_with_logging prepare_host
# Aggregate packages, in its own logging section; this decides internally on KERNEL_ONLY=no
LOG_SECTION="aggregate_packages" do_with_logging aggregate_packages
# Create a directory inside WORKDIR with a "python" symlink to "/usr/bin/python2"; add it to PATH first.
BIN_WORK_DIR="${WORKDIR}/bin"
# No cleanup of this is necessary, since it's inside WORKDIR.