Skip to content

Simplify templates#28

Merged
bhcopeland merged 4 commits into
kernelci:mainfrom
roxell:simplify-templates
Jun 4, 2026
Merged

Simplify templates#28
bhcopeland merged 4 commits into
kernelci:mainfrom
roxell:simplify-templates

Conversation

@roxell

@roxell roxell commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Move template constants and decisions into device classes; fix dead qcom prompt check in fastboot-oe.

Comment thread tuxlava/devices/fvp.py Outdated
_smc91x_network_args = [
"-C board.smsc_91c111.enabled=true",
"-C board.hostbridge.userNetworking=true",
r"-C board.hostbridge.userNetPorts=\"5555=5555\"",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
r"-C board.hostbridge.userNetPorts=\"5555=5555\"",
'-C board.hostbridge.userNetPorts="5555=5555"'

Comment thread tuxlava/devices/fvp.py Outdated
_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\"",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same here.

@ivoire ivoire left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, just a small change from using raw string.

@roxell roxell force-pushed the simplify-templates branch from d58694e to 460d196 Compare May 29, 2026 07:52
- "-C board.virtio_net.transport=legacy"
{% endif %}
{% for arg in network_args %}
- '{{ arg }}'

@bhcopeland bhcopeland Jun 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

cool, thank you, fixed now

- 'root@qcom-armv8a:'
{% endif %}
{% for prompt in device.extra_prompts %}
- '{{ prompt }}'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Problem here is if there is a ' this will also break. Corner case also, but probably best to just use {{ prompt | tojson }}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

also fixed

roxell added 4 commits June 4, 2026 10:53
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>
@roxell roxell force-pushed the simplify-templates branch from 460d196 to 6c5e365 Compare June 4, 2026 10:59
@bhcopeland bhcopeland added this pull request to the merge queue Jun 4, 2026
Merged via the queue into kernelci:main with commit 30b5b36 Jun 4, 2026
28 checks passed
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.

3 participants