Search code examples
gitbuildroot

Recommended Buildroot external tree structure


just looking for a little advice on my buildroot project structure. At the moment I have this:

projectRoot:
+---projectOS
    +---BuildRoot
    +---BuildRootExternalTree
        +---External board/config/package etc.
        ----in/desc/mk
    +---BuildRootOutput
        ---Images etc.
    ----Makefile
+---projectApp1
    +---src
    ---- CMakeLists.txt
+---projectApp2
    +---src
    ---- CMakeLists.txt

To actually build my rootfs+image I run the make file within ProjectOS, which calls make in BuildRoot with the BR2_EXTERNAL path set to BuildRootExternalTree.

I would like projectApp[1..N] to be external packages. They are currently built out of source via CMake/Make. I have set up all my Config.in within the external tree to be recognised by buildroot, so now I have to decide how the Make files within these packages access the source / pass the cross compile toolchain paths along.

It seems with buidlroot that the standard is to download package source files from some repo, which seems like a nice idea to me. Should I be looking at making projectApp[1..N] git submodules and then cloning their master branches into the relevant directories with the package Make files? Or can I simply point the Make files to the prexisting directories - this doesn't seem like a good idea if these projects are under development and I forget to switch to the master branch etc.

If anyone has any suggestions that would be great. The team working on this is actually very small but I would like to get a robust system going,especially for eventual distribution.


Solution

  • I would suggest you to use the local SITE_METHOD for those packages. Something like:

    PROJECTAPP1_SITE = $(TOPDIR)/../projectApp1 PROJECTAPP1_SITE_METHOD = local

    This will tell Buildroot to not download the source for those packages, but instead uise the source code locally available at the path specified in PROJECTAPP1_SITE.

    See slides 269 and following in https://free-electrons.com/doc/training/buildroot/buildroot-slides.pdf for more details.