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
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 \