summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2020-05-01 09:35:16 -0700
committerMarge Bot <eric+marge@anholt.net>2020-09-09 17:25:38 +0000
commit0f61f0142ac84a3b73eed5b7f414af457f3b3473 (patch)
tree21976238e75897c81b4e9be9bf1d7163b87be272 /.gitlab-ci
parentb4317fccdd7f873dc7e9a4a1ca06b40bbaf4c2dd (diff)
ci/bare-metal: Allow wget of the kernel/dtb for kernel development.
It's useful for kernel dev to be able throw all of our testing infrastructure at a risky kernel change, but it's expensive (time and bandwidth) to roll new containers every time your rev your kernel. Make it so you can just point the env vars to your personal build you've uploaded. Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6592>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/bare-metal/cros-servo.sh29
-rwxr-xr-x.gitlab-ci/bare-metal/fastboot.sh20
2 files changed, 45 insertions, 4 deletions
diff --git a/.gitlab-ci/bare-metal/cros-servo.sh b/.gitlab-ci/bare-metal/cros-servo.sh
index b05eaec50ec..dbfa20456a6 100755
--- a/.gitlab-ci/bare-metal/cros-servo.sh
+++ b/.gitlab-ci/bare-metal/cros-servo.sh
@@ -57,10 +57,33 @@ rsync -a --delete $BM_ROOTFS/ /nfs/
mkdir -p /nfs/results
. $BM/rootfs-setup.sh /nfs
-# Set up the TFTP kernel/cmdline. When we support more than one board with
-# this method, we'll need to do some check on the runner name or something.
+# Put the kernel/dtb image and the boot command line in the tftp directory for
+# the board to find. For normal Mesa development, we build the kernel and
+# store it in the docker container that this script is running in.
+#
+# However, container builds are expensive, so when you're hacking on the
+# kernel, it's nice to be able to skip the half hour container build and plus
+# moving that container to the runner. So, if BM_KERNEL is a URL, fetch it
+# instead of looking in the container. Note that the kernel build should be
+# the output of:
+#
+# make Image.lzma
+#
+# mkimage \
+# -A arm64 \
+# -f auto \
+# -C lzma \
+# -d arch/arm64/boot/Image.lzma \
+# -b arch/arm64/boot/dts/qcom/sdm845-cheza-r3.dtb \
+# cheza-image.img
+
rm -rf /tftp/*
-cp $BM_KERNEL /tftp/vmlinuz
+if echo "$BM_KERNEL" | grep -q http; then
+ apt install -y wget
+ wget $BM_KERNEL -O /tftp/vmlinuz
+else
+ cp $BM_KERNEL /tftp/vmlinuz
+fi
echo "$BM_CMDLINE" > /tftp/cmdline
set +e
diff --git a/.gitlab-ci/bare-metal/fastboot.sh b/.gitlab-ci/bare-metal/fastboot.sh
index 3a6d1f1550b..18fb320ee27 100755
--- a/.gitlab-ci/bare-metal/fastboot.sh
+++ b/.gitlab-ci/bare-metal/fastboot.sh
@@ -72,7 +72,25 @@ find -H | \
xz --check=crc32 -T4 - > $CI_PROJECT_DIR/rootfs.cpio.gz
popd
-cat $BM_KERNEL $BM_DTB > Image.gz-dtb
+# Make the combined kernel image and dtb for passing to fastboot. For normal
+# Mesa development, we build the kernel and store it in the docker container
+# that this script is running in.
+#
+# However, container builds are expensive, so when you're hacking on the
+# kernel, it's nice to be able to skip the half hour container build and plus
+# moving that container to the runner. So, if BM_KERNEL+BM_DTB are URLs,
+# fetch them instead of looking in the container.
+if echo "$BM_KERNEL $BM_DTB" | grep -q http; then
+ apt install -y wget
+
+ wget $BM_KERNEL -O kernel
+ wget $BM_DTB -O dtb
+
+ cat kernel dtb > Image.gz-dtb
+ rm kernel dtb
+else
+ cat $BM_KERNEL $BM_DTB > Image.gz-dtb
+fi
abootimg \
--create artifacts/fastboot.img \