Jump to content

[Armbian build PR] - cli: Add command "dts-check" to validate dts files and improve board & patch development overall (resubmission)


Recommended Posts

Posted

Description

This is a resubmission of https://github.com/armbian/build/pull/6482 which was reverted in https://github.com/armbian/build/pull/6524 due to build errors. I don't know what exactly failed last time and my build tests this time run successfully just fine on Ubuntu 24.04. Maybe the error is specific to certain configurations and will return, so please don't merge until CI has done some tests and a build was successful.

I have slightly improved this latest version by moving the function call to validate_dts in kernel.sh slightly further down after kernel_config ran since make expects a .config file.

Original description

This new command can be used like this:

./compile.sh BOARD=nanopi-r5c BRANCH=edge dts-check

It validates the dts/dtb file for the selected board against dt bindings 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.

Documentation summary for feature

(This was already added to the documentation in https://github.com/armbian/documentation/commit/4cf2ff462b185e809318c3e8249a4fe7d4f947a1)

  • [x] short description (copy / paste of PR title) cli: Add command "dts-check" to validate dts files and improve board & patch development overall
  • [x] summary (description relevant for end users) This command validates the dts/dtb file for the selected board against device tree bindings and outputs the validation logs to the user. It 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.
  • [x] example of usage (how to see this in function)
./compile.sh BOARD=nanopi-r5c BRANCH=edge dts-check

Then wait for the validation to finish and check the output. If there is anything wrong with your board's device tree, you will see errors or warnings in the log. Analyze them carefully and use this information to improve your dts file. Please note: Errors or warnings can also be introduced by SoC/board patches. When patching in new functions, like crypto for the RK3588, not only add the relevant parts to rk3588s.dtsi, but also try to add the device tree bindings in linux/Documentation/devicetree/bingings/ for validation.

How Has This Been Tested?

  • [x] Command success without errors: ./compile.sh BOARD=nanopi-r5c BRANCH=edge dts-check
  • [x] Normal build success without errors: ./compile.sh build BOARD=nanopi-r5c BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no EXPERT=yes EXTRAWIFI=no KERNEL_CONFIGURE=no RELEASE=trixie
  • [ ] Testing with another configuration/machine is needed to avoid the mentioned build error

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings

View the full article

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines