Compile on Arch based distro (exclude Asahi) - posssss/portapack-mayhem GitHub Wiki
The man who wrote this page is a noob, this wiki works, but maybe there are many unnecessary things. feel free to edit it for me.
Debian based is more recommended so if you are just planning to pick up a Linux to play with this project, use Debian based, instead of Arch based. But if you already decided to use Arch, please prevent breaking dependencies with pacman -Syu or yay -Syu
This page not works on Asahi, please make sure you are on x86_64 platform
1. Install dependence
sudo pacman -S git tar wget dfu-util cmake make python3 bzip2 lz4 curl hackrf python-distutils-extra python-setuptools python-pip python-yaml
I have no idea why, but if you use nushell as your default shell, you need to install libopencm3package, otherwise it would call it fail.
Check the output and make sure the packages listed above were installed correctly.
2. Install ARM gcc-arm-none-eabi package from AUR
This will automatically add the path of arm toolchain to the PATH of your default shell (for example: bash, zsh, fish, and nushell).
- Go to the page of
gcc-arm-none-eabipackage in AUR. - Click
View Changesto check the commit history of this AUR package. - Click version 9-2020-q2 to check the specific version of
gcc-arm-none-eabi, then clickDownloadto download the package formakepkg. - Assuming you download the package to
~. - Create a directory to satisfying and checking the package.
mkdir AUR mv aur-11b618acbed084c37cdf1568a1bc2b05152af7e1.tar.gz ./AURcd AURtar -xvf aur-11b618acbed084c37cdf1568a1bc2b05152af7e1.tar.gzcd aur-11b618acbed084c37cdf1568a1bc2b05152af7e1makepkg
(ARM already fixed this but in case of it happend again we'll leave it here.)
Note that since the SSL certificate of the file thismakepkgpointed to already expired, thecurlwouldn't download it correctly, thus, you have to add-kargument to yourmakepkg.conf:
sudo vim /etc/makepkg.conf
Edit the line
'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
to
'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -k -o %o %u'
(You may change it back after installing, if you needed)
Thenmakepkg, waiting it finished.
- Install the package with
pacman:
sudo pacman -U gcc-arm-none-eabi-bin-9_2020_q2_update-1-x86_64.pkg.tar.zst
3. Clone your repo to local and satisfying the sub-module
cd ~
git clone https://github.com/eried/portapack-mayhem.git
cd portapack-mayhem
git submodule update --init --recursive
4. Give permission to the repo directory in your local and compile it
sudo chown -R my_user:my_usergroup ~/portapack-mayhem
cd ~/portapack-mayhem
mkdir build
cd build
cmake ..
make firmware
If you want, use -j argument to increase the compile speed, for example make -j firmware to auto decide the number of threads to compile, or manually set the thread numbers, for example make -j4 firmware
Notes
-
You cannot directly install
gcc-arm-none-eabifrom AUR using yay or others tool, otherwise the version would be not match. -
(ARM already fixed this but in case of it happend again we'll leave it here.)
After installinggcc-arm-none-eabiyou may change themakepkg.confback:
sudo vim /etc/makepkg.conf
Edit the line
'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -k -o %o %u'
to
'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'