github.com/hugelgupf/u-root@v0.0.0-20191023214958-4807c632154c/.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.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 \ 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 -j$(($(nproc) * 2 + 1)); \ 42 cd ~; \ 43 cp linux/arch/x86_64/boot/bzImage bzImage; \ 44 rm -rf linux/ 45 46 # Build QEMU 47 RUN set -eux; \ 48 git clone --depth=1 --branch=v2.12.0 https://github.com/qemu/qemu; \ 49 cd qemu; \ 50 mkdir build; \ 51 cd build; \ 52 ../configure \ 53 --target-list=x86_64-softmmu \ 54 --enable-virtfs \ 55 --disable-docs \ 56 --disable-sdl \ 57 --disable-kvm; \ 58 make -j$(($(nproc) * 2 + 1)); \ 59 cd ~; \ 60 cp -rL qemu/build/pc-bios/ ~/pc-bios; \ 61 cp qemu/build/x86_64-softmmu/qemu-system-x86_64 .; \ 62 rm -rf qemu/ 63 64 # Build Multiboot kernel 65 RUN set -eux; \ 66 git clone --depth=1 --branch=v1.01 \ 67 https://github.com/u-root/multiboot-test-kernel; \ 68 cd multiboot-test-kernel; \ 69 make; \ 70 cd ~; \ 71 cp multiboot-test-kernel/kernel ./; \ 72 gzip -k kernel; \ 73 rm -rf multiboot-test-kernel/ 74 75 # Export paths to binaries. 76 ENV UROOT_KERNEL /home/circleci/bzImage 77 ENV UROOT_QEMU "/home/circleci/qemu-system-x86_64 -L /home/circleci/pc-bios -m 1G" 78 ENV UROOT_TESTARCH amd64