Simplify templates#28
Merged
Merged
Conversation
ivoire
reviewed
May 29, 2026
| _smc91x_network_args = [ | ||
| "-C board.smsc_91c111.enabled=true", | ||
| "-C board.hostbridge.userNetworking=true", | ||
| r"-C board.hostbridge.userNetPorts=\"5555=5555\"", |
There was a problem hiding this comment.
Suggested change
| r"-C board.hostbridge.userNetPorts=\"5555=5555\"", | |
| '-C board.hostbridge.userNetPorts="5555=5555"' |
ivoire
reviewed
May 29, 2026
| _virtio_network_args = [ | ||
| "-C board.virtio_net.enabled=true", | ||
| "-C board.virtio_net.hostbridge.userNetworking=true", | ||
| r"-C board.virtio_net.hostbridge.userNetPorts=\"5555=5555\"", |
ivoire
reviewed
May 29, 2026
ivoire
left a comment
There was a problem hiding this comment.
LGTM, just a small change from using raw string.
d58694e to
460d196
Compare
bhcopeland
reviewed
Jun 1, 2026
| - "-C board.virtio_net.transport=legacy" | ||
| {% endif %} | ||
| {% for arg in network_args %} | ||
| - '{{ arg }}' |
Member
There was a problem hiding this comment.
This is probably safer with arg | tojson. (drop the quotes). Avoids invalid YAML sneaking in if an arg ever contains a quote. Edge case though :)
Collaborator
Author
There was a problem hiding this comment.
cool, thank you, fixed now
bhcopeland
reviewed
Jun 1, 2026
| - 'root@qcom-armv8a:' | ||
| {% endif %} | ||
| {% for prompt in device.extra_prompts %} | ||
| - '{{ prompt }}' |
Member
There was a problem hiding this comment.
Problem here is if there is a ' this will also break. Corner case also, but probably best to just use {{ prompt | tojson }}
Both branches of the if/else only differed by the -k flag. Inline the conditional flag instead. Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
The linaro/kir image tag was hardcoded in five places across
fastboot.yaml.jinja2 and fastboot-oe.yaml.jinja2 via
{{ X|default('linaro/kir:...') }}.
Move the image to a KIR_IMAGE constant in fastboot.py and expose
it through three FastbootDevice class attributes. The templates
read the attribute directly.
Next image bump touches one line.
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
The if/else in fvp-morello.yaml.jinja2 picked between two sets of network arguments based on whether the smc91x test was requested. Move both lists into MorelloFVPDevice and pick one in Python. The template just loops over the resulting list. Same rendered output. The choice is now next to the explanation for why it exists, and it can be unit-tested. Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
The template checked device.name == 'fastboot-dragonboard-845c'. The class is named fastboot-oe-dragonboard-845c, so the check never matched. The prompt was never emitted. Set extra_prompts on FastbootOEDragonboard_845c and loop over device.extra_prompts, like fastboot.yaml.jinja2 does. The prompt now fires for fastboot-oe-dragonboard-845c jobs. Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
460d196 to
6c5e365
Compare
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.
Move template constants and decisions into device classes; fix dead qcom prompt check in fastboot-oe.