Skip to content

Commit

Permalink
master.jinja2: drop the device_type block
Browse files Browse the repository at this point in the history
use the device_type variable to define the device type in master.jinja2.
This needs the device files here to be the same as the device type
defined in the lava instances.

Note:
    1. devices/hi6220-hikey is changed to devices/hi6220-hikey-r2
    2. defined lava_device_type for corner cases like the qemu and i386 devices
       they need to set the lava_device_type correctly in their own device files
    3. the DEVICE_TYPE should be changed to use device_type instead,
       but it could be done in a separate change

Signed-off-by: Yongqin Liu <[email protected]>
  • Loading branch information
liuyq committed Apr 12, 2022
1 parent 949bc9b commit 6837bdd
Show file tree
Hide file tree
Showing 27 changed files with 13 additions and 53 deletions.
2 changes: 0 additions & 2 deletions devices/bcm2711-rpi-4-b
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
arch: arm64
{% endblock context %}

{% block device_type %}bcm2711-rpi-4-b{% endblock %}

{% block boot_target %}
{{ super() }}
{% endblock boot_target %}
Expand Down
2 changes: 0 additions & 2 deletions devices/dragonboard-410c
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@
{% set ROOTFS_URL_COMP = ROOTFS_URL_COMP|default("gz") %}

{% set rootfs_label = 'rootfs' %}

{% block device_type %}dragonboard-410c{% endblock %}
2 changes: 0 additions & 2 deletions devices/dragonboard-820c
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@
{% set ROOTFS_URL_COMP = ROOTFS_URL_COMP|default("gz") %}

{% set rootfs_label = 'rootfs' %}

{% block device_type %}dragonboard-820c{% endblock %}
2 changes: 0 additions & 2 deletions devices/dragonboard-845c
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@
{% set ptable = true %}
{% set rootfs_label = 'rootfs' %}
{% set reboot_reset = true %}

{% block device_type %}dragonboard-845c{% endblock %}
2 changes: 0 additions & 2 deletions devices/hi6220-hikey → devices/hi6220-hikey-r2
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
{% set rootfs = true %}
{% set rootfs_label = rootfs_label|default("system") %}

{% block device_type %}hi6220-hikey-r2{% endblock %}

{% block auto_login_commands %}
login_commands:
# Become super user to run tests
Expand Down
2 changes: 0 additions & 2 deletions devices/hi960-hikey
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
{% set rootfs = true %}
{% set rootfs_label = 'system' %}

{% block device_type %}hi960-hikey{% endblock %}

{% block boot_commands %}
commands: installed
{% endblock boot_commands %}
2 changes: 0 additions & 2 deletions devices/juno
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
{% block context %}
{% endblock context %}

{% block device_type %}juno{% endblock %}

{% block boot_target %}
{{ super() }}
{% endblock boot_target %}
Expand Down
2 changes: 0 additions & 2 deletions devices/juno-r2
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
bootloader_prompt: juno#
{% endblock context %}

{% block device_type %}juno-r2{% endblock %}

{% block boot_target %}
{{ super() }}
{% endblock boot_target %}
Expand Down
2 changes: 0 additions & 2 deletions devices/nxp-ls2088
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
arch: arm64
{% endblock context %}

{% block device_type %}nxp-ls2088{% endblock %}

{% block boot_target %}
{{ super() }}
{% endblock boot_target %}
Expand Down
2 changes: 0 additions & 2 deletions devices/qcs404-evb-1k
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
{% set pre_power_command = false %}
{% set pre_os_command = false %}
{% set rootfs_label = 'userdata' %}

{% block device_type %}qcs404-evb-1k{% endblock %}
2 changes: 0 additions & 2 deletions devices/qcs404-evb-4k
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
{% set pre_power_command = false %}
{% set pre_os_command = false %}
{% set rootfs_label = 'userdata' %}

{% block device_type %}qcs404-evb-4k{% endblock %}
4 changes: 2 additions & 2 deletions devices/qemu_arm64
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
{% set GS_MACHINE = GS_MACHINE|default("virt,accel=kvm") %}
{% set QEMU_CPU_VARIABLES = QEMU_CPU_VARIABLES|default("host") %}

{% set lava_device_type = lava_device_type|default("qemu-arm") %}

{% block global_settings %}
{{ super() }}
arch: arm64
Expand All @@ -18,8 +20,6 @@
guestfs_size: {{ guestfs_size|default(512) }}
{% endblock global_settings %}

{% block device_type %}qemu-arm{% endblock %}

