Docker Tutorial updated (by Andy, just pasting it here)

This commit is contained in:
paul nehlich 2024-06-26 16:23:02 +02:00
parent a7336c7f75
commit 5707c9f8ae

View File

@ -1,7 +1,7 @@
## Prerequisits for build with Docker ## Prerequisites for building with Docker
##### Info ##### Please Note
IRS wireguard VPN can cause network issues with docker. IRS wireguard VPN can cause network issues with docker.
##### Install Docker ##### Install Docker
@ -9,6 +9,11 @@ If you are using macOS or Windows, please use this tutorial:
- https://www.docker.com/get-started/ - https://www.docker.com/get-started/
On Linux simply use your package manager to install ```docker``` and prepare everything using these commands, to avoid permission denied errors: On Linux simply use your package manager to install ```docker``` and prepare everything using these commands, to avoid permission denied errors:
On Arch Linux this would look like
```sh
sudo apt-get install docker # Ubuntu
sudo packman -Syy docker # Arch
```
```sh ```sh
sudo systemctl start docker sudo systemctl start docker
@ -16,9 +21,9 @@ sudo groupadd docker
sudo usermod -aG docker $USER sudo usermod -aG docker $USER
sudo reboot sudo reboot
``` ```
Congratulations, you installed docker. Please proceed.
## First Stage Boot Loader (FSBL)
## FSBL
FSBL is the First Stage Boot Loader and prepares the CPU and FPGA configuration for booting up the Second Stage Bootloader and finally the flight software. FSBL is the First Stage Boot Loader and prepares the CPU and FPGA configuration for booting up the Second Stage Bootloader and finally the flight software.
@ -27,7 +32,7 @@ FSBL is the First Stage Boot Loader and prepares the CPU and FPGA configuration
```sh ```sh
cd docker/compile_fsbl/ cd docker/compile_fsbl/
git clone https://github.com/Xilinx/embeddedsw/ git clone https://github.com/Xilinx/embeddedsw/
docker build -t compile_fsbl . docker build -t compile_fsbl . # Legacy builder is deprecated and will be removed in future release. TODO
``` ```
##### To build the FSBL, run the following command in the `docker/compile-fsbl` directory: ##### To build the FSBL, run the following command in the `docker/compile-fsbl` directory:
@ -35,14 +40,23 @@ docker build -t compile_fsbl .
docker run -v ./embeddedsw:/fsbl compile_fsbl /bin/bash -c "cd lib/sw_apps/zynq_fsbl/src && make BOARD=zed SHELL=/bin/bash" docker run -v ./embeddedsw:/fsbl compile_fsbl /bin/bash -c "cd lib/sw_apps/zynq_fsbl/src && make BOARD=zed SHELL=/bin/bash"
``` ```
## Requirements [TBC]:
```sh
sudo apt-get install cdoxygen graphviz make arm-none-eabi-gcc # Ubuntu
sudo packman -Syy cmake adoxygen graphviz rm-none-eabi-gcc # Arch
```
1. `doxygen` - tool to generate documentation for C++, C, ...
2. `graphviz` - graph visualisation
3. `cmake` - cross-platform build system
4. `arm-none-eabi-gcc` - precompiled GNU toolchain for certain ARM processors including GCC and GNU Debugger (GDB)
If you want, copy the fsbl.elf to the docker/compile_fsbl directory for easier access: If you want, copy the `fsbl.elf` to the `docker/compile_fsbl` directory for easier access:
```sh ```sh
cp embeddedsw/lib/sw_apps/zynq_fsbl/src/fsbl.elf . cp embeddedsw/lib/sw_apps/zynq_fsbl/src/fsbl.elf .
``` ```
## Steps ## Steps
1. Configure doxygen: 1. Configure `doxygen`:
## mission_rust ## mission_rust
@ -50,6 +64,23 @@ cp embeddedsw/lib/sw_apps/zynq_fsbl/src/fsbl.elf .
```sh ```sh
export DOT_PATH=/usr/local/bin export DOT_PATH=/usr/local/bin
``` ```
2. Satisfy Rust requirements
```sh
cd ../mission_rust
cargo update
rustup toolchain install nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup override set nightly
cargo build -Z build-std
cd docker/compile_mission/
docker build -t compile_mission .
```
3. Configure the ROMEO OBSW repository in `.../obsw/`
##### To build the mission_rust, run the following command in the `docker/compile_mission` directory:
```sh
docker run -v $(pwd)/../../mission_rust:/mission_rust compile_mission /bin/bash -c "cargo build -Z build-std"
```
## obsw ## obsw