diff --git a/Dockerfile b/Dockerfile index e8f70ad..de616a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,26 +4,20 @@ MAINTAINER Piotr Król RUN \ DEBIAN_FRONTEND=noninteractive apt-get -qq update && \ DEBIAN_FRONTEND=noninteractive apt-get -qqy install \ - ccache \ build-essential \ + ccache \ + gcc-5 \ + gcc-aarch64-linux-gnu \ + git \ + iasl \ + libgcc-5-dev \ + nasm \ python \ - python-pip \ - qemu \ sudo \ - vim \ - libgcc-5-dev \ uuid-dev \ - nasm \ - iasl \ - git \ - gcc-aarch64-linux-gnu \ - gcc-arm-linux-gnueabihf \ wget \ - zip \ && DEBIAN_FRONTEND=noninteractive apt-get clean -RUN pip install -q uefi_firmware - RUN useradd -m edk2 && \ echo "edk2:edk2" | chpasswd && \ adduser edk2 sudo diff --git a/README.md b/README.md index 54ce1a4..1f769d3 100644 --- a/README.md +++ b/README.md @@ -5,62 +5,55 @@ This container aim to provide portable and host independent compilation environment for edk2 Open Source reference implementation of UEFI and PI specifications. +Repository is organized around tags named according to [edk2 releases](https://github.com/tianocore/edk2/releases). +Support for edk2 releases doesn't have to be added in chronological order. + Usage ----- +Supported edk2 versions: +* `vUDK2017` - tested build targets: + * [MinnowBoard Max/Turbot](https://github.com/MinnowBoard-org) + * QEMU AArch64 (ArmVirtPkg/ArmVirtQemu.dsc) + ``` -docker pull 3mdeb/edk2 +$ git clone https://github.com/tianocore/edk2.git -b +$ docker pull 3mdeb/edk2: ``` -Build ------ +In addition you may want to clone [edk2-platforms](https://github.com/tianocore/edk2-platforms) and other repositories, +but those are not tagged according to supported edk2 version. ``` -git clone https://github.com/3mdeb/edk2-docker.git +$ docker run --rm -it -w /home/edk2/edk2 -v $PWD/edk2:/home/edk2/edk2 \ +-v ${CCACHE_DIR:-$HOME/.ccache}:/home/edk2/.ccache \ +3mdeb/edk2: /bin/bash +``` + +Build Docker image +------------------ + +``` +git clone https://github.com/3mdeb/edk2-docker.git -b cd edk2-docker -docker build -t 3mdeb/edk2:latest . +docker build -t 3mdeb/edk2: . ``` Building firmware for MinnowBoard Turbot ---------------------------------------- -Note that `edk2-platforms` is actively developed and may require different -versions of binary objects in the future. Check [MinnowBoard Max/Turbot - UEFI Firmware](https://firmware.intel.com/projects/minnowboard-max) -for the latest version. Do not forget to change the directory name in `docker` -command accordingly. +Check [MinnowBoard Max/Turbot - UEFI Firmware](https://software.intel.com/content/www/us/en/develop/articles/minnowboard-maxturbot-uefi-firmware.html) +for the latest version and adjust build script if necessary. ``` -$ docker pull 3mdeb/edk2 -$ git clone https://github.com/tianocore/edk2.git -b vUDK2017 -$ git clone https://github.com/tianocore/edk2-platforms.git -b devel-MinnowBoardMax-UDK2017 -$ wget https://firmware.intel.com/sites/default/files/minnowboard_max-1.00-binary.objects.zip -$ unzip minnowboard_max-1.00-binary.objects.zip -$ cd edk2/CryptoPkg/Library/OpensslLib -$ git clone -b OpenSSL_1_1_0e https://github.com/openssl/openssl openssl -$ cd ../../../.. -$ docker run --rm -it -w /home/edk2 -v $PWD/edk2:/home/edk2/edk2 \ --v $PWD/edk2-platforms:/home/edk2/edk2-platforms \ --v $PWD/MinnowBoard_MAX-1.00-Binary.Objects:/home/edk2/silicon \ --v ${CCACHE_DIR:-$HOME/.ccache}:/home/edk2/.ccache \ -3mdeb/edk2 /bin/bash -(docker)$ cd edk2-platforms/Vlv2TbltDevicePkg/ -(docker)$ . Build_IFWI.sh MNW2 Debug +$ ./build-minnowboard-max.sh ``` Building firmware for QEMU AArch64 ---------------------------------- ``` -$ docker pull 3mdeb/edk2 -$ git clone https://github.com/tianocore/edk2.git -$ docker run --rm -it -w /home/edk2/edk2 -v $PWD/edk2:/home/edk2/edk2 \ --v $PWD/edk2-platforms:/home/edk2/edk2-platforms \ --v ${CCACHE_DIR:-$HOME/.ccache}:/home/edk2/.ccache \ -3mdeb/edk2 /bin/bash -(docker)$ git submodule update --init --checkout -(docker)$ . edksetup.sh -(docker)$ make -C BaseTools -(docker)$ GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -a AARCH64 -t GCC5 -p ArmVirtPkg/ArmVirtQemu.dsc +$ ./build-arm-virt-qemu.sh ``` Building firmware for Versatile Express ARM diff --git a/VERSION b/VERSION index 6085e94..4b9e83e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.1 +vUDK2017 diff --git a/build-arm-virt-qemu.sh b/build-arm-virt-qemu.sh new file mode 100755 index 0000000..3aee8dc --- /dev/null +++ b/build-arm-virt-qemu.sh @@ -0,0 +1,5 @@ +#!/bin/bash -x + +[ ! -d edk2 ] && git clone https://github.com/tianocore/edk2.git -b vUDK2017 + +docker run --rm -it -w /home/edk2/edk2 -v $PWD/scripts:/home/edk2/scripts -v $PWD/edk2:/home/edk2/edk2 -v $PWD/edk2-platforms:/home/edk2/edk2-platforms -v $PWD/minnowboard_max-1.01-binary.objects:/home/edk2/silicon -v ${CCACHE_DIR:-$HOME/.ccache}:/home/edk2/.ccache 3mdeb/edk2:vUDK2017 bash /home/edk2/scripts/build_arm_virt_qemu.sh diff --git a/build-minnowboard-max.sh b/build-minnowboard-max.sh new file mode 100755 index 0000000..af4fde3 --- /dev/null +++ b/build-minnowboard-max.sh @@ -0,0 +1,13 @@ +#!/bin/bash -x + +[ ! -d edk2 ] && git clone https://github.com/tianocore/edk2.git -b vUDK2017 +[ ! -d edk2-platforms ] && git clone https://github.com/tianocore/edk2-platforms.git -b devel-MinnowBoardMax-UDK2017 + +if [ ! -d minnowboard_max-1.01-binary.objects ]; then + wget https://software.intel.com/content/dam/develop/external/us/en/documents/minnowboard-max-1-01-binary-objects.zip + unzip minnowboard-max-1-01-binary-objects.zip +fi + +[ ! -d edk2/CryptoPkg/Library/OpensslLib/openssl ] && git clone -b OpenSSL_1_1_0e https://github.com/openssl/openssl edk2/CryptoPkg/Library/OpensslLib/openssl + +docker run --rm -it -w /home/edk2 -v $PWD/scripts:/home/edk2/scripts -v $PWD/edk2:/home/edk2/edk2 -v $PWD/edk2-platforms:/home/edk2/edk2-platforms -v $PWD/minnowboard_max-1.01-binary.objects:/home/edk2/silicon -v ${CCACHE_DIR:-$HOME/.ccache}:/home/edk2/.ccache 3mdeb/edk2:vUDK2017 bash /home/edk2/scripts/build_minnow.sh diff --git a/scripts/build_arm_virt_qemu.sh b/scripts/build_arm_virt_qemu.sh new file mode 100755 index 0000000..198715d --- /dev/null +++ b/scripts/build_arm_virt_qemu.sh @@ -0,0 +1,4 @@ +git submodule update --init --checkout +. edksetup.sh +make -C BaseTools +GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -a AARCH64 -t GCC5 -p ArmVirtPkg/ArmVirtQemu.dsc diff --git a/scripts/build_minnow.sh b/scripts/build_minnow.sh new file mode 100755 index 0000000..f5a477e --- /dev/null +++ b/scripts/build_minnow.sh @@ -0,0 +1,3 @@ +export PACKAGES_PATH=/home/edk2/edk2:/home/edk2/edk2-platforms:/home/edk2/silicon +cd edk2-platforms/Vlv2TbltDevicePkg/ +. Build_IFWI.sh MNW2 Debug