From 3732ff6b7be95193cd4e51e39e2a4396530f6016 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Fri, 22 Dec 2017 02:08:57 +0100 Subject: Add Manibuilder Add a set of Dockerfiles for build testing. If you have an x86 machine and ~20GiB free disk space, run `make register` and `make -jxx` in util/manibuilder and go eat some pizza. The former runs a privileged docker container to set binfmt_misc up for qemu (read the code, don't trust it). Regarding the build targets, this is the original state of Manibuilder as it was used to build-test `flashrom-1.0`. Some fixes to the frame- work were applied, but fixups for the targets will be done in separate patches to maintain their original state for reference. Change-Id: I60863a5c7d70dde71486fccb66cb59b30ba4d982 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/flashrom/+/23005 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- util/manibuilder/Dockerfile.anita | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 util/manibuilder/Dockerfile.anita (limited to 'util/manibuilder/Dockerfile.anita') diff --git a/util/manibuilder/Dockerfile.anita b/util/manibuilder/Dockerfile.anita new file mode 100644 index 00000000..c31f541a --- /dev/null +++ b/util/manibuilder/Dockerfile.anita @@ -0,0 +1,55 @@ +FROM debian:stable + +ARG PKG_PATH=http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.1/All +ARG INST_IMG=http://ftp.de.netbsd.org/pub/NetBSD/NetBSD-7.1/amd64/ +ARG EXTRA_PKG="" + +RUN \ + useradd -p locked -m mani && \ + apt-get -qq update && \ + apt-get -qq upgrade && \ + apt-get -qq dist-upgrade && \ + apt-get -qqy install git python python-pexpect \ + genisoimage qemu-system && \ + apt-get clean && \ + git clone https://github.com/gson1703/anita.git && \ + cd anita && python setup.py install + +USER mani +RUN cd && mkdir .ccache && chown mani:mani .ccache && \ + anita --sets kern-GENERIC,modules,base,etc,comp \ + --disk-size 1024M --memory-size=128M install ${INST_IMG} && \ + rm -rf work-*/download + +RUN cd && anita --persist --run \ +"echo 'dhcpcd' >init && \ + echo 'export PKG_PATH=${PKG_PATH}' >>init && \ + . ./init && \ + pkg_add gmake git-base ccache pciutils libusb1 libusb-compat libftdi \ + ${EXTRA_PKG} && \ + git config --global --add http.sslVerify false && \ + git clone https://review.coreboot.org/flashrom.git" \ + boot ${INST_IMG} + +RUN cd && dd if=/dev/zero bs=1M count=64 of=cache.img && \ + anita --vmm-args '-hdb cache.img' --persist --run \ +"echo fdisk -0 -s 169/63/131009 -f -u wd1 && \ + newfs wd1a && \ + mkdir .ccache && \ + mount /dev/wd1a .ccache && \ + ccache -M 60M && \ + umount .ccache && \ + echo 'manitest() {' >>init && \ + echo ' fsck -y /dev/wd1a' >>init && \ + echo ' mount /dev/wd1a ~/.ccache' >>init && \ + echo ' (cd ~/flashrom && eval \" \$*\")' >>init && \ + echo ' ret=\$?' >>init && \ + echo ' umount ~/.ccache' >>init && \ + echo ' return \$ret' >>init && \ + echo '}' >>init" \ + boot ${INST_IMG} && \ + gzip cache.img + +COPY anita-wrapper.sh /home/mani/mani-wrapper.sh +ENV INST_IMG ${INST_IMG} +ENTRYPOINT ["/bin/sh", "/home/mani/mani-wrapper.sh"] -- cgit v1.2.3