[RFC] Add support for matching device-trees base on the /model property#76
Draft
xypron wants to merge 2 commits into
Draft
[RFC] Add support for matching device-trees base on the /model property#76xypron wants to merge 2 commits into
xypron wants to merge 2 commits into
Conversation
Extend Stubble to support device-tree selection using the /model property from firmware-provided device-trees via a new .machdb section. The machdb section contains Machine:/DTB-Id: mappings that allow matching device-trees based on the model string when a compatible-based match is not possible. Device-tree matching now follows this priority: 1. HWID matching (if no firmware dtb exists) 2. /compatible property matching 3. /model property matching via machdb (if machdb section exists) 4. Use pre-installed device-tree Changes: - Add UNIFIED_SECTION_MACHDB enum and .machdb section support - Add devicetree_get_model() to extract /model property from dtb - Add pe_machdb() for machdb parsing and model-based matching - Update pe_use_this_dtb() to call pe_machdb() when appropriate - Update README.md Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Provide our own copy of ukify to allow adding the --machdb parameter. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Model-based matching via machdb (pre-installed firmware device-tree needed)
If compatible string matching fails and a
.machdbsection is present, Stubbleextracts the
modelproperty from the firmware-provided device-tree and looksit up in the machdb database. The machdb maps model strings to device-tree
compatible strings, allowing device-tree selection when the compatible property
doesn't provide a direct match.
The machdb file format is a simple text format:
Each
Model:entry specifies a model string to match (from the firmwaredevice-tree's
/modelproperty). MultipleModel:entries can precede asingle
Compatible:entry. TheCompatible:value must match the compatiblestring of one of the appended device-trees. Whitespace after the labels is
ignored.
Use parameter --machdb for ./ukify.py.