Skip to content
Open
Show file tree
Hide file tree
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
93 changes: 93 additions & 0 deletions config/runtime/boot/efi.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{%- set flash_image_url = flash_image_url | default(platform_config.flash_image, true) -%}
{%- if flash_image_name is not defined and flash_image_url -%}
{%- set flash_image_name = flash_image_url.split('/')[-1] -%}
{%- endif -%}

- deploy:
images:
image:
{% if flash_image_headers %}
headers:
{% for key, value in flash_image_headers.items() %}
{{ key }}: '{{ value }}'
{% endfor %}
{% endif %}
url: '{{ flash_image_url }}'
dtb:
url: '{{ node.artifacts.dtb }}'
kernel:
url: '{{ node.artifacts.kernel }}'
ramdisk:
{% if boot_commands == "ramdisk" %}
url: '{{ ramdiskroot }}/rootfs.cpio.gz'
{% else %}
url: 'https://storage.kernelci.org/images/rootfs/debian/bookworm-kselftest/20250724.0/{{ brarch }}/initrd.cpio.gz'
{% endif %}
compression: gz
format: cpio.newc
overlays:
lava: true
modules:
url: '{{ node.artifacts.modules }}'
compression: xz
format: tar
path: /
{% if boot_commands == "ramdisk" %}
kselftest:
compression: xz
format: tar
path: /opt/kselftests/mainline/
url: {{ node.artifacts.kselftest_tar_xz }}
{% endif %}
{% set dtb = device_dtb.split('/')[-1] %}
{% if boot_commands == "ramdisk" %}
{% set ramdisk_name = "rootfs.cpio.gz" %}
{% else %}
{% set ramdisk_name = "initrd.cpio.gz" %}
{% endif %}
postprocess:
docker:
image: artifacts.codelinaro.org/clo-420-qli-registry/kmake-image-ci:ver.1.0
steps:
{%- if node.data.kernel_type.endswith('.gz') %}
- gunzip Image.gz
{%- endif %}
- generate_boot_bins.sh efi --ramdisk {{ ramdisk_name }} --systemd-boot /artifacts/systemd/usr/lib/systemd/boot/efi/systemd-bootaa64.efi --stub /artifacts/systemd/usr/lib/systemd/boot/efi/linuxaa64.efi.stub --linux Image --cmdline "console=ttyMSM0,115200n8 copy-modules rootdelay=10 root=PARTLABEL=rootfs rw rootwait qcom_geni_serial.con_enabled=1" --output images
- generate_boot_bins.sh dtb --input {{ dtb }} --output images
- export IMAGE_PATH=$PWD
- cp overlay*.tar.gz overlay.tar.gz
- echo "OVERLAY=overlay.tar.gz" >> $IMAGE_PATH/flash.settings
- echo "OVERLAY_PATH=/" >> $IMAGE_PATH/flash.settings
- echo "ROOTFS_IMAGE=rootfs.img" >> $IMAGE_PATH/flash.settings
- echo "EFI=images/efi.bin" >> $IMAGE_PATH/flash.settings
- echo "DTB=images/dtb.bin" >> $IMAGE_PATH/flash.settings
- echo "DEVICE_TYPE={{ platform_config.name }}" >> $IMAGE_PATH/flash.settings
- echo "PORT={{ flash_port | default('0', true) }}" >> $IMAGE_PATH/flash.settings
- cat $IMAGE_PATH/flash.settings
timeout:
minutes: 30
to: downloads

- deploy:
to: flasher
images:
image:
url: 'downloads://{{ flash_image_name }}'
settings:
url: 'downloads://flash.settings'
overlay:
url: 'downloads://overlay.tar.gz'
timeout:
minutes: 15
- boot:
prompts:
- '/ #'
failure_retry: 3
timeout:
minutes: 10
timeouts:
bootloader-commands:
minutes: 5
auto-login-action:
minutes: 5
method: minimal
8 changes: 8 additions & 0 deletions kernelci/config/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(
context=None,
compatible=None,
dtb=None,
flash_image=None,
mach="x86",
params=None,
rules=None,
Expand All @@ -39,6 +40,7 @@ def __init__(
self._dtb = dtb
else:
self._dtb = [dtb]
self._flash_image = flash_image
self._mach = mach
self._params = (
self.format_params(params.copy(), params) if params else None
Expand Down Expand Up @@ -80,6 +82,11 @@ def dtb(self):
"""Platform dtb file name"""
return self._dtb

@property
def flash_image(self):
"""Platform flash image path"""
return self._flash_image

@property
def mach(self):
"""Platform sub-architecture"""
Expand All @@ -106,6 +113,7 @@ def _get_yaml_attributes(cls):
"context",
"compatible",
"dtb",
"flash_image",
"mach",
"params",
"rules",
Expand Down
Loading