From 14e1e458f99111515336b86ff1412249c6a62075 Mon Sep 17 00:00:00 2001 From: Yogesh Lal Date: Tue, 31 Mar 2026 09:43:06 +0530 Subject: [PATCH 1/3] runtime/boot: add EFI runtime boot template Add EFI boot template support for Qualcomm EFI-based platform. Signed-off-by: Yogesh Lal --- config/runtime/boot/efi.jinja2 | 87 ++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 config/runtime/boot/efi.jinja2 diff --git a/config/runtime/boot/efi.jinja2 b/config/runtime/boot/efi.jinja2 new file mode 100644 index 0000000000..04eb056760 --- /dev/null +++ b/config/runtime/boot/efi.jinja2 @@ -0,0 +1,87 @@ +{%- 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: + 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 From df2a7921e42eff42f07c7d5ca90f3039ce812026 Mon Sep 17 00:00:00 2001 From: Yogesh Lal Date: Tue, 31 Mar 2026 09:43:16 +0530 Subject: [PATCH 2/3] config: platform: add flash_image to Platform model Add an optional flash_image attribute to the Platform config object so platform definitions can carry a flashable image path. This enables flash-based boot/deployment flows to consume platform-specific flash image information directly from config. Signed-off-by: Yogesh Lal --- kernelci/config/platform.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernelci/config/platform.py b/kernelci/config/platform.py index 96efdf35d3..93da2a0626 100644 --- a/kernelci/config/platform.py +++ b/kernelci/config/platform.py @@ -23,6 +23,7 @@ def __init__( context=None, compatible=None, dtb=None, + flash_image=None, mach="x86", params=None, rules=None, @@ -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 @@ -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""" @@ -106,6 +113,7 @@ def _get_yaml_attributes(cls): "context", "compatible", "dtb", + "flash_image", "mach", "params", "rules", From c65ff2bd74835bb834127116b37b659b312d1a75 Mon Sep 17 00:00:00 2001 From: Yogesh Lal Date: Tue, 31 Mar 2026 10:25:24 +0530 Subject: [PATCH 3/3] boot: efi: support HTTP headers for flash image download Add optional flash_image_headers handling in efi boot flow. When provided template emits a headers with each key/value pair rendered from it which allows EFI flash image downloads from HTTP(S) endpoints that require custom headers (for example, auth tokens or API keys). Signed-off-by: Yogesh Lal --- config/runtime/boot/efi.jinja2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/runtime/boot/efi.jinja2 b/config/runtime/boot/efi.jinja2 index 04eb056760..c89b8f2eb8 100644 --- a/config/runtime/boot/efi.jinja2 +++ b/config/runtime/boot/efi.jinja2 @@ -6,6 +6,12 @@ - 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 }}'