Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schemas: bootph: Add check for bootph tags in parent nodes #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions dtschema/schemas/bootph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,23 @@ properties:
description:
Include this node in all phases (for U-Boot see enum u_boot_phase).

allOf:
- if:
anyOf:
- required: [ bootph-pre-sram ]
- required: [ bootph-verify ]
- required: [ bootph-pre-ram ]
- required: [ bootph-some-ram ]
- required: [ bootph-all ]
then:
description: Parent nodes don't need bootph tags
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't need the same tag, but they might need a different one. I think the rule will be that if a child has a particular phase tag then it is implied in all its parents

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be doable. What about a child with bootph-all and parent with something else?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case we are implying bootph-all in the parent so it doesn't matter what tags are present

patternProperties:
'.*':
properties:
bootph-pre-sram: false
bootph-verify: false
bootph-pre-ram: false
bootph-some-ram: false
bootph-all: false

additionalProperties: true