Use the new 64 bit root filesystem for the pi's
This also pulls in our RT kernel, and the script to build it.
We still need to package up and build the kernel module for the
adis16505, and enable the overlay. Not a huge deal.
Change-Id: I1a100d8ec3ce4406af27af6b555fd08840fb71fd
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/raspi/rootfs/build_kernel.sh b/frc971/raspi/rootfs/build_kernel.sh
new file mode 100755
index 0000000..cd97902
--- /dev/null
+++ b/frc971/raspi/rootfs/build_kernel.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+# This script builds the kernel for the raspberry pi.
+#
+# git@github.com:frc971/linux.git
+#
+# We are using the frc971-5.10-pi4-rt branch
+#
+# Point it at the version of that repo you want to build, and it'll generate a
+# .tar.gz of the bits to install.
+
+
+set -ex
+
+echo $#
+if [[ $# -lt 2 ]];
+then
+ echo "Pass in the kernel directory and then the destination .tar.gz"
+ exit 1
+fi
+
+export OUTPUT="$(realpath $(dirname $2))/$(basename ${2})"
+export TMPDIR="${OUTPUT}_tmpdir"
+
+mkdir -p "${TMPDIR}"
+mkdir -p "${TMPDIR}/fat32/overlays"
+mkdir -p "${TMPDIR}/ext4"
+
+pushd "${1}"
+
+export KERNEL=kernel8
+
+make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j 60
+
+cp arch/arm64/boot/Image "${TMPDIR}/fat32/$KERNEL.img"
+cp arch/arm64/boot/dts/broadcom/*.dtb "${TMPDIR}/fat32/"
+cp arch/arm64/boot/dts/overlays/*.dtb* "${TMPDIR}/fat32/overlays/"
+cp arch/arm64/boot/dts/overlays/README "${TMPDIR}/fat32/overlays/"
+
+make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH="${TMPDIR}/ext4" modules_install
+
+cd "${TMPDIR}"
+tar cvzf "${OUTPUT}" --owner=0 --group=0 "./"
+
+popd
+
+rm -rf "${TMPDIR}"
+
+echo "Kernel is now available at: ${OUTPUT}"