From 6837bdda267c1b6f87b83408a8d38aabe1d33859 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Thu, 7 Apr 2022 21:30:30 +0800 Subject: [PATCH] master.jinja2: drop the device_type block 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 --- devices/bcm2711-rpi-4-b | 2 -- devices/dragonboard-410c | 2 -- devices/dragonboard-820c | 2 -- devices/dragonboard-845c | 2 -- devices/{hi6220-hikey => hi6220-hikey-r2} | 2 -- devices/hi960-hikey | 2 -- devices/juno | 2 -- devices/juno-r2 | 2 -- devices/nxp-ls2088 | 2 -- devices/qcs404-evb-1k | 2 -- devices/qcs404-evb-4k | 2 -- devices/qemu_arm64 | 4 ++-- devices/qemu_i386 | 4 ++-- devices/qemu_x86_64 | 4 ++-- devices/rzn1d | 2 -- devices/sdm845-mtp | 2 -- devices/sm8150-mtp | 2 -- devices/sm8250-mtp | 2 -- devices/sm8350-mtp | 2 -- devices/soca9 | 2 -- devices/stm32mp157c-dk2 | 2 -- devices/synquacer | 2 -- devices/thunderx | 2 -- devices/x15 | 2 -- devices/x15-bl | 2 -- devices/x86 | 6 ++++-- master.jinja2 | 4 +++- 27 files changed, 13 insertions(+), 53 deletions(-) rename devices/{hi6220-hikey => hi6220-hikey-r2} (97%) diff --git a/devices/bcm2711-rpi-4-b b/devices/bcm2711-rpi-4-b index 616cf2ce..5c0c1f05 100644 --- a/devices/bcm2711-rpi-4-b +++ b/devices/bcm2711-rpi-4-b @@ -13,8 +13,6 @@ arch: arm64 {% endblock context %} -{% block device_type %}bcm2711-rpi-4-b{% endblock %} - {% block boot_target %} {{ super() }} {% endblock boot_target %} diff --git a/devices/dragonboard-410c b/devices/dragonboard-410c index acc98c8b..98439b00 100644 --- a/devices/dragonboard-410c +++ b/devices/dragonboard-410c @@ -6,5 +6,3 @@ {% set ROOTFS_URL_COMP = ROOTFS_URL_COMP|default("gz") %} {% set rootfs_label = 'rootfs' %} - -{% block device_type %}dragonboard-410c{% endblock %} diff --git a/devices/dragonboard-820c b/devices/dragonboard-820c index 51ad6026..a6c28dca 100644 --- a/devices/dragonboard-820c +++ b/devices/dragonboard-820c @@ -6,5 +6,3 @@ {% set ROOTFS_URL_COMP = ROOTFS_URL_COMP|default("gz") %} {% set rootfs_label = 'rootfs' %} - -{% block device_type %}dragonboard-820c{% endblock %} diff --git a/devices/dragonboard-845c b/devices/dragonboard-845c index 27a204a8..97310285 100644 --- a/devices/dragonboard-845c +++ b/devices/dragonboard-845c @@ -9,5 +9,3 @@ {% set ptable = true %} {% set rootfs_label = 'rootfs' %} {% set reboot_reset = true %} - -{% block device_type %}dragonboard-845c{% endblock %} diff --git a/devices/hi6220-hikey b/devices/hi6220-hikey-r2 similarity index 97% rename from devices/hi6220-hikey rename to devices/hi6220-hikey-r2 index 7b344e61..d90a9161 100644 --- a/devices/hi6220-hikey +++ b/devices/hi6220-hikey-r2 @@ -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 diff --git a/devices/hi960-hikey b/devices/hi960-hikey index 67044cfc..a00072f4 100644 --- a/devices/hi960-hikey +++ b/devices/hi960-hikey @@ -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 %} diff --git a/devices/juno b/devices/juno index 6a882fd3..881a5993 100644 --- a/devices/juno +++ b/devices/juno @@ -11,8 +11,6 @@ {% block context %} {% endblock context %} -{% block device_type %}juno{% endblock %} - {% block boot_target %} {{ super() }} {% endblock boot_target %} diff --git a/devices/juno-r2 b/devices/juno-r2 index 4b07fe62..4ec81a8d 100644 --- a/devices/juno-r2 +++ b/devices/juno-r2 @@ -13,8 +13,6 @@ bootloader_prompt: juno# {% endblock context %} -{% block device_type %}juno-r2{% endblock %} - {% block boot_target %} {{ super() }} {% endblock boot_target %} diff --git a/devices/nxp-ls2088 b/devices/nxp-ls2088 index 6e32a9c8..8112c106 100644 --- a/devices/nxp-ls2088 +++ b/devices/nxp-ls2088 @@ -13,8 +13,6 @@ arch: arm64 {% endblock context %} -{% block device_type %}nxp-ls2088{% endblock %} - {% block boot_target %} {{ super() }} {% endblock boot_target %} diff --git a/devices/qcs404-evb-1k b/devices/qcs404-evb-1k index 1ff01650..2f29ab71 100644 --- a/devices/qcs404-evb-1k +++ b/devices/qcs404-evb-1k @@ -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 %} diff --git a/devices/qcs404-evb-4k b/devices/qcs404-evb-4k index 9db7d44a..2f29ab71 100644 --- a/devices/qcs404-evb-4k +++ b/devices/qcs404-evb-4k @@ -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 %} diff --git a/devices/qemu_arm64 b/devices/qemu_arm64 index 2712af61..3a3028b8 100644 --- a/devices/qemu_arm64 +++ b/devices/qemu_arm64 @@ -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 @@ -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 diff --git a/devices/qemu_i386 b/devices/qemu_i386 index d570327c..4f2f9f71 100644 --- a/devices/qemu_i386 +++ b/devices/qemu_i386 @@ -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 %} diff --git a/devices/qemu_x86_64 b/devices/qemu_x86_64 index 916cb53e..4d5b901e 100644 --- a/devices/qemu_x86_64 +++ b/devices/qemu_x86_64 @@ -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 %} diff --git a/devices/rzn1d b/devices/rzn1d index 7c4b1e3f..ce8bf277 100644 --- a/devices/rzn1d +++ b/devices/rzn1d @@ -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 %} diff --git a/devices/sdm845-mtp b/devices/sdm845-mtp index d5bbcdbe..2f29ab71 100644 --- a/devices/sdm845-mtp +++ b/devices/sdm845-mtp @@ -8,5 +8,3 @@ {% set pre_power_command = false %} {% set pre_os_command = false %} {% set rootfs_label = 'userdata' %} - -{% block device_type %}sdm845-mtp{% endblock %} diff --git a/devices/sm8150-mtp b/devices/sm8150-mtp index 700ac804..2f29ab71 100644 --- a/devices/sm8150-mtp +++ b/devices/sm8150-mtp @@ -8,5 +8,3 @@ {% set pre_power_command = false %} {% set pre_os_command = false %} {% set rootfs_label = 'userdata' %} - -{% block device_type %}sm8150-mtp{% endblock %} diff --git a/devices/sm8250-mtp b/devices/sm8250-mtp index 63727a22..2f29ab71 100644 --- a/devices/sm8250-mtp +++ b/devices/sm8250-mtp @@ -8,5 +8,3 @@ {% set pre_power_command = false %} {% set pre_os_command = false %} {% set rootfs_label = 'userdata' %} - -{% block device_type %}sm8250-mtp{% endblock %} diff --git a/devices/sm8350-mtp b/devices/sm8350-mtp index bc2c5601..2f29ab71 100644 --- a/devices/sm8350-mtp +++ b/devices/sm8350-mtp @@ -8,5 +8,3 @@ {% set pre_power_command = false %} {% set pre_os_command = false %} {% set rootfs_label = 'userdata' %} - -{% block device_type %}sm8350-mtp{% endblock %} diff --git a/devices/soca9 b/devices/soca9 index 08f14f78..e6507d89 100644 --- a/devices/soca9 +++ b/devices/soca9 @@ -12,8 +12,6 @@ {% set run_tftp_commands = true %} {% set target_deploy_timeout = 5 %} -{% block device_type %}soca9{% endblock %} - {% block deploy_target %} - deploy: timeout: diff --git a/devices/stm32mp157c-dk2 b/devices/stm32mp157c-dk2 index 6408b3ae..051deea4 100644 --- a/devices/stm32mp157c-dk2 +++ b/devices/stm32mp157c-dk2 @@ -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 %} diff --git a/devices/synquacer b/devices/synquacer index 820caf85..dab498cc 100644 --- a/devices/synquacer +++ b/devices/synquacer @@ -10,8 +10,6 @@ test_character_delay: 10 {% endblock context %} -{% block device_type %}synquacer{% endblock %} - {% block boot_commands %} commands: nfs parameters: diff --git a/devices/thunderx b/devices/thunderx index 1dc899b3..cae2e566 100644 --- a/devices/thunderx +++ b/devices/thunderx @@ -16,8 +16,6 @@ test_character_delay: 10 {% endblock context %} -{% block device_type %}thunderx{% endblock %} - {% block boot_commands %} commands: nfs parameters: diff --git a/devices/x15 b/devices/x15 index b9b6cfe8..b53b49db 100644 --- a/devices/x15 +++ b/devices/x15 @@ -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 diff --git a/devices/x15-bl b/devices/x15-bl index ddae8995..ecda9cb6 100644 --- a/devices/x15-bl +++ b/devices/x15-bl @@ -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") }} diff --git a/devices/x86 b/devices/x86 index e648ec82..ec185488 100644 --- a/devices/x86 +++ b/devices/x86 @@ -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: diff --git a/master.jinja2 b/master.jinja2 index 329b90ee..64287f1d 100644 --- a/master.jinja2 +++ b/master.jinja2 @@ -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: @@ -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 %}