Proposal: Build system for making SD Card images

I am currently working on a project using a DE0-Nano-SoC / Atlas-SoC kit. While getting the FPGA system up was straight forward, getting the Linux system up and running was more complex and I’ve spent significant time getting to understand the process and the steps. I really appreciate the tutorials and guides in, they have helped me a lot. However they, being excellent for tutoring, they are not well suited for continuous product development where the steps must be executed over and over again repeatedly.

The GHRD from Terasic contains a Makefile that enables building from the EDS shell. Likewise does this repo: However, I found neither of them completely fitting the use case of taking a compiled FPGA design and making the proper SD Card setup required for boot. E.g. tools for automatically making the SD Card image didn’t exist.

I think common framework for collecting the boot tools would be great. This will significantly reduce the threshold for learning and adapting Linux in FPGA-based SoC systems.

I’ve made a small contribution of scripts built upon the Makefile from the above repos. It will build and collect the FPGA configuration and files for booting and make a bootable SD Card image. It can also collect Linux kernel and file system into the image. Is there any interest that I share these tools? (Where?)

As a show-case for this, by issuing "make boot" the required files for booting will be built. It will be collected them into boot/. The boot directory can be packaged into a .tgz for transfer/hand-off to a Linux system with “make boot-tgz”, recognizing that FPGA design isn’t always done in Linux. The boot directory is packaged with a self-sustained Makefile which contains the scripts necessary to build a complete SD Card image on Linux.

Please also note that it is my clear opinion that a Makefile-based build system should support ordinary FPGA development and compilation in the Quartus environment, not replace it. This way the FPGA-engineer won’t be alienated by any make or tcl based build system.

Our workflow is (in Windows by FPGA engineer):

  1. Develop and compile design in Quartus/Qsys design — alternatively "make quartus_compile" in EDS
  2. If compiled manually in Quartus run "make ok" to signal that design is compiled in Quartus
  3. In EDS run "make boot-tgz" to provide the "boot/boot.tar.gz". This includes (sof,rbf,preloader,uboot,dtb,dts and bootscript)

SW workflow (in Linux by SW engineer):

  1. Receive boot.tar.gz and unpack in appropriate directory
  2. Build/use some Linux system and kernel variant
  3. Run make image ROOTFS=<dir or tgz> KERNEL=<path> UBOOT=<path> DEVICE=<dev or file>"

This will make a bootable SD Card image (if a file is specified in DEVICE=) or an actual SD Card.

Does this sound useful to anyone?

It does to me! I have run through all steps manually several times, and it is indeed tedious. Some form of automation would help.

Any ideas how? It does not seem like offers an open editable wiki, or am I mistaking?