1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-28 23:43:42 +02:00
flashrom/util/manibuilder/Dockerfile.anita
Nico Huber 5d7dbc7313 manibuilder/anita: Make disk and memory sizes configurable
Change-Id: I95e428a19b4c2042430d3147845397adb1c37e9b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/51479
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-03-16 10:12:37 +00:00

59 lines
2.0 KiB
Docker

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 DISK_SIZE=1G
ARG MEM_SIZE=128M
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 ${DISK_SIZE} --memory-size=${MEM_SIZE} \
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"]