From 23cf7300a721fec501baea6735994569a8e19109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Mon, 28 Jun 2021 23:45:32 +0200 Subject: [PATCH 1/4] Fix support for MinnowBoard Turbot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Król --- Dockerfile => Dockerfile.minnowboard-max | 22 ++++++++++++---------- README.md | 18 ++---------------- build-minnowboard-max.sh | 13 +++++++++++++ scripts/build_minnow.sh | 3 +++ 4 files changed, 30 insertions(+), 26 deletions(-) rename Dockerfile => Dockerfile.minnowboard-max (74%) create mode 100755 build-minnowboard-max.sh create mode 100755 scripts/build_minnow.sh diff --git a/Dockerfile b/Dockerfile.minnowboard-max similarity index 74% rename from Dockerfile rename to Dockerfile.minnowboard-max index e8f70ad..9f3c06a 100644 --- a/Dockerfile +++ b/Dockerfile.minnowboard-max @@ -4,26 +4,28 @@ 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 \ + 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 \ + vim \ wget \ zip \ && DEBIAN_FRONTEND=noninteractive apt-get clean -RUN pip install -q uefi_firmware - +RUN \ + DEBIAN_FRONTEND=noninteractive apt-get -qq update && \ + DEBIAN_FRONTEND=noninteractive apt-get -qqy install \ + libgcc-5-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get clean RUN useradd -m edk2 && \ echo "edk2:edk2" | chpasswd && \ adduser edk2 sudo diff --git a/README.md b/README.md index 54ce1a4..72faa6a 100644 --- a/README.md +++ b/README.md @@ -25,26 +25,12 @@ 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) +versions of binary objects in the future. 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. Do not forget to change the directory name in `docker` command accordingly. ``` -$ 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 diff --git a/build-minnowboard-max.sh b/build-minnowboard-max.sh new file mode 100755 index 0000000..620644b --- /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:minnowboard-max bash /home/edk2/scripts/build_minnow.sh 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 From 717ea7d51b2c04dbc7e14d2c141f21799c37ddfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Tue, 29 Jun 2021 00:35:44 +0200 Subject: [PATCH 2/4] Map 3mdeb/edk2 docker releases to edk2 versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Król --- Dockerfile.minnowboard-max => Dockerfile | 10 ------- README.md | 36 ++++++++++++++++++------ VERSION | 2 +- build-minnowboard-max.sh | 2 +- 4 files changed, 29 insertions(+), 21 deletions(-) rename Dockerfile.minnowboard-max => Dockerfile (69%) diff --git a/Dockerfile.minnowboard-max b/Dockerfile similarity index 69% rename from Dockerfile.minnowboard-max rename to Dockerfile index 9f3c06a..f0062a2 100644 --- a/Dockerfile.minnowboard-max +++ b/Dockerfile @@ -7,25 +7,15 @@ RUN \ build-essential \ ccache \ gcc-5 \ - git \ iasl \ libgcc-5-dev \ nasm \ python \ - python-pip \ - qemu \ sudo \ uuid-dev \ - vim \ wget \ - zip \ && DEBIAN_FRONTEND=noninteractive apt-get clean -RUN \ - DEBIAN_FRONTEND=noninteractive apt-get -qq update && \ - DEBIAN_FRONTEND=noninteractive apt-get -qqy install \ - libgcc-5-dev \ - && DEBIAN_FRONTEND=noninteractive apt-get clean RUN useradd -m edk2 && \ echo "edk2:edk2" | chpasswd && \ adduser edk2 sudo diff --git a/README.md b/README.md index 72faa6a..112165c 100644 --- a/README.md +++ b/README.md @@ -5,29 +5,47 @@ 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) + + ``` -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. + +``` +$ 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 +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://software.intel.com/content/www/us/en/develop/articles/minnowboard-maxturbot-uefi-firmware.html) -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. ``` $ ./build-minnowboard-max.sh diff --git a/VERSION b/VERSION index 6085e94..4b9e83e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.1 +vUDK2017 diff --git a/build-minnowboard-max.sh b/build-minnowboard-max.sh index 620644b..af4fde3 100755 --- a/build-minnowboard-max.sh +++ b/build-minnowboard-max.sh @@ -10,4 +10,4 @@ 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:minnowboard-max bash /home/edk2/scripts/build_minnow.sh +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 From d82572efac57a7d333226bcd46825e14cdf24d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Tue, 29 Jun 2021 01:07:55 +0200 Subject: [PATCH 3/4] Add support for QEMU AArch64 (ArmVirtPkg/ArmVirtQemu.dsc) compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Król --- Dockerfile | 2 ++ README.md | 19 ++++--------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0062a2..de616a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,8 @@ RUN \ build-essential \ ccache \ gcc-5 \ + gcc-aarch64-linux-gnu \ + git \ iasl \ libgcc-5-dev \ nasm \ diff --git a/README.md b/README.md index 112165c..1f769d3 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,9 @@ Usage ----- Supported edk2 versions: -* `vUDK2017` - -Tested build targets: -* [MinnowBoard Max/Turbot](https://github.com/MinnowBoard-org) - +* `vUDK2017` - tested build targets: + * [MinnowBoard Max/Turbot](https://github.com/MinnowBoard-org) + * QEMU AArch64 (ArmVirtPkg/ArmVirtQemu.dsc) ``` $ git clone https://github.com/tianocore/edk2.git -b @@ -55,16 +53,7 @@ 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 From 67f4d7f1e75d64a25d577d549079a91944a0c547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Tue, 29 Jun 2021 01:20:40 +0200 Subject: [PATCH 4/4] Add missing scripts to build QEMU AArch64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Król --- build-arm-virt-qemu.sh | 5 +++++ scripts/build_arm_virt_qemu.sh | 4 ++++ 2 files changed, 9 insertions(+) create mode 100755 build-arm-virt-qemu.sh create mode 100755 scripts/build_arm_virt_qemu.sh 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/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