diff --git a/sw/.gitignore b/sw/.gitignore index 09784aa..6f30340 100644 --- a/sw/.gitignore +++ b/sw/.gitignore @@ -1,4 +1,5 @@ devicetree/devicetree.dtb +buildroot_overlay/opt/ downloads/ buildroot-2023.02.8/ u-boot/ diff --git a/sw/11_build_buildroot.sh b/sw/11_build_buildroot.sh index 97604c8..5272a9b 100755 --- a/sw/11_build_buildroot.sh +++ b/sw/11_build_buildroot.sh @@ -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" diff --git a/sw/12_build_uboot.sh b/sw/12_build_uboot.sh index 80cdc81..ee5653d 100755 --- a/sw/12_build_uboot.sh +++ b/sw/12_build_uboot.sh @@ -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 diff --git a/sw/13_build_kernel.sh b/sw/13_build_kernel.sh index 86673a8..f9f1f44 100755 --- a/sw/13_build_kernel.sh +++ b/sw/13_build_kernel.sh @@ -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 diff --git a/sw/21_rebuild_rootfs.sh b/sw/21_rebuild_rootfs.sh new file mode 100755 index 0000000..9341f23 --- /dev/null +++ b/sw/21_rebuild_rootfs.sh @@ -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" +