- Served by a Rust-powered web server
- ...using the axum crate
- Displays real system data from the Raspberry Pi
- ...using the sysinfo crate
- Implements Server-Sent Events (SSE) for real-time updates
- ...using the axum and tokio crates
- Uses templating for HTML generation
- ...using the askama crate
- Mimics old BIOS designs
- ...using the TuiCss package
- Served over HTTPS
- ...preferably using Cloudflare Tunnels and an Origin CA cert
Note
The package's postinst
script allows rspi-bios
to bind to low ports.
# Download package from releases
wget https://github.com/piotrpdev/rspi-bios/releases/latest/download/rspi-bios_1.0.0-1_arm64.deb
# Install package
sudo dpkg -i rspi-bios_1.0.0-1_arm64.deb
# Copy certs (you need to provide your own)
sudo cp ~/rspi-bios/certs/{cert,key}.pem /etc/rspi-bios/certs/
# Run and set to launch on boot
sudo systemctl enable --now rspi-bios
Note
You can look at .github/workflows/publish.yml
to see the instructions
below in action.
# Install dependencies (Ubuntu 24.04 LTS)
# You may need some or all of these
# See https://aws.github.io/aws-lc-rs/requirements/linux.html
sudo apt-get install -y clang libclang1 cmake gcc-aarch64-linux-gnu
# (32-bit ARMv7) sudo apt-get install -y gcc-arm-linux-gnueabihf
cargo install --force --locked bindgen-cli
# Add target (linker already configured for you in ./.cargo/config.toml)
rustup target add aarch64-unknown-linux-gnu
# (32-bit ARMv7) rustup target add armv7-unknown-linux-gnueabihf
# Build
cargo build --release --target=aarch64-unknown-linux-gnu
# (32-bit ARMv7) cargo build --release --target=armv7-unknown-linux-gnueabihf
# Set RUSTFLAGS='-C target-feature=+crt-static' if target uses older version of glibc
# Copy
ssh piotrpdev@192.168.0.200 "mkdir -p ~/rspi-bios" && \
scp -r target/armv7-unknown-linux-gnueabihf/release/rspi-bios templates/ certs/ \
piotrpdev@192.168.0.200:~/rspi-bios/
# Run
ssh -t piotrpdev@192.168.0.200 "chmod +x ~/rspi-bios/rspi-bios && ~/rspi-bios/rspi-bios"
# (Optional) Allow rspi-bios to bind low ports without root
# https://stackoverflow.com/a/414258/19020549
sudo setcap CAP_NET_BIND_SERVICE=+eip ./rspi-bios
# Run on low port
./rspi-bios --https-port 443
A template rspi-bios.service
file is included in the repo if you're
using systemd
and want to automatically run the script on startup e.g.:
# Edit the template
vim ./debian/rspi-bios.service
# Copy it
sudo cp ./debian/rspi-bios.service /lib/systemd/system/
# Start on boot (--now to start now)
sudo systemctl enable rspi-bios.service
In production, I recommend creating/using these directories:
/usr/local/bin/
(placerspi-bios
here)/var/log/rspi-bios/
/etc/rspi-bios/certs/
(place{cert,key}.pem
here)/usr/share/rspi-bios/html/
(placeindex.html
here)
You will need cargo-deb
.
cargo install cargo-deb
cargo deb --locked --target=aarch64-unknown-linux-gnu
# Set RUSTFLAGS='-C target-feature=+crt-static' if target uses older version of glibc
I recommend installing cargo-watch
if you plan on making a lot
of changes.
cargo install cargo-watch
cargo-watch --watch src --watch templates -x run
This project is licensed under the GNU GPL v3.0.
Made using the following resources:
Resource | License |
---|---|
Axum example code | MIT |
TuiCSS "PC Startup" demo | MIT |
"Award Medallion BIOS" design | Copyrighted |
Energy Star logo | Trademark |
Raspberry Pi logo | Trademark |