From 3f1c375581faccd9e356e344432b7d6c6e27902c Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Thu, 11 Mar 2021 17:42:06 +0100 Subject: [PATCH] ci/broadcom: allow custom kernels So far, testing VC4 and V3D/V3DV requires the CI runners having access to a Raspberry Pi 3/4 kernel, and the correspondent modules and bootloader files. If a different kernel must be used, it means touching the runners to provide them. This commit adds the option to define an URL pointing to a (compressed) tarball containing such files, without requiring dealing with the runners. This link is provided through the `BM_BOOTFS` job variable. The tarball must contain two directories in the root: a `/boot` directory (containing the kernel, DTBs and bootloader files), and a `/lib/modules` (or `/usr/lib/modules`) with the kernel modules. Reviewed-by: Eric Anholt Signed-off-by: Juan A. Suarez Romero Part-of: --- .gitlab-ci/bare-metal/poe-powered.sh | 33 +++++++++++++++++++++++++--- src/broadcom/ci/gitlab-ci.yml | 9 +++----- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci/bare-metal/poe-powered.sh b/.gitlab-ci/bare-metal/poe-powered.sh index de413b22bb8..1872ab132de 100755 --- a/.gitlab-ci/bare-metal/poe-powered.sh +++ b/.gitlab-ci/bare-metal/poe-powered.sh @@ -75,6 +75,11 @@ if [ -z "$BM_CMDLINE" ]; then exit 1 fi +if [ -z "$BM_BOOTCONFIG" ]; then + echo "Must set BM_BOOTCONFIG to your board's required boot configuration arguments" + exit 1 +fi + set -ex # Clear out any previous run's artifacts. @@ -85,15 +90,37 @@ mkdir -p results # state, since it's volume-mounted on the host. rsync -a --delete $BM_ROOTFS/ /nfs/ -[ -z $BM_ROOTFS_EXTRA ] || rsync -a $BM_ROOTFS_EXTRA/ /nfs/ +# If BM_BOOTFS is an URL, download it +if echo $BM_BOOTFS | grep -q http; then + apt install -y wget + wget ${FDO_HTTP_CACHE_URI:-}$BM_BOOTFS -O /tmp/bootfs.tar + BM_BOOTFS=/tmp/bootfs.tar +fi +# If BM_BOOTFS is a file, assume it is a tarball and uncompress it +if [ -f $BM_BOOTFS ]; then + mkdir -p /tmp/bootfs + tar xf $BM_BOOTFS -C /tmp/bootfs + BM_BOOTFS=/tmp/bootfs +fi + +# Install kernel modules (it could be either in /lib/modules or +# /usr/lib/modules, but we want to install in the latter) +[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a --delete $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/ +[ -d $BM_BOOTFS/lib/modules ] && rsync -a --delete $BM_BOOTFS/lib/modules/ /nfs/usr/lib/modules/ + +# Install kernel image + bootloader files +rsync -a --delete $BM_BOOTFS/boot/ /tftp/ + +# Create the rootfs in the NFS directory mkdir -p /nfs/results . $BM/rootfs-setup.sh /nfs -rsync -a --delete $BM_BOOTFS/ /tftp/ - echo "$BM_CMDLINE" > /tftp/cmdline.txt +# Add some required options in config.txt +printf "$BM_BOOTCONFIG" >> /tftp/config.txt + set +e ATTEMPTS=2 while [ $((ATTEMPTS--)) -gt 0 ]; do diff --git a/src/broadcom/ci/gitlab-ci.yml b/src/broadcom/ci/gitlab-ci.yml index a7de850568c..3cb0098070e 100644 --- a/src/broadcom/ci/gitlab-ci.yml +++ b/src/broadcom/ci/gitlab-ci.yml @@ -4,10 +4,9 @@ - .vc4-rules - .use-armhf_test variables: - BM_BOOTFS: /boot/armhf + BM_BOOTFS: /boot/raspberrypi_armhf BM_KERNEL_MODULES: vc4 BM_ROOTFS: /lava-files/rootfs-armhf - BM_ROOTFS_EXTRA: /modules/armhf GPU_VERSION: vc4-rpi3 DEQP_EXPECTED_RENDERER: VC4 script: @@ -111,11 +110,10 @@ vc4-rpi3-piglit-quick_shader:armhf: - .use-armhf_test variables: BARE_METAL_TEST_SCRIPT: "/install/deqp-runner.sh" - BM_BOOTFS: /boot/armhf + BM_BOOTFS: /boot/raspberrypi_armhf BM_KERNEL_MODULES: v3d,vc4 BM_POE_TIMEOUT: 300 BM_ROOTFS: /lava-files/rootfs-armhf - BM_ROOTFS_EXTRA: /modules/armhf DEQP_EXPECTED_RENDERER: V3D GPU_VERSION: v3d-rpi4 script: @@ -211,11 +209,10 @@ v3dv-rpi4-vk:armhf: parallel: 6 variables: BARE_METAL_TEST_SCRIPT: "/install/deqp-runner.sh" - BM_BOOTFS: /boot/armhf + BM_BOOTFS: /boot/raspberrypi_armhf BM_KERNEL_MODULES: v3d,vc4 BM_POE_TIMEOUT: 300 BM_ROOTFS: /lava-files/rootfs-armhf - BM_ROOTFS_EXTRA: /modules/armhf CPU: arm7hlf DEQP_EXPECTED_RENDERER: "V3D 4.2" DEQP_FRACTION: 7