From 9ab675b7d9ec92e4cc3e78cacd6cb95233edc2d7 Mon Sep 17 00:00:00 2001 From: Tharun Kumar Merugu Date: Fri, 27 Feb 2026 15:49:01 +0530 Subject: [PATCH] lava: add fastboot_fastrpc template for correct firmware archive merge Introduce templates/boot/fastboot_fastrpc.jinja2 for FastRPC LAVA jobs. FastRPC jobs provide firmware in archives. Combining kernel firmware and fastrpc firmware archives with `cat` does not merge filesystem structures and can break symlink/path resolution during early boot (e.g., /lib -> /usr/lib with firmware delivered in a separate archive). This leads to firmware load failures. The new template performs an extract-into-one-dir + repack workflow to produce a single unified firmware archive while preserving directory layout and symlinks. This is an additive change and does not modify the existing templates/boot/fastboot.jinja2 behavior. Signed-off-by: Tharun Kumar Merugu --- templates/boot/fastboot_fastrpc.jinja2 | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 templates/boot/fastboot_fastrpc.jinja2 diff --git a/templates/boot/fastboot_fastrpc.jinja2 b/templates/boot/fastboot_fastrpc.jinja2 new file mode 100644 index 0000000..48c6993 --- /dev/null +++ b/templates/boot/fastboot_fastrpc.jinja2 @@ -0,0 +1,62 @@ +- deploy: + images: + image: + url: '{{ node.artifacts.kernel }}' + dtb: + url: '{{ node.artifacts.dtb }}' + {% if node.artifacts.firmware %} + ramdisk_firmware: + url: '{{ node.artifacts.firmware }}' + {% endif %} + ramdisk: + url: '{{ node.artifacts.ramdisk }}' + compression: gz + format: cpio.newc + overlays: + lava: true +{% filter indent(width=10) %} +{% block testoverlays %}{% endblock %} +{% endfilter %} +{% set dtb_path = node.artifacts.dtb.split('?')[0] %} +{% set dtb_name = dtb_path.split('/')[-1] %} +{% if node.artifacts.firmware %} +{% set firmware_path = node.artifacts.firmware.split('?')[0] %} +{% set firmware_name = firmware_path.split('/')[-1] %} +{% endif %} +{% set ramdisk_path = node.artifacts.ramdisk.split('?')[0] %} +{% set ramdisk_name = ramdisk_path.split('/')[-1] %} + postprocess: + docker: + image: ghcr.io/mwasilew/docker-mkbootimage:master + steps: + - rm -rf rootfs + - mkdir rootfs + - cd rootfs + - apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -y cpio + - gzip -cd ../initramfs-kerneltest-full-image-qcom-armv8a.cpio.gz | cpio -idm + - gzip -cd ../ramdisk_fastrpc.gz | cpio -idm + - find . | cpio -H newc -o | gzip -9 > ../merged-initramfs.cpio.gz + - cd .. + - mkbootimg --header_version 2 --kernel Image --dtb {{ dtb_name }} --cmdline "console=ttyMSM0,115200n8 earlycon qcom_geni_serial.con_enabled=1 kernel.sched_pelt_multiplier=4 mem_sleep_default=s2idle mitigations=auto video=efifb:off" --ramdisk merged-initramfs.cpio.gz --output boot.img + to: downloads + +- deploy: + images: + boot: + url: 'downloads://boot.img' + timeout: + minutes: 2 + to: download + +- boot: + prompts: + - 'root@[^:]+:~# ' + failure_retry: 3 + timeout: + minutes: 10 + timeouts: + bootloader-commands: + minutes: 3 + auto-login-action: + minutes: 10 + method: fastboot