Mesa (master): ci/bare-metal: Allow wget of the kernel/dtb for kernel development.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 9 17:44:10 UTC 2020


Module: Mesa
Branch: master
Commit: 0f61f0142ac84a3b73eed5b7f414af457f3b3473
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f61f0142ac84a3b73eed5b7f414af457f3b3473

Author: Eric Anholt <eric at anholt.net>
Date:   Fri May  1 09:35:16 2020 -0700

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 at google.com>
Reviewed-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6592>

---

 .gitlab-ci/bare-metal/cros-servo.sh | 29 ++++++++++++++++++++++++++---
 .gitlab-ci/bare-metal/fastboot.sh   | 20 +++++++++++++++++++-
 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 \



More information about the mesa-commit mailing list