SprinkleOS/docs/ubuntu.md

42 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2020-09-06 15:32:42 +09:00
# Ubuntu でビルドする
2020-08-30 21:55:40 +09:00
2020-08-30 22:27:49 +09:00
## 環境
* Ubuntu 20.04 LTS
2020-09-06 14:40:22 +09:00
* (確認済み) Windows Subsystem for Linux
2020-08-30 21:55:40 +09:00
2020-08-30 22:27:49 +09:00
## ビルド
コマンドラインで下記を実行する
2020-09-06 14:58:46 +09:00
* パッケージの更新
2020-08-30 21:55:40 +09:00
```sudo apt -y update && sudo apt -y upgrade```
2020-09-08 20:40:10 +09:00
* ビルドに必要なパッケージをインストール
```sudo apt -y install build-essential gcc uuid-dev iasl git nasm python3-distutils```
<!--
2020-09-06 14:58:46 +09:00
* gcc-5 をインストール
2020-09-06 15:44:11 +09:00
Ubuntu 20.04 において、既定では gcc-5 をインストールできません。sources.list に追加します。
2020-09-06 14:58:46 +09:00
`echo "deb http://archive.ubuntu.com/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/xenial.list`
`sudo apt -y update`
`sudo apt -y install gcc-5`
2020-09-08 20:40:10 +09:00
-->
2020-09-06 14:58:46 +09:00
* edk2 をクローン、submodule を更新
```git clone https://github.com/tianocore/edk2.git/```
```git submodule update --init```
2020-08-30 22:27:49 +09:00
* SprinkleOS をクローン
2020-08-30 21:55:40 +09:00
```cd edk2```
2020-09-06 14:58:46 +09:00
```git clone https://gitlab.pepepper.cf/ecri/sprinkleos.git/```
* edk2 を設定
2020-08-30 22:27:49 +09:00
```. edksetup.sh```
2020-09-06 14:58:46 +09:00
* `target.txt` の編集
2020-09-06 15:44:11 +09:00
`Conf/target.txt` の中身を以下のように編集します。
2020-08-30 22:27:49 +09:00
`- ACTIVE_PLATFORM = EmulatorPkg/EmulatorPkg.dsc`
`+ ACTIVE_PLATFORM = sprinkleos/sprinkleos.dsc`
`- TARGET_ARCH = IA32`
`+ TARGET_ARCH = X64`
`- TOOL_CHAIN_TAG = VS2015x86`
`+ TOOL_CHAIN_TAG = GCC5`
* ビルド
```build```
成果物は `Build/SprinkleOSX64/DEBUG_GCC5/X64/sprinkleos.efi` にあります。
## 参考
* [Using EDK II with Native GCC · tianocore/tianocore.github.io Wiki](https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Install_required_software_from_apt)