cli: Add command "dts-check"

Validates the dts/dtb file for the selected board and outputs the validation logs to the user.
This can be used when adding a new board, developing or improving a dts file. Should lead to higher quality device trees and patches overall, if used.
This commit is contained in:
ColorfulRhino
2024-04-08 18:32:11 +02:00
committed by Igor
parent c46e99ec60
commit 54618c1bd3
6 changed files with 68 additions and 12 deletions

View File

@@ -9,6 +9,8 @@
function armbian_register_commands() {
# More than one command can map to the same handler. In that case, use ARMBIAN_COMMANDS_TO_VARS_DICT for specific vars.
# The handlers' functions "cli_${ARMBIAN_COMMAND_HANDLER}_pre_run" and "cli_${ARMBIAN_COMMAND_HANDLER}_run" get automatically called in "utils-cli.sh"
# Example: For command "docker-purge", the handler is "docker", which means the functions "cli_docker_pre_run" and "cli_docker_run" inside "cli-docker.sh are automatically called by "utils-cli.sh"
declare -g -A ARMBIAN_COMMANDS_TO_HANDLERS_DICT=(
["docker"]="docker" # thus requires cli_docker_pre_run and cli_docker_run
["docker-purge"]="docker"
@@ -70,6 +72,9 @@ function armbian_register_commands() {
["kernel-config"]="artifact"
["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.
["uboot"]="artifact"
["uboot-patch"]="artifact"
["atf-patch"]="artifact"
@@ -129,6 +134,7 @@ function armbian_register_commands() {
["rewrite-kernel-config"]="WHAT='kernel' KERNEL_CONFIGURE='yes' ARTIFACT_WILL_NOT_BUILD='yes' ARTIFACT_IGNORE_CACHE='yes' ${common_cli_artifact_vars}"
["kernel-patch"]="WHAT='kernel' CREATE_PATCHES='yes' ${common_cli_artifact_interactive_vars} ${common_cli_artifact_vars}"
["kernel-dtb"]="WHAT='kernel' KERNEL_DTB_ONLY='yes' ${common_cli_artifact_interactive_vars} ${common_cli_artifact_vars}"
["dts-check"]="WHAT='kernel' DTS_VALIDATE='yes' ARTIFACT_WILL_NOT_BUILD='yes'" # Not really an artifact, but cli output only. Builds nothing.
["uboot"]="WHAT='uboot' ${common_cli_artifact_vars}"
["uboot-config"]="WHAT='uboot' UBOOT_CONFIGURE='yes' ${common_cli_artifact_interactive_vars} ${common_cli_artifact_vars}"