Skip to content

Commit

Permalink
cli: Improve formatting on dts-check scripts with shellfmt.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ColorfulRhino authored and igorpecovnik committed Jun 25, 2024
1 parent 24816c1 commit d75b181
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/functions/cli/commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 5 additions & 6 deletions lib/functions/compilation/kernel-dts-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
14 changes: 7 additions & 7 deletions lib/functions/compilation/kernel-make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}'"
)
Expand Down
2 changes: 1 addition & 1 deletion lib/functions/host/prepare-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d75b181

Please sign in to comment.