-
-
Notifications
You must be signed in to change notification settings - Fork 591
How to compile faster with WSL 2
Note: This is for Windows only
The steps on the Compile-firmware page work fine for compiling, but you may find it takes around 35 minutes each time. In this guide I will show you how to get that time down to 2 seconds - 1 minute depending on your hardware.
Step 1) Download Ubuntu from the windows store
Step 2) once its opened open up a windows terminal and run wsl -l -v
check it says version 2
If it does not, then run: wsl --set-default-version 2
followed by running wsl --set-version Ubuntu 2
Step 3) Once that is done, open the Ubuntu app again (make sure you have set it up so you get to the console in it)
Step 4) Go to docker on windows and go to settings -> resources -> WSL Integration
Step 5) Toggle Ubuntu on (if its not there, click refresh)
Step 6) Open up your windows file explorer ang in the address bar go to \\wsl$\
Step 7) navigate to Ubuntu/home/{username}/
Step 8) copy your portapack-mayhem folder into your dir above
Step 9) Confirm your Ubuntu WSL instance can see it by going cd ~/portapack-mayhem
Step 10) If its there then you are good to go. Time to run docker docker run -it -v ~/portapack-mayhem:/havoc portapack-dev
Step 11) Profit! It should be compiling super fast now!
You can then set a network share up to your \\wsl$\Ubuntu\home\{username}\portapack-mayhem
folder and continue to edit the files from within windows.
If there were errors in the compiling aspect you can follow these steps.
After Step 5 do this:
Step 5.1) Open Ubuntu
Step 5.2) Do a sudo git clone --recurse-submodules sudo git clone --recurse-submodules https://github.com/portapack-mayhem/mayhem-firmware.git
(Note if it still doesn't compile, you might need to run git submodule update --init --recursive
)
Step 5.3) Give permission for the portapack-mayhem directory to your user
- Run command
whoami
- Run command
sudo chown -R my_user:my_usergroup /home/{username}/portapack-mayhem
(Note: Replace "my_user:my_usergroup" with the return from"whoami"
)
Step 5.4) Create "build" folder
- Run command
cd portapack-mayhem
- Run command
ls
(Note how there's no build folder) - Run command
mkdir build
- Run command
ls
(Note how a build folder is present)
Step 5.5) Prevent 'python/r' not found
error
- Run command
git config --global core.autocrlf false
.
Or omit the false
to see it's status.
Step 5.6)
- Run command
docker build -t portapack-dev -f dockerfile-nogit .
- Run command
docker run -it -v ~/portapack-mayhem:/havoc portapack-dev
On my system it took 8 minutes, and 43 seconds to complete, this would vary based on your system's hardware and configurations
On the second compile, I made changes on the "ui_geomap.cpp" & "ui_geomap.hpp". These were no more that 25 lines of changes made collectively. And this was compiled in 3 seconds on my system.
Please refer to these official links form Microsoft:
Note
The wiki is incomplete. Please add content and collaborate.
Important
- This is a public wiki. Everything is visible to everyone. Don't use it for personal notes.
- Avoid linking to external tutorials/articles; they may become outdated or contain false information.
How to collaborate
How to ask questions correctly
- First steps
- Usage cautions
- Intended use and Legality
- Features
- PortaPack Versions (which one to buy)
- HackRF Versions
- Firmware update procedure
- Description of the hardware
- User interface
- Powering the PortaPack
-
Troubleshooting
- Won't boot
- Config Menu
- Firmware upgrade
- Diagnose firmware update in Windows
- Receive Quality Issues
- No TX/RX
- TX Carrier Only
- H2+ speaker modifications
- Dead Coin Cell Battery
- Factory Defaults
- SD card not recognized by PC with the SD-card over USB selected
- DFU overlay
- Full reset
- SolveBoard
- How to Format SDCard
- Applications
-
Compilation of the firmware
- Compile on WSL with ninja
- How to compile on Windows faster with WSL 2
- Using Docker and Kitematic
- Docker command-line reference
- Using Buddyworks and other CI platforms
- Notes for Buddy.Works (and other CI platforms)
- Using ARM on Debian host
- All in one script for ARM on Debian host
- Compile on Arch based distro (exclude Asahi)
- Dev build versions
- Notes About ccache
- Create a custom map
- Code formatting
- PR process
- Description of the Structure
- Software Dev Guides
- Tools
- Research
- UI Screenshots
- Maintaining
- Creating a prod/stable release (Maintainers only)
- Maintaining rules
- Development States Notes