Skip to content

feat!: add Fdt::with_options (and variants) - #104

Open
m4tx wants to merge 1 commit into
mainfrom
fix-fdt-new
Open

m4tx wants to merge 1 commit into
mainfrom
fix-fdt-new

Conversation

@m4tx

@m4tx m4tx commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Currently, Fdt::new does a strict validation of node and property names. According to the DTB spec, these names cannot exceed 31 characters in length. However, in practice, many DTBs do (including ones typically used in Linux), and dtc doesn't reject such trees when compiling DTS files.

This adds with_options method to Fdt that allows to specify the exact behaviour. The default is to allow names exceeding 31 characters; UTF-8 validity is still checked.

Recently added from_raw_bounded was also replaced with this.

Fixes #101

@m4tx
m4tx requested a review from qwandor October 26, 2026 11:03
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.61%. Comparing base (4a7faf2) to head (b91c52e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
+ Coverage   93.17%   93.61%   +0.43%     
==========================================
  Files          26       26              
  Lines        3339     3428      +89     
==========================================
+ Hits         3111     3209      +98     
+ Misses        228      219       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m4tx m4tx changed the title feat: add Fdt::with_options (and variants) feat!: add Fdt::with_options (and variants) Oct 26, 2026
Currently, `Fdt::new` does a strict validation of node and property
names. According to the DTB spec, these names cannot exceed 31
characters in length. However, in practice, many DTBs do (including ones
typically used in Linux), and `dtc` doesn't reject such trees when
compiling DTS files.

This adds `with_options` method to `Fdt` that allows to specify the
exact behaviour. The default is to allow names exceeding 31 characters;
UTF-8 validity is still checked.

Recently added `from_raw_bounded` was also replaced with this.

Fixes #101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fdt::new rejects a whole tree over one property name of 32 characters

1 participant