github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+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.13 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 libcap-dev \ 23 libattr1-dev \ 24 `# Linux kernel build deps` \ 25 libelf-dev && \ 26 sudo rm -rf /var/lib/apt/lists/* 27 28 # Create working directory 29 WORKDIR /home/circleci 30 COPY config_linux5.2.0_arm.txt .config 31 32 # Build linux 33 RUN set -eux; \ 34 git clone --depth=1 --branch=v5.2 https://github.com/torvalds/linux; \ 35 sudo chmod 0444 .config; \ 36 mv .config linux/; \ 37 cd linux; \ 38 export ARCH=arm; \ 39 export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-; \ 40 make -j$(($(nproc) * 2 + 1)); \ 41 cd ~; \ 42 cp linux/arch/arm/boot/zImage zImage; \ 43 rm -rf linux/ 44 45 # Build QEMU 46 RUN set -eux; \ 47 git clone --depth=1 --branch=v3.1.0 https://github.com/qemu/qemu; \ 48 cd qemu; \ 49 mkdir build; \ 50 cd build; \ 51 ../configure \ 52 --target-list=arm-softmmu \ 53 --enable-virtfs \ 54 --disable-docs \ 55 --disable-sdl \ 56 --disable-kvm; \ 57 make -j$(($(nproc) * 2 + 1)); \ 58 cd ~; \ 59 cp -rL qemu/build/pc-bios/ ~/pc-bios; \ 60 cp qemu/build/arm-softmmu/qemu-system-arm .; \ 61 rm -rf qemu/ 62 63 # Export paths to binaries. 64 ENV UROOT_KERNEL /home/circleci/zImage 65 ENV UROOT_QEMU "/home/circleci/qemu-system-arm -M virt -L /home/circleci/pc-bios" 66 ENV UROOT_TESTARCH arm