github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/.circleci/images/test-image-amd64/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 \ 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 `# Multiboot kernel build deps` \ 27 gcc-multilib \ 28 gzip && \ 29 sudo rm -rf /var/lib/apt/lists/* 30 31 # Create working directory 32 WORKDIR /home/circleci 33 COPY config_linux4.17_x86_64.txt .config 34 35 # Build linux 36 RUN set -eux; \ 37 git clone --depth=1 --branch=v4.17 https://github.com/torvalds/linux; \ 38 sudo chmod 0444 .config; \ 39 mv .config linux/; \ 40 cd linux; \ 41 make olddefconfig; \ 42 make -j$(($(nproc) * 2 + 1)); \ 43 cd ~; \ 44 cp linux/arch/x86_64/boot/bzImage bzImage; \ 45 rm -rf linux/ 46 47 # Build QEMU 48 RUN set -eux; \ 49 git clone --depth=1 --branch=v4.2.0 https://github.com/qemu/qemu; \ 50 cd qemu; \ 51 mkdir build; \ 52 cd build; \ 53 ../configure \ 54 --target-list=x86_64-softmmu \ 55 --enable-virtfs \ 56 --disable-docs \ 57 --disable-sdl \ 58 --disable-kvm; \ 59 make -j$(($(nproc) * 2 + 1)); \ 60 cd ~; \ 61 cp -rL qemu/build/pc-bios/ ~/pc-bios; \ 62 cp qemu/build/x86_64-softmmu/qemu-system-x86_64 .; \ 63 rm -rf qemu/ 64 65 # Build Multiboot kernel 66 RUN set -eux; \ 67 git clone --depth=1 --branch=v1.01 \ 68 https://github.com/u-root/multiboot-test-kernel; \ 69 cd multiboot-test-kernel; \ 70 make; \ 71 cd ~; \ 72 cp multiboot-test-kernel/kernel ./; \ 73 gzip -k kernel; \ 74 rm -rf multiboot-test-kernel/ 75 76 # Export paths to binaries. 77 ENV UROOT_KERNEL /home/circleci/bzImage 78 ENV UROOT_QEMU "/home/circleci/qemu-system-x86_64 -L /home/circleci/pc-bios -m 1G" 79 ENV UROOT_TESTARCH amd64