From d75b1816ff56fca51a269a8a5da17b73d743a5dc Mon Sep 17 00:00:00 2001 From: ColorfulRhino <131405023+ColorfulRhino@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:04:43 +0200 Subject: [PATCH] cli: Improve formatting on dts-check scripts with `shellfmt.sh` --- lib/functions/cli/commands.sh | 2 +- lib/functions/compilation/kernel-dts-check.sh | 11 +++++------ lib/functions/compilation/kernel-make.sh | 14 +++++++------- lib/functions/host/prepare-host.sh | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/functions/cli/commands.sh b/lib/functions/cli/commands.sh index b403cd1ae6f8..2c544601a26c 100644 --- a/lib/functions/cli/commands.sh +++ b/lib/functions/cli/commands.sh @@ -73,7 +73,7 @@ function armbian_register_commands() { ["rewrite-kernel-config"]="artifact" # Patch kernel and then check & validate the dtb file - ["dts-check"]="artifact" # Not really an artifact, but cli output only. Builds nothing. + ["dts-check"]="artifact" # Not really an artifact, but cli output only. Builds nothing. ["uboot"]="artifact" ["uboot-patch"]="artifact" diff --git a/lib/functions/compilation/kernel-dts-check.sh b/lib/functions/compilation/kernel-dts-check.sh index 89b14bcc5a1b..e74b040c7ee5 100644 --- a/lib/functions/compilation/kernel-dts-check.sh +++ b/lib/functions/compilation/kernel-dts-check.sh @@ -7,16 +7,15 @@ # This file is a part of the Armbian Build Framework # https://github.com/armbian/build/ - # Validate the dts/dtb file against dt bindings found in "linux/Documentation/devicetree/bindings/" # See slide 15 in https://elinux.org/images/1/17/How_to_Get_Your_DT_Schema_Bindings_Accepted_in_Less_than_10_Iterations_-_Krzysztof_Kozlowski%2C_Linaro_-_ELCE_2023.pdf function validate_dts() { - [[ -z "${BOOT_FDT_FILE}" ]] && exit_with_error "BOOT_FDT_FILE not set! No dts file to validate." - display_alert "Validating dts/dtb file for selected board" "${BOOT_FDT_FILE} ; see output below" "info" + [[ -z "${BOOT_FDT_FILE}" ]] && exit_with_error "BOOT_FDT_FILE not set! No dts file to validate." + display_alert "Validating dts/dtb file for selected board" "${BOOT_FDT_FILE} ; see output below" "info" - # "make CHECK_DTBS=y" uses the pip modules "dtschema" and "yamllint" - prepare_python_and_pip + # "make CHECK_DTBS=y" uses the pip modules "dtschema" and "yamllint" + prepare_python_and_pip - # Run "make CHECK_DTBS=y" for the selected board's dtb file + # Run "make CHECK_DTBS=y" for the selected board's dtb file run_kernel_make "CHECK_DTBS=y ${BOOT_FDT_FILE}" } diff --git a/lib/functions/compilation/kernel-make.sh b/lib/functions/compilation/kernel-make.sh index 6b3cd5d16121..519ae8b92bb3 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=\"${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. "COLUMNS='${COLUMNS:-160}'" "COLORFGBG='${COLORFGBG}'" ) diff --git a/lib/functions/host/prepare-host.sh b/lib/functions/host/prepare-host.sh index 144ef44e31f8..b06dcfb58d93 100644 --- a/lib/functions/host/prepare-host.sh +++ b/lib/functions/host/prepare-host.sh @@ -290,7 +290,7 @@ function adaptative_prepare_host_dependencies() { host_deps_add_extra_python # See python-tools.sh::host_deps_add_extra_python() ### Python3 -- required for Armbian's Python tooling, and also for more recent u-boot builds. Needs 3.9+; ffi-dev is needed for some Python packages when the wheel is not prebuilt - ### 'python3-setuptools' and 'python3-pyelftools' moved to requirements.txt to make sure build hosts use the same/latest versions of these tools. + ### 'python3-setuptools' and 'python3-pyelftools' moved to requirements.txt to make sure build hosts use the same/latest versions of these tools. host_dependencies+=("python3-dev" "python3-pip" "libffi-dev") # Needed for some u-boot's, lest "tools/mkeficapsule.c:21:10: fatal error: gnutls/gnutls.h"