Add custom software to rootfs

This commit is contained in:
Joris van Rantwijk 2024-09-22 11:34:19 +02:00
parent a589a0099a
commit 0853648920
5 changed files with 23 additions and 9 deletions

1
sw/.gitignore vendored
View File

@ -1,4 +1,5 @@
devicetree/devicetree.dtb
buildroot_overlay/opt/
downloads/
buildroot-2023.02.8/
u-boot/

View File

@ -7,6 +7,7 @@ set -e
make -C "$BUILDROOT_DIR" clean
cp -a config/buildroot_puzzlefw_defconfig "$BUILDROOT_DIR/.config"
make -C "$BUILDROOT_DIR" olddefconfig
make -C "$BUILDROOT_DIR"

View File

@ -11,7 +11,7 @@ make -C "$UBOOT_DIR" CROSS_COMPILE=arm-linux- distclean
# It contains the init code for the U-Boot SPL image.
if [ ! -f "$XSA_FILE" ]; then
echo "ERROR: $XSA_FILE not found" >&2
echo "Build the FPGA image before building U-Boot."
echo " Build the FPGA image before building U-Boot." >&2
exit 1
fi

View File

@ -5,17 +5,10 @@ set -e
. script_env
setup_toolchain
#if [ ! -x "$TOOLCHAIN_DIR/arm-linux-gcc" ]; then
# echo "ERROR: Missing $TOOLCHAIN_DIR/arm-linux-gcc" >&2
# echo " Build buildroot to prepare the arm-linux toolchain" >&2
# exit 1
#fi
#
#export PATH="$TOOLCHAIN_DIR:$PATH"
make -C "$LINUX_DIR" ARCH=arm mrproper
cp -a config/linux_redpitaya_puzzlefw_defconfig "$LINUX_DIR/.config"
make -C "$LINUX_DIR" ARCH=arm CROSS_COMPILE=arm-linux- olddefconfig
make -C "$LINUX_DIR" ARCH=arm CROSS_COMPILE=arm-linux- zImage
make -C "$LINUX_DIR" ARCH=arm CROSS_COMPILE=arm-linux- modules

19
sw/21_rebuild_rootfs.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
. script_env
setup_toolchain
TARGET=buildroot_overlay
# Add kernel driver to rootfs image.
mkdir -p "$TARGET/opt/puzzlefw/driver"
cp -a src/linux_driver/puzzlefw.ko "$TARGET/opt/puzzlefw/driver"
# Add userspace software to rootfs image.
mkdir -p "$TARGET/opt/puzzlefw/bin"
cp -a src/userspace/puzzlecmd "$TARGET/opt/puzzlefw/bin"
make -C "$BUILDROOT_DIR"