github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/.circleci/images/test-image-amd64/Dockerfile (about) 1 # Copyright 2018-2021 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 cimg/go:1.19 6 7 # Install dependencies 8 RUN sudo apt-get update && \ 9 sudo apt-get install -y --no-install-recommends \ 10 `# Linux dependencies` \ 11 bc \ 12 bison \ 13 flex \ 14 gcc \ 15 git \ 16 make \ 17 `# QEMU dependencies` \ 18 libattr1-dev \ 19 libcap-dev \ 20 libcap-ng-dev \ 21 libfdt-dev \ 22 libglib2.0-dev \ 23 libpixman-1-dev \ 24 meson \ 25 ninja-build \ 26 python3 \ 27 zlib1g-dev \ 28 `# Linux kernel build deps` \ 29 libelf-dev \ 30 `# Multiboot kernel build deps` \ 31 gcc-multilib \ 32 gzip \ 33 `# Edk2 build deps` \ 34 uuid-dev \ 35 nasm \ 36 bash \ 37 iasl && \ 38 sudo rm -rf /var/lib/apt/lists/* 39 40 # Create working directory 41 WORKDIR /home/circleci 42 COPY config_linux.txt .config 43 44 # Build linux 45 RUN set -eux; \ 46 git clone --depth=1 --branch=v6.0 https://github.com/torvalds/linux; \ 47 sudo chmod 0444 .config; \ 48 mv .config linux/; \ 49 cd linux; \ 50 make olddefconfig; \ 51 make -j$(($(nproc) * 2 + 1)); \ 52 cd ~; \ 53 cp linux/arch/x86_64/boot/bzImage bzImage; \ 54 rm -rf linux/ 55 56 # Build QEMU 57 RUN set -eux; \ 58 git clone --depth=1 --branch=v7.0.0 https://github.com/qemu/qemu; \ 59 cd qemu; \ 60 mkdir build; \ 61 cd build; \ 62 ../configure \ 63 --target-list=x86_64-softmmu \ 64 --enable-virtfs \ 65 --disable-docs \ 66 --disable-sdl \ 67 --disable-kvm; \ 68 make -j$(($(nproc) * 2 + 1)); \ 69 cd ~; \ 70 cp -rL qemu/build/pc-bios/ ~/pc-bios; \ 71 cp qemu/build/x86_64-softmmu/qemu-system-x86_64 .; \ 72 rm -rf qemu/ 73 74 # Build Multiboot kernel 75 RUN set -eux; \ 76 git clone --depth=1 \ 77 https://github.com/u-root/multiboot-test-kernel; \ 78 cd multiboot-test-kernel; \ 79 git checkout 1c7e4f4722077dcab308cd1df9818eab011e58c4; \ 80 make; \ 81 cd ~; \ 82 cp multiboot-test-kernel/kernel.gz ./; \ 83 rm -rf multiboot-test-kernel/ 84 85 SHELL ["/bin/bash", "-c"] 86 RUN set -ex; \ 87 git clone --branch uefipayload-2023 --recursive \ 88 https://github.com/linuxboot/edk2 uefipayload; \ 89 cd uefipayload; \ 90 source ./edksetup.sh; \ 91 make -C BaseTools; \ 92 build -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG \ 93 -t GCC5 -D BOOTLOADER=LINUXBOOT -D DISABLE_MMX_SSE=true; \ 94 cp Build/UefiPayloadPkgX64/DEBUG_GCC5/FV/UEFIPAYLOAD.fd ~/; \ 95 cd ~; \ 96 rm -rf uefipayload/ 97 98 # Export paths to binaries. 99 ENV UROOT_KERNEL /home/circleci/bzImage 100 ENV UROOT_QEMU "/home/circleci/qemu-system-x86_64 -L /home/circleci/pc-bios -m 1G" 101 ENV UROOT_TESTARCH amd64