From 7b2d32bb59f965a80a4f68794cdd1c94bd052aed Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Mon, 8 Feb 2021 15:20:55 +0000 Subject: [PATCH] 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. --- openwrt/Makefile | 31 +++++++++++++++++++++++++++++++ openwrt/input.sh | 7 +++++++ openwrt/output.sh | 9 +++++++++ 3 files changed, 47 insertions(+) create mode 100644 openwrt/Makefile create mode 100755 openwrt/input.sh create mode 100755 openwrt/output.sh diff --git a/openwrt/Makefile b/openwrt/Makefile new file mode 100644 index 0000000..8e6eaf8 --- /dev/null +++ b/openwrt/Makefile @@ -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 diff --git a/openwrt/input.sh b/openwrt/input.sh new file mode 100755 index 0000000..15b6a73 --- /dev/null +++ b/openwrt/input.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cd /builder/openwrt + +cp /input/diffconfig .config + +make defconfig diff --git a/openwrt/output.sh b/openwrt/output.sh new file mode 100755 index 0000000..3ae9974 --- /dev/null +++ b/openwrt/output.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd /builder/openwrt + +cp -r bin /output/ + +cp .config /output/ +./scripts/diffconfig.sh > diffconfig +cp diffconfig /output/