github.com/system-transparency/u-root@v6.0.1-0.20190919065413-ed07a650de4c+incompatible/.circleci/images/test-image-arm/Dockerfile (about) 1 # Copyright 2018-2019 the u-root Authors. All rights reserved 2 # Use of this source code is governed by a BSD-style 3 # license that can be found in the LICENSE file. 4 5 FROM circleci/golang:1.12 6 7 # Install dependencies 8 RUN sudo apt-get update && \ 9 sudo apt-get install -y --no-install-recommends \ 10 `# Linux dependencies` \ 11 git \ 12 bc \ 13 bison \ 14 flex \ 15 gcc-arm-linux-gnueabi \ 16 make \ 17 `# QEMU dependencies` \ 18 libglib2.0-dev \ 19 libfdt-dev \ 20 libpixman-1-dev \ 21 zlib1g-dev \ 22 `# Linux kernel build deps` \ 23 libelf-dev && \ 24 sudo rm -rf /var/lib/apt/lists/* 25 26 # Create working directory 27 WORKDIR /home/circleci 28 COPY config_linux4.20_arm.txt .config 29 30 # Build linux 31 RUN set -eux; \ 32 git clone --depth=1 --branch=v4.20 https://github.com/torvalds/linux; \ 33 sudo chmod 0444 .config; \ 34 mv .config linux/; \ 35 cd linux; \ 36 export ARCH=arm; \ 37 export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-; \ 38 make -j$(($(nproc) * 2 + 1)); \ 39 cd ~; \ 40 cp linux/arch/arm/boot/zImage zImage; \ 41 rm -rf linux/ 42 43 # Build QEMU 44 RUN set -eux; \ 45 git clone --depth=1 --branch=v2.12.0 https://github.com/qemu/qemu; \ 46 cd qemu; \ 47 mkdir build; \ 48 cd build; \ 49 ../configure \ 50 --target-list=arm-softmmu \ 51 --disable-docs \ 52 --disable-sdl \ 53 --disable-kvm; \ 54 make -j$(($(nproc) * 2 + 1)); \ 55 cd ~; \ 56 cp -rL qemu/build/pc-bios/ ~/pc-bios; \ 57 cp qemu/build/arm-softmmu/qemu-system-arm .; \ 58 rm -rf qemu/ 59 60 # Export paths to binaries. 61 ENV UROOT_KERNEL /home/circleci/zImage 62 ENV UROOT_QEMU "/home/circleci/qemu-system-arm -M virt -L /home/circleci/pc-bios" 63 ENV UROOT_TESTARCH arm