0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

UEFI - OVMF.fd ビルド

0
Posted at

How to Setup a Local EDK II Tree

#Windows で構築

ダウンロード

iasl-win-20240321.zip
https://www.intel.co.jp/content/www/jp/ja/download/774881/acpi-component-architecture-downloads-windows-binary-tools.html

2.16.03/win64/nasm-2.16.03-win64.zip
https://www.nasm.us/pub/nasm/releasebuilds/

64-bit Git for Windows Setup.
https://git-scm.com/download/win

Visual Studio 2019 Community Edition
https://aka.ms/vs/16/release/vs_community.exe

Python 3.12.4 Windows installer (64-bit)
https://www.python.org/downloads/windows/

インストール & 展開

ACPI Component Architecture
C:\ASLに展開

C:.
├── ASL
│   ├── acpibin.exe
│   ├── acpidump.exe
│   ├── acpiexec.exe
│   ├── acpihelp.exe
│   ├── acpisrc.exe
│   ├── acpixtract.exe
│   ├── badcode.asl
│   ├── changes.txt
│   └── iasl.exe

NASM - Netwide Assembler
C:\nasmに展開

C:.
├── nasm
│   ├── LICENSE
│   ├── nasm.exe
│   └── ndisasm.exe

Git for Windows
C:\Program Files\Gitにインストール

Visual Studio 2019
C++ によるデスクトップ開発 をインストール
VS2019_インストーラー.png

Python for Windows
Python-3.12.4-amd64.exeをインストール
Add Python to environment variablesにチェック:☑を入れる

コマンドライン

[Win + R]
cmd  ::←入力
[Enter]

cmd
::#  UTF-8 に変更
chcp 65001

::#  パスが通っているか確認
where -r "C:\Program Files\Git" git-cmd.exe
"C:\Program Files\Git\git-cmd.exe"
git --version

::#  環境変数を設定&確認
where python
::->  C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python312\python.exe
set "PYTHON_HOME=%USERPROFILE%\AppData\Local\Programs\Python\Python312"
::#  必ず末尾にパス区切り文字を追加すること
set "NASM_PREFIX=C:\nasm\"
::#  iasl.exe の配置確認
if EXIST "C:\ASL\iasl.exe" (echo TRUE)
::->  TRUE

::#  EDK II をリポジトリからクローン
cd /d C:\
git clone --recursive https://github.com/tianocore/edk2

::#  作業ディレクトリに移動・依存関係の解決
cd C:\edk2
git submodule update --init --recursive
pip install --upgrade pip
pip install -r pip-requirements.txt

::#  C ソースから BaseTools をコンパイル
::#  失敗した場合は "C:\edk2\BaseTools\Bin\Win32" フォルダを削除
edksetup.bat Rebuild
::#  確認
where cl.exe
::->  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\cl.exe
where link.exe
::->  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\link.exe

::#  EDK 環境変数を設定
set "EDK_TOOLS_PATH=C:\edk2\BaseTools"
edksetup.bat

::#  OVMF.fd のビルド
build -a X64 -t VS2019 -p OvmfPkg/OvmfPkgX64.dsc

::#  成果物の確認
dir /s "C:\edk2\Build\OvmfX64\DEBUG_VS2019\FV\OVMF.fd"

::#  場合によっては WSL を使って↓実行(順番大事)
::  cat OVMF_VARS.fd OVMF_CODE.fd > OVMF.fd

#Ubuntu on WSL で構築

bash
# パッケージのインストール
sudo apt update && sudo apt upgrade -y
sudo apt install build-essential uuid-dev iasl git nasm python-is-python3 gcc-10 g++-10 -y

# EDK II リポジトリのクローン
cd ~
git clone https://github.com/tianocore/edk2
cd edk2
git submodule update --init --recursive

# EDK II BaseTools のコンパイル・ビルド
make -C BaseTools
$?    # ← ビルド成否の確認
. edksetup.sh
make -C BaseTools
export EDK_TOOLS_PATH="$(realpath "BaseTools")"
. edksetup.sh BaseTools

::#  OVMF.fd のビルド
build -a X64 -t GCC5 -p OvmfPkg/OvmfPkgX64.dsc

# 成果物の確認
ls -l ~/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd

# 場合によっては↓実行(順番大事)
# cd ~/edk2/Build/OvmfX64/DEBUG_GCC5/FV
# cat OVMF_VARS.fd OVMF_CODE.fd > OVMF.fd
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?