{% block rootfs_extra_args %}
{{ super() }}
sparse: false
Expand Down
4 changes: 2 additions & 2 deletions devices/qemu_i386
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
{# libhugetlbfs_word_size variable is required for libhugetlbfs.yaml test template #}
{% set libhuggetlbfs_word_size = 32 %}

{% set lava_device_type = lava_device_type|default("qemu") %}

{% block global_settings %}
{{ super() }}
arch: i386
guestfs_size: {{ guestfs_size|default(512) }}
{% endblock global_settings %}

{% block device_type %}qemu{% endblock %}

{% block boot_extra_args %}
image_arg: -kernel {kernel} --append "root=/dev/sda rootwait console=ttyS0,115200"
{% endblock boot_extra_args %}
4 changes: 2 additions & 2 deletions devices/qemu_x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
{% set DEPLOY_OS = DEPLOY_OS|default("oe") %}
{% set ROOTFS_URL_COMP = ROOTFS_URL_COMP|default("gz") %}

{% set lava_device_type = lava_device_type|default("qemu") %}

{% block global_settings %}
{{ super() }}
arch: amd64
guestfs_size: {{ guestfs_size|default(512) }}
{% endblock global_settings %}

{% block device_type %}qemu{% endblock %}

{% block boot_extra_args %}
image_arg: -kernel {kernel} --append "root=/dev/sda rootwait console=ttyS0,115200"
{% endblock boot_extra_args %}
2 changes: 0 additions & 2 deletions devices/rzn1d
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
{% set TARGET_BOOT_TIMEOUT = 10 %}
{% set target_deploy_timeout = 5 %}

{% block device_type %}rzn1d{% endblock %}

{% block kernel_extra_args %}
type: uimage
{% endblock kernel_extra_args %}
Expand Down
2 changes: 0 additions & 2 deletions devices/sdm845-mtp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
{% set pre_power_command = false %}
{% set pre_os_command = false %}
{% set rootfs_label = 'userdata' %}

{% block device_type %}sdm845-mtp{% endblock %}
2 changes: 0 additions & 2 deletions devices/sm8150-mtp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
{% set pre_power_command = false %}
{% set pre_os_command = false %}
{% set rootfs_label = 'userdata' %}

{% block device_type %}sm8150-mtp{% endblock %}
2 changes: 0 additions & 2 deletions devices/sm8250-mtp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
{% set pre_power_command = false %}
{% set pre_os_command = false %}
{% set rootfs_label = 'userdata' %}

{% block device_type %}sm8250-mtp{% endblock %}
2 changes: 0 additions & 2 deletions devices/sm8350-mtp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
{% set pre_power_command = false %}
{% set pre_os_command = false %}
{% set rootfs_label = 'userdata' %}

{% block device_type %}sm8350-mtp{% endblock %}
2 changes: 0 additions & 2 deletions devices/soca9
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
{% set run_tftp_commands = true %}
{% set target_deploy_timeout = 5 %}

{% block device_type %}soca9{% endblock %}

{% block deploy_target %}
- deploy:
timeout:
Expand Down
2 changes: 0 additions & 2 deletions devices/stm32mp157c-dk2
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@
{% set rootfs = rootfs|default(false) %}
{% set boot_method = boot_method|default("minimal") %}
{% set auto_login = auto_login|default(false) %}

{% block device_type %}stm32mp157c-dk2{% endblock %}
2 changes: 0 additions & 2 deletions devices/synquacer
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
test_character_delay: 10
{% endblock context %}

{% block device_type %}synquacer{% endblock %}

{% block boot_commands %}
commands: nfs
parameters:
Expand Down
2 changes: 0 additions & 2 deletions devices/thunderx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
test_character_delay: 10
{% endblock context %}

{% block device_type %}thunderx{% endblock %}

{% block boot_commands %}
commands: nfs
parameters:
Expand Down
2 changes: 0 additions & 2 deletions devices/x15
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
{% set reboot_to_fastboot = reboot_to_fastboot|default("true") %}
{% set rootfs_label = "super" %}

{% block device_type %}x15{% endblock %}

{% block boot_commands %}
commands:
- setenv fdtfile am57xx-beagle-x15.dtb
Expand Down
2 changes: 0 additions & 2 deletions devices/x15-bl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
{% set pre_os_command = false %}
{% set rootfs_label = "userdata" %}

{% block device_type %}x15-bl{% endblock %}

{% block boot_commands %}
{% if boot_method == "u-boot" %}
commands: {{ BOOT_COMMANDS|default("ramdisk") }}
Expand Down
6 changes: 4 additions & 2 deletions devices/x86
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
{% set rootfs_label="nfsrootfs" %}
{% set use_context = true %}

{% if DEVICE_TYPE == 'i386' %}
{% set lava_device_type = lava_device_type|default("x86") %}
{% endif %}

{% block context %}
test_character_delay: 10
{% endblock context %}

{% block device_type %}x86{% endblock %}

{% block boot_commands %}
commands: nfs
parameters:
Expand Down
4 changes: 3 additions & 1 deletion master.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

{% set enable_tests = enable_tests|default(true) %}

{% set lava_device_type = lava_device_type|default(device_type) %}

{% block global_settings %}
timeouts:
job:
Expand All @@ -42,7 +44,7 @@ context:


{% set LAVA_JOB_VISIBILITY = LAVA_JOB_VISIBILITY|default("public") %}
device_type: {% block device_type %}{% endblock %}
device_type: {{ lava_device_type }}
job_name: {% block job_name %}{% endblock %}
priority: {% block priority %}{{LAVA_JOB_PRIORITY}}{% endblock priority %}
visibility: {% block visibility %}{{LAVA_JOB_VISIBILITY}}{% endblock visibility %}
Expand Down

0 comments on commit 6837bdd

Please sign in to comment.