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