2021-05-22 06:18:02 -07:00
|
|
|
# How to build the rusEFI firmware from the source files
|
2021-03-28 18:30:01 -07:00
|
|
|
|
2023-01-06 17:10:33 -08:00
|
|
|
## The following process is a step-by-step guide to creating the build environment in windows 10+ using Windows Shell for Linux
|
2021-03-28 18:30:01 -07:00
|
|
|
|
2023-01-02 11:22:23 -08:00
|
|
|
The best way to build the rusEFI firmware is using a set of tools that run best under linux,
|
2021-03-28 18:30:01 -07:00
|
|
|
|
2023-01-02 11:22:23 -08:00
|
|
|
1. Install WSL
|
2023-01-06 17:10:33 -08:00
|
|
|
Run the following in an elevated powershell
|
|
|
|
|
|
|
|
```shell
|
|
|
|
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
|
|
|
|
```
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
2. Download linux
|
2023-01-06 17:10:33 -08:00
|
|
|
Download the appx for linux 2004 from here:
|
|
|
|
[WSL Install Manual](https://docs.microsoft.com/en-us/windows/wsl/install-manual)
|
|
|
|
Or type the following into powershell:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
cd ubuntu/
|
|
|
|
Invoke-WebRequest -Uri <https://aka.ms/wsl-ubuntu-2004> -OutFile Ubuntu.appx -UseBasicParsing
|
|
|
|
```
|
|
|
|
|
|
|
|
This command will download the file to the currently active directory.
|
2021-03-28 18:30:01 -07:00
|
|
|
|
2023-01-02 11:22:23 -08:00
|
|
|
3. install linux
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
|
|
|
PS C:\Windows\system32> cd c:/Ubuntu
|
|
|
|
PS C:\Ubuntu> Add-AppxPackage Ubuntu_2004.2020.424.0_x64.appx
|
|
|
|
```
|
|
|
|
|
|
|
|
Open start menu and launch linux
|
|
|
|
Wait for it to complete install and ask for username and password
|
2021-03-28 18:30:01 -07:00
|
|
|
|
2023-01-02 11:22:23 -08:00
|
|
|
4. check WSL default install
|
2023-01-06 17:10:33 -08:00
|
|
|
In powershell type:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
wslconfig /l
|
|
|
|
```
|
|
|
|
|
|
|
|
Make sure the ubuntu 2004 is marked as default.
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
5. get git
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
|
|
|
sudo apt-get install git
|
|
|
|
```
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
6. clone git
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
|
|
|
git clone <https://github.com/YOUR-REPOSITORY/rusefi.git>
|
|
|
|
```
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
7. Run setup script
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
|
|
|
cd /home/owner/rusefi/firmware
|
|
|
|
sh setup_linux_environment.sh
|
|
|
|
```
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
8. install VScode in windows
|
2023-01-06 17:10:33 -08:00
|
|
|
Download and install as normal, is should detect WSL and ask to install the extension for it, do this and close VScode
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
9. Install VScode in linux
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
|
|
|
cd /home/owner/rusefi
|
|
|
|
code .
|
|
|
|
```
|
2021-03-28 18:30:01 -07:00
|
|
|
|
2023-01-02 11:22:23 -08:00
|
|
|
10. Hit ctrl-b and run "build unit tests"
|
2023-01-06 17:10:33 -08:00
|
|
|
Allow to run and complete, it may exit with "multiple targets" error, if so just run it a second time.
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
11. exit both VScode and ubunu
|
2023-01-06 17:10:33 -08:00
|
|
|
Click the x in VScode and type exit in ubuntu
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
12. reboot ubuntu from the start menu and run make
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
|
|
|
cd /home/owner/rusefi/firmware
|
|
|
|
make
|
|
|
|
```
|
|
|
|
|
|
|
|
This should build the firmware
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
13. If successful then reopen VScode in ubuntu
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
|
|
|
cd /home/owner/rusefi
|
|
|
|
code .
|
|
|
|
```
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
14. Run the built tool for the specific board in VScode
|
2023-01-06 17:10:33 -08:00
|
|
|
Ctrl-Shift-B and select the chosen board, this should build the firmware.
|
2021-03-28 18:30:01 -07:00
|
|
|
|
|
|
|
- Note submodules are their own thing - the main repo just contains a pointer to where the submodule should be checked out
|
|
|
|
|
2023-01-02 11:22:23 -08:00
|
|
|
- Zach method:
|
2023-01-06 17:10:33 -08:00
|
|
|
|
2021-03-28 18:30:01 -07:00
|
|
|
install wsl (already have ubuntu 20.04 on wsl2)
|
2023-01-06 17:10:33 -08:00
|
|
|
|
|
|
|
```shell
|
2021-03-28 18:30:01 -07:00
|
|
|
sudo apt update
|
|
|
|
sudo apt install openjdk-8-jre-headless -y
|
2023-01-02 11:22:23 -08:00
|
|
|
curl -O <https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2>
|
2021-05-22 06:18:02 -07:00
|
|
|
tar -xf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
|
2023-01-06 17:10:33 -08:00
|
|
|
```
|
2022-02-05 11:04:32 -08:00
|
|
|
|
2023-01-06 17:10:33 -08:00
|
|
|
## Without WSL
|
2023-01-02 11:22:23 -08:00
|
|
|
|
|
|
|
Less fancy toolchain without WSL works as well <https://rusefi.com/forum/viewtopic.php?f=5&t=9>
|