Skip to content
Snippets Groups Projects
Commit 2697f2cb authored by Karsten Böddeker's avatar Karsten Böddeker
Browse files

remove Docker

parent fbd89f4c
No related branches found
No related tags found
No related merge requests found
......@@ -10,25 +10,6 @@ Beim Bauen der Firmware werden weitere Git-Repositories heruntergeladen und benu
## Vorbereitung / Umgebung
Es gibt zwei Möglichkeiten, die Firmware zu bauen. Entweder in einem [Docker](https://www.docker.com)-Container
oder "nativ" auf einem Debian/Ubuntu-System. Der Weg über Docker ist der empfohlene Weg für alle, die die Firmware
nur nachbauen wollen - der Docker-Weg ermöglicht vergleichbare Builds.
Hinweis für MacOS-Nutzer: derzeit scheint die Volume-Mount-Funktionalität defekt zu sein (siehe auch [docker issue #4023](https://github.com/docker/docker/issues/4023)), ~~bis ein Workaround existiert~~ wird die Nutzung von Linux empfohlen.
### Docker-Container
Man benötigt Docker, gawk und git:
```bash
sudo apt-get install gawk git
sudo apt-get install docker.io || wget -qO- https://get.docker.com/ | sh
docker pull ffpb/build
```
Das Docker-Repository `ffpb/build` kann auch selbst erstellt werden: `docker build -t ffpb/build docker` (wenn das Git-Repository, in dem diese ReadMe liegt, ausgecheckt wurde)
### Entwickler-System
Als Requirements sind die allgemeinen Build-Tools sowie libfaketime nötig. Zum Bauen des gcc in der Toolchain sind noch drei weitere Bibliotheken notwendig:
```bash
sudo apt-get install build-essential git gawk python subversion unzip p7zip-full \
......@@ -85,15 +66,11 @@ git clone https://git.c3pb.de/freifunk-pb/firmware.git
cd firmware
```
Im Verzeichnis `versions` liegen alle bekannten Firmware-Versionen. Durch Aufruf von `build-version.sh` und Übergabe des Dateinamens (ohne Pfad) wird diese Version erneut gebaut. Es werden zwei Umgebungsvariablen unterstützt:
* **VERBOSE=1** funktioniert wie beim normalen Build und aktiviert Debug-Ausgaben
* **NO_DOCKER=1** benutzt `build.sh` statt `docker-build.sh` zum Bau
Die Nutzung von Docker zur Überprüfung von Builds wird dringend empfohlen, da Docker Unterschiede zwischen den Build-Rechnern ausgleicht und die Binaries so einfacher überprüfbar werden.
Im Verzeichnis `versions` liegen alle bekannten Firmware-Versionen. Durch Aufruf von `build-version.sh` und Übergabe des Dateinamens (ohne Pfad) wird diese Version erneut gebaut. Es wird eine Umgebungsvariablen unterstützt:
* **BROKEN** falls "1", erzeuge zusätzlich Firmware-Images für ungetestete Plattformen (default: "0")
### Beispiele
```bash
./build_version.sh 0.6.1_stable # baut Version '0.6.1_stable' erneut
NO_DOCKER=1 ./build_version.sh 0.6.1_stable # ohne Docker-Umgebung erneut bauen
```
......@@ -40,10 +40,6 @@ echo " * Targets = ${targets}"
echo
# invoke build script
if [ "${NO_DOCKER}" -eq "1" ]; then
BASE="${base}" BRANCH="${branch}" SITE_ID="${site}" VERSION="${version}" BUILD_TS="${ts}" TARGETS="${targets}" BROKEN="${BROKEN}" ./build.sh
else
BASE="${base}" BRANCH="${branch}" SITE_ID="${site}" VERSION="${version}" BUILD_TS="${ts}" TARGETS="${targets}" BROKEN="${BROKEN}" ./docker-build.sh
fi
BASE="${base}" BRANCH="${branch}" SITE_ID="${site}" VERSION="${version}" BUILD_TS="${ts}" TARGETS="${targets}" BROKEN="${BROKEN}" ./build.sh
popd > /dev/null #${MY_DIR}
#!/bin/bash
# (c) 2014-2016 Freifunk Hochstift <kontakt@hochstift.freifunk.net>
# check if we're in the container
running_in_docker() {
awk -F/ '$2 == "docker"' /proc/self/cgroup | read
}
# when called within the container, just call build.sh after ensuring git config is set
if [ running_in_docker -a "$(id -un)" == "build" ]; then
# ensure that we have a valid git config
git config --global user.name "docker-based build"
git config --global user.email build@hochstift.freifunk.net
# invoke the actual build
./build.sh $@
exit
fi
MYDIR="$(dirname $0)"
MYDIR="$(readlink -f ${MYDIR})"
pushd "${MYDIR}" > /dev/null
# run the container with fixed hostname and mapped /code directory
docker run -ti -h ffho-build -v "${MYDIR}:/code" \
--env BASE="${BASE}" \
--env BRANCH="${BRANCH}" \
--env VERSION="${VERSION}" \
--env AUTOUPDATER="${AUTOUPDATER}" \
--env BROKEN="${BROKEN}" \
--env BUILD_TS="${BUILD_TS}" \
--env CLEAN="${CLEAN}" \
--env KEY_DIR="${KEY_DIR}" \
--env MAKEJOBS="${MAKEJOBS}" \
--env PRIORITY="${PRIORITY}" \
--env PUBLISH="0" \
--env SITE_ID="${SITE_ID}" \
--env TARGETS="${TARGETS}" \
--env VERBOSE="${VERBOSE}" \
ffpb/build
popd > /dev/null #${MYDIR}
FROM ubuntu:14.04
MAINTAINER hej@c3pb.de
RUN apt-get update && apt-get install -y \
build-essential \
git python wget gawk subversion p7zip-full unzip \
faketime libfaketime libgmp-dev libmpfr-dev libmpc-dev \
zlib1g-dev ncurses-dev libssl-dev bsdmainutils
RUN useradd -m build
ENV HOME /home/build
RUN sudo -Hu build git config --global user.name "docker-based build" ; sudo -Hu build git config --global user.email "build@hochstift.freifunk.net"
RUN mkdir /code
WORKDIR /code
RUN chown -R build: /code
RUN echo -en "#!/bin/sh\necho Start this container with "-v /path/to/firmware-repo:/code" to map your repo into it.\n" > /code/build.sh ; chmod +x /code/build.sh
VOLUME /code
USER build
CMD ["/bin/bash", "docker-build.sh"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment