This document explains how to build LyMonS for Raspberry Pi using cross-compilation.
make release_piThis creates: lymons-X.Y.Z-pcp-armv7.tgz
make release_pi64This creates: lymons-X.Y.Z-pcp-aarch64.tgz
-
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install cross (automatic on first
make release_pi):cargo install cross --git https://github.com/cross-rs/cross
-
Docker (required by cross):
- Install Docker: https://docs.docker.com/get-docker/
- Ensure Docker daemon is running
No setup required! Push to main branch or create a tag:
git tag -a v0.2.4 -m "Release v0.2.4"
git push origin v0.2.4The workflow automatically builds for both armv7 and aarch64.
| Target | Architecture | Raspberry Pi Models | Recommended |
|---|---|---|---|
armv7-unknown-linux-gnueabihf |
32-bit ARM | Pi 2, 3, 4, Zero 2 W | ✅ Most compatible |
aarch64-unknown-linux-gnu |
64-bit ARM | Pi 4, 5, 400 | ⚡ Better performance |
Recommendation: Use armv7 for maximum compatibility unless you specifically need 64-bit features.
# 32-bit (armv7)
./scripts/cross-compile-pi.sh armv7-unknown-linux-gnueabihf
# 64-bit (aarch64)
./scripts/cross-compile-pi.sh aarch64-unknown-linux-gnu# 32-bit
./scripts/create-pi-package.sh armv7-unknown-linux-gnueabihf
# 64-bit
./scripts/create-pi-package.sh aarch64-unknown-linux-gnutar tzf lymons-*-pcp-armv7.tgz| Target | Description |
|---|---|
make cross_pi |
Cross-compile for armv7 (32-bit) |
make cross_pi64 |
Cross-compile for aarch64 (64-bit) |
make release_pi |
Build complete package for armv7 |
make release_pi64 |
Build complete package for aarch64 |
The workflow triggers on:
- Push to main/master: Builds artifacts, uploads for 30 days
- Tag push (v)*: Builds artifacts AND creates GitHub release
- Pull requests: Validates cross-compilation works
- Manual trigger: Via GitHub Actions UI
-
build-pi: Cross-compiles for both armv7 and aarch64
- Caches cargo registry and build artifacts
- Creates deployment packages
- Uploads artifacts
-
build-summary: Reports overall build status
-
Tag a release:
VERSION="0.2.4" git tag -a "v${VERSION}" -m "Release v${VERSION}" git push origin "v${VERSION}"
-
Wait for workflow (3-5 minutes)
-
Check GitHub Releases:
- Navigate to:
https://github.com/YOUR_ORG/LyMonS/releases - Download:
lymons-X.Y.Z-pcp-armv7.tgz - Download:
lymons-X.Y.Z-pcp-aarch64.tgz
- Navigate to:
Each .tgz file contains:
lymons-X.Y.Z-pcp-ARCH/
├── usr/local/bin/
│ └── LyMonS # Main binary
├── usr/local/lib/lymons/drivers/
│ ├── liblymons_driver_ssd1306.so # Plugin: SSD1306 driver
│ ├── liblymons_driver_ssd1309.so # Plugin: SSD1309 driver
│ ├── liblymons_driver_sh1106.so # Plugin: SH1106 driver
│ └── liblymons_driver_ssd1322.so # Plugin: SSD1322 driver
├── etc/lymons/
│ └── lymons.yaml.example # Configuration template
├── install.sh # Installation script
└── README.md # Usage instructions
scp lymons-*-pcp-armv7.tgz pi@raspberrypi.local:~ssh pi@raspberrypi.localtar xzf lymons-*-pcp-armv7.tgz
cd lymons-*-pcp-armv7
sudo ./install.shsudo nano /etc/lymons/lymons.yamlLyMonScargo install cross --git https://github.com/cross-rs/crosssudo usermod -aG docker $USER
# Log out and back in- Check architecture:
uname -mon Piarmv7l→ Usearmv7packageaarch64→ Useaarch64package
- Verify target matches Pi OS (32-bit vs 64-bit)
# PiCorePlayer/TinyCore
tce-load -wi i2c-tools
tce-load -wi python3.9
# Raspberry Pi OS
sudo apt update
sudo apt install i2c-tools.github/workflows/release-pi.yml
Change trigger branches:
on:
push:
branches:
- main
- develop # Add more branchesAdd more architectures:
strategy:
matrix:
target:
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-gnu # Add x86_64Adjust cache retention:
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
retention-days: 90 # Keep for 90 days| Target | Compile Time | Package Size |
|---|---|---|
| armv7 | ~5 minutes | ~3.5 MB |
| aarch64 | ~5 minutes | ~3.8 MB |
The workflow caches:
- Cargo registry (~500 MB)
- Cargo index (~100 MB)
- Build artifacts (~2 GB)
First build: ~8 minutes Subsequent builds: ~3 minutes
For issues:
- Check workflow logs in GitHub Actions
- Verify
make release_piworks locally - Test package on actual Pi hardware
- Open GitHub issue with logs
GPL-3.0-or-later