diff options
author | Juan A. Suarez Romero <jasuarez@igalia.com> | 2021-03-11 17:42:06 +0100 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-03-12 11:03:17 +0000 |
commit | 3f1c375581faccd9e356e344432b7d6c6e27902c (patch) | |
tree | 52dcbba3e400a22ccb6acc8fe13596beb179de32 /.gitlab-ci | |
parent | 1a2f1e3f472b1abe83e7e872839bd9ed370fd268 (diff) |
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 <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9527>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x | .gitlab-ci/bare-metal/poe-powered.sh | 33 |
1 files changed, 30 insertions, 3 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 |