Skip to content

Commit

Permalink
config: runtime: boot: make templates architecture-agnostic
Browse files Browse the repository at this point in the history
Current boot templates are designed for x86-64 targets and hardcode
several arch-specific parameters. Moreover, they don't handle DTBs,
which are widely used on ARM devices.

This patch ensures we picked the right rootfs for the device
architecture and deploy the DTB as well if it's required for the device.

We also rename the kernel artifact to `kernel` which is more generic
(x86-64 use `bzImage` while arm64 needs `Image`).

Signed-off-by: Arnaud Ferraris <[email protected]>
  • Loading branch information
a-wai committed Jan 26, 2024
1 parent 26d5553 commit 95eac21
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
8 changes: 6 additions & 2 deletions config/runtime/boot/depthcharge.jinja2
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
- deploy:
kernel:
url: {{ node.artifacts.bzImage }}
url: {{ node.artifacts.kernel }}
modules:
compression: xz
url: {{ node.artifacts.modules }}
{%- if platform_config.dtb %}
dtb:
url: {{ node.artifacts.dtb }}
{%- endif %}
os: oe
ramdisk:
compression: gz
url: http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230623.0/x86/rootfs.cpio.gz
url: http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230623.0/{{ node.data.arch }}/rootfs.cpio.gz
timeout:
minutes: 10
to: tftp
Expand Down
9 changes: 7 additions & 2 deletions config/runtime/boot/grub.jinja2
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
- deploy:
kernel:
url: {{ node.artifacts.bzImage }}
url: {{ node.artifacts.kernel }}
image_arg: -kernel {kernel} -serial stdio --append "console=ttyS0"
type: zimage
ramdisk:
url: http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230421.0/x86/rootfs.cpio.gz
url: http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230421.0/{{ node.data.arch }}/rootfs.cpio.gz
image_arg: -initrd {ramdisk}
compression: gz
{%- if platform_config.dtb %}
dtb:
url: {{ node.artifacts.dtb }}
image_arg: -dtb {dtb}
{%- endif %}
os: oe
root_partition: 1
to: tftp
Expand Down
11 changes: 8 additions & 3 deletions config/runtime/boot/qemu.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
kernel:
image_arg: -kernel {kernel} -append "console=ttyS0,115200 root=/dev/ram0 debug
verbose console_msg_format=syslog earlycon"
url: {{ node.artifacts.bzImage }}
url: {{ node.artifacts.kernel }}
ramdisk:
image_arg: -initrd {ramdisk}
url: http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230421.0/x86/rootfs.cpio.gz
url: http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230421.0/{{ node.data.arch }}/rootfs.cpio.gz
{%- if platform_config.dtb %}
dtb:
url: {{ node.artifacts.dtb }}
image_arg: -dtb {dtb}
{%- endif %}
os: oe
timeout:
minutes: 3
to: tmpfs

- boot:
docker:
binary: qemu-system-x86_64
binary: qemu-system-{{ node.data.arch }}
image: kernelci/qemu
media: tmpfs
method: qemu
Expand Down

0 comments on commit 95eac21

Please sign in to comment.