E.g., for the makefile target output-source_v21.02.0-rc1 -- you cannot
check it out as source/v21.02.0-rc1, but you can check it out as just
v21.02.0-rc1.
This makes it so that if the inputs are not available -- namely
input/.config and possibly input/files/, the build won't run. This
helps inform the user what must be done in order to get things to
build.
The output-${remote}_${revision} (or output-${revision} from the main
remote) target builds OpenWrt with the given input diffconfig,
after checking out ${revision} from ${remote}. Note that neither the
remote nor the ref or revision can have an underscore in them and
still be properly interpreted.
Still, this is all very useful -- I can kick off a from-scratch build
with `make output-pr_p2041-mpc85xx` and in a few minutes it's ready to
review.
Now, in order to set up the builder at a given remote @ commit , we
will want to make
${docker_src}/built/openwrt-builder-remote_commit.sentinel
... and then use the openwrt-builder-remote_commit image as a base.
New remotes can / should be added to openwrt-remotes.txt. Honestly
this oughta have been under the openwrt dir but, eh.
Quoting:
As for what ${args} would need to be for this to work:
- You need to mount a +x build system prep script to /input.sh
- You need to mount a +x build system output extractor to /output.sh
- You need to mount a folder with input resources to /input
- You need to mount an output folder to /output
So, /input.sh could `cp /input/diffconfig /builder/openwrt/.config`,
then cd to /builder/openwrt and run `make defconfig`. The ${CMD}
could then actually build, and /output.sh could collect logs and
build artefacts to /output.
This lot provides exactly that. The makefile in this new dir just
requires diffconfig to be populated; then run `make output` and wait.
Q: What about adding LibreMesh
A: Just add to input.sh (or add a script to it) which does the steps
described here: https://libremesh.org/development.html. You can avoid
the 'make menuconfig' bits by pre-building a diffconfig as needed. And
if you need to debug, add a /bin/sh.
Now we can set up an OpenWrt builder as we want -- just run
make built/openwrt-builder-${commit}.sentinel
and then
docker run ${args} openwrt-builder-${commit} ${CMD}
This will won't need to pull down everything from scratch: the image
is already cached and has everything it needs to compile.
As for what ${args} would need to be for this to work:
- You need to mount a +x build system prep script to /input.sh
- You need to mount a +x build system output extractor to /output.sh
- You need to mount a folder with input resources to /input
- You need to mount an output folder to /output
So, /input.sh could `cp /input/diffconfig /builder/openwrt/.config`,
then cd to /builder/openwrt and run `make defconfig`. The ${CMD} could
then actually build, and /output.sh could collect logs and build
artefacts to /output.
But each of those build system setups can be disincluded from the
main build-system setup per-commit. We no longer have to repeatedly
setup the entire build system just to keep build environments for
different boards separate: only the things that are different between
build trees need that to be done.
Oh, and no more builds spoiled by stale artefacts :D
This is a base builder -- it sets up *most* of the
environment right and provides a great cache; later we can git pull
again and check out the right commit, without needing to invalidate
this builder and re-clone OpenWrt again.
The point of this is to separate dockerfiles and build them on top of
each other wherever possible.
Then we can build them interdependently with makefiles!