Add an example setting up an env for the previous commit

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.
This commit is contained in:
Martin Kennedy 2021-02-08 15:20:55 +00:00
parent fe8eae25e9
commit 7b2d32bb59
3 changed files with 47 additions and 0 deletions

31
openwrt/Makefile Normal file
View File

@ -0,0 +1,31 @@
define INC_NEWOPENWRT =
1
endef
$(info Defined INC_NEWOPENWRT)
include /devel/docker/docker_vars.sh
export
unexport INC_DOCKER
ifndef INC_DOCKER
include ${docker_src}/Makefile
endif
.PHONY: input
input:
rm -rf input; mkdir -p input; chmod 777 input;
.PHONY: prep-output
prep-output:
rm -rf output; mkdir output; chmod 777 output;
input/diffconfig: diffconfig input
cp $< $@
output: diffconfig ${docker_src}/built/openwrt-builder-master.sentinel prep-output input/diffconfig input.sh output.sh
docker run \
-v $$PWD/output:/output \
-v $$PWD/input:/input \
-v $$PWD/input.sh:/input.sh \
-v $$PWD/output.sh:/output.sh \
--rm -it openwrt-builder-master make V=ssc -j24 build

7
openwrt/input.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
cd /builder/openwrt
cp /input/diffconfig .config
make defconfig

9
openwrt/output.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
cd /builder/openwrt
cp -r bin /output/
cp .config /output/
./scripts/diffconfig.sh > diffconfig
cp diffconfig /output/