From acfd9c8dcb0cc5bbef037432ce3455a0f76ae9f6 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Sat, 10 Jan 2026 03:26:54 +0100 Subject: [PATCH] "get completely rid of dead code toolchain stuff", pt2 - this stuff has been laying around, unused, for years --- lib/functions/compilation/kernel-make.sh | 24 ++++++++++++------------ lib/functions/compilation/kernel.sh | 3 +-- lib/functions/general/python-tools.sh | 2 +- lib/functions/host/mountpoints.sh | 2 -- lib/functions/host/prepare-host.sh | 2 -- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/lib/functions/compilation/kernel-make.sh b/lib/functions/compilation/kernel-make.sh index e7da5ad15a..5b7a230aec 100644 --- a/lib/functions/compilation/kernel-make.sh +++ b/lib/functions/compilation/kernel-make.sh @@ -18,13 +18,13 @@ function run_kernel_make_internal() { prepare_distcc_compilation_config common_make_envs=( - "CCACHE_BASEDIR=\"$(pwd)\"" # Base directory for ccache, for cache reuse # @TODO: experiment with this and the source path to maximize hit rate - "CCACHE_TEMPDIR=\"${CCACHE_TEMPDIR:?}\"" # Temporary directory for ccache, under WORKDIR - "PATH=\"${toolchain}:${PYTHON3_INFO[USERBASE]}/bin:${PATH}\"" # Insert the toolchain and the pip binaries into the PATH - "PYTHONPATH=\"${PYTHON3_INFO[MODULES_PATH]}:${PYTHONPATH}\"" # Insert the pip modules downloaded by Armbian into PYTHONPATH (needed for dtb checks) - "DPKG_COLORS=always" # Use colors for dpkg @TODO no dpkg is done anymore, remove? - "XZ_OPT='--threads=0'" # Use parallel XZ compression - "TERM='${TERM}'" # Pass the terminal type, so that 'make menuconfig' can work. + "CCACHE_BASEDIR='$(pwd)'" # Base directory for ccache, for cache reuse # @TODO: experiment with this and the source path to maximize hit rate + "CCACHE_TEMPDIR='${CCACHE_TEMPDIR:?}'" # Temporary directory for ccache, under WORKDIR + "PATH='${PYTHON3_INFO[USERBASE]}/bin:${PATH}'" # Insert the pip binaries into the PATH + "PYTHONPATH='${PYTHON3_INFO[MODULES_PATH]}:${PYTHONPATH}'" # Insert the pip modules downloaded by Armbian into PYTHONPATH (needed for dtb checks) + "DPKG_COLORS=always" # Use colors for dpkg @TODO no dpkg is done anymore, remove? + "XZ_OPT='--threads=0'" # Use parallel XZ compression + "TERM='${TERM}'" # Pass the terminal type, so that 'make menuconfig' can work. "COLUMNS='${COLUMNS:-160}'" "COLORFGBG='${COLORFGBG}'" ) @@ -96,18 +96,18 @@ function run_kernel_make_long_running() { function kernel_determine_toolchain() { # compare with the architecture of the current Debian node - # if it matches we use the system compiler if dpkg-architecture -e "${ARCH}"; then display_alert "Native compilation" "target ${ARCH} on host $(dpkg --print-architecture)" else display_alert "Cross compilation" "target ${ARCH} on host $(dpkg --print-architecture)" fi + declare kernel_compiler_full kernel_compiler_version if [[ "${KERNEL_COMPILER}" == "clang" ]]; then - KERNEL_COMPILER_FULL="${KERNEL_COMPILER}" + kernel_compiler_full="${KERNEL_COMPILER}" else - KERNEL_COMPILER_FULL="${KERNEL_COMPILER}gcc" + kernel_compiler_full="${KERNEL_COMPILER}gcc" fi - kernel_compiler_version="$(eval env "${KERNEL_COMPILER_FULL}" -dumpfullversion -dumpversion)" - display_alert "Compiler version" "${KERNEL_COMPILER_FULL} ${kernel_compiler_version}" "info" + kernel_compiler_version="$(eval env "${kernel_compiler_full}" -dumpfullversion -dumpversion)" + display_alert "Compiler version" "${kernel_compiler_full} ${kernel_compiler_version}" "info" } diff --git a/lib/functions/compilation/kernel.sh b/lib/functions/compilation/kernel.sh index 058e5212a2..72ffeb96ca 100644 --- a/lib/functions/compilation/kernel.sh +++ b/lib/functions/compilation/kernel.sh @@ -73,8 +73,7 @@ function compile_kernel() { declare version version=$(grab_version "$kernel_work_dir") - # determine the toolchain - declare toolchain + # log the kernel toolchain version LOG_SECTION="kernel_determine_toolchain" do_with_logging do_with_hooks kernel_determine_toolchain kernel_config # has it's own logging sections inside diff --git a/lib/functions/general/python-tools.sh b/lib/functions/general/python-tools.sh index 712c876006..557193a23f 100644 --- a/lib/functions/general/python-tools.sh +++ b/lib/functions/general/python-tools.sh @@ -107,7 +107,7 @@ function prepare_python_and_pip() { "PYTHONUSERBASE=${PYTHON3_INFO[USERBASE]}" "PYTHONUNBUFFERED=yes" "PYTHONPYCACHEPREFIX=${PYTHON3_INFO[PYCACHEPREFIX]}" - "PATH=\"${toolchain}:${PYTHON3_INFO[USERBASE]}/bin:${PATH}\"" # add toolchain to PATH to make building wheels work + "PATH='${PYTHON3_INFO[USERBASE]}/bin:${PATH}'" ) # If the hash file exists, we're done. diff --git a/lib/functions/host/mountpoints.sh b/lib/functions/host/mountpoints.sh index a9758d05df..cf322baedc 100644 --- a/lib/functions/host/mountpoints.sh +++ b/lib/functions/host/mountpoints.sh @@ -17,7 +17,6 @@ function prepare_armbian_mountpoints_description_dict() { "cache" "cache/git-bare" "cache/git-bundles" - "cache/toolchain" "cache/aptcache" "cache/rootfs" "cache/initrd" @@ -38,7 +37,6 @@ function prepare_armbian_mountpoints_description_dict() { ["cache"]="docker_kind_linux=bind docker_kind_darwin=namedvolume" # catch-all cache, could be bind-mounted or a volume. On Darwin it's too slow to bind-mount, so it's a volume by default. On Linux, it's a bind-mount by default. ["cache/git-bare"]="docker_kind_linux=bind docker_kind_darwin=namedvolume" # Git bare repos (kernel/u-boot). On Darwin it's too slow to bind-mount, so it's a volume by default. On Linux, it's a bind-mount by default. ["cache/git-bundles"]="docker_kind_linux=bind docker_kind_darwin=namedvolume" # Downloads of git bundles, can be bind-mounted or a volume. On Darwin it's too slow to bind-mount, so it's a volume by default. On Linux, it's a bind-mount by default. - ["cache/toolchain"]="docker_kind_linux=bind docker_kind_darwin=namedvolume" # toolchain cache, can be bind-mounted or a volume. On Darwin it's too slow to bind-mount, so it's a volume by default. On Linux, it's a bind-mount by default. ["cache/aptcache"]="docker_kind_linux=bind docker_kind_darwin=namedvolume" # .deb apt cache, replaces apt-cacher-ng. Can be bind-mounted or a volume. On Darwin it's too slow to bind-mount, so it's a volume by default. On Linux, it's a bind-mount by default. ["cache/rootfs"]="docker_kind_linux=bind docker_kind_darwin=namedvolume" # rootfs .tar.zst cache, can be bind-mounted or a volume. On Darwin it's too slow to bind-mount, so it's a volume by default. On Linux, it's a bind-mount by default. ["cache/initrd"]="docker_kind_linux=bind docker_kind_darwin=namedvolume" # initrd.img cache, can be bind-mounted or a volume. On Darwin it's too slow to bind-mount, so it's a volume by default. On Linux, it's a bind-mount by default. diff --git a/lib/functions/host/prepare-host.sh b/lib/functions/host/prepare-host.sh index 865a7e7f4d..b7a38f7e94 100644 --- a/lib/functions/host/prepare-host.sh +++ b/lib/functions/host/prepare-host.sh @@ -93,8 +93,6 @@ function prepare_host_noninteractive() { # create directory structure # @TODO: this should be close to DEST, otherwise super-confusing mkdir -p "${SRC}"/{cache,output} "${USERPATCHES_PATH}" "${SRC}"/output/info - - # @TODO: original: mkdir -p "${DEST}"/debs-beta/extra "${DEST}"/debs/extra "${DEST}"/{config,debug,patch} "${USERPATCHES_PATH}"/overlay "${SRC}"/cache/{sources,hash,hash-beta,toolchain,utility,rootfs} "${SRC}"/.tmp mkdir -p "${USERPATCHES_PATH}"/overlay "${SRC}"/cache/{sources,rootfs} "${SRC}"/.tmp prepare_host_binfmt_qemu # in qemu-static.sh as most binfmt/qemu logic is there now