Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for MinnowBoard Turbot #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,20 @@ MAINTAINER Piotr Król <[email protected]>
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
Expand Down
61 changes: 27 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <VERSION>
$ docker pull 3mdeb/edk2:<VERSION>
```

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:<VERSION> /bin/bash
```

Build Docker image
------------------

```
git clone https://github.com/3mdeb/edk2-docker.git -b <VERSION>
cd edk2-docker
docker build -t 3mdeb/edk2:latest .
docker build -t 3mdeb/edk2:<VERSION> .
```

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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
vUDK2017
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we are starting with the very first tag of EDK2 and will gradually add support for newer versions? vUDK2017 is so old...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miczyg1 no, this would be economically not feasible. We adding what is needed, not necessarily in chronological order: https://github.com/3mdeb/edk2-docker/pull/9/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R9

5 changes: 5 additions & 0 deletions build-arm-virt-qemu.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions build-minnowboard-max.sh
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command asks for line breaks. Can we use \ to divide it into more lines for better readability?

4 changes: 4 additions & 0 deletions scripts/build_arm_virt_qemu.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions scripts/build_minnow.sh
Original file line number Diff line number Diff line change
@@ -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