Skip to content

Raspberry Pi dashboard that mimics the style of old BIOS designs.

License

Notifications You must be signed in to change notification settings

piotrpdev/rspi-bios

Repository files navigation

RSPI BIOS

Raspberry Pi dashboard that mimics the style of old BIOS designs.

demo gif

Features

Usage

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

Development

Cross-compile for Raspberry Pi

Note

You can look at .github/workflows/publish.yml to see the instructions below in action.

Build

# 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

Run

# Copy
ssh [email protected] "mkdir -p ~/rspi-bios" && \
scp -r target/armv7-unknown-linux-gnueabihf/release/rspi-bios templates/ certs/ \
  [email protected]:~/rspi-bios/

# Run
ssh -t [email protected] "chmod +x ~/rspi-bios/rspi-bios && ~/rspi-bios/rspi-bios"

Bind to low port (optional)

# (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

Start on boot (optional)

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

Directories

In production, I recommend creating/using these directories:

  • /usr/local/bin/ (place rspi-bios here)
  • /var/log/rspi-bios/
  • /etc/rspi-bios/certs/ (place {cert,key}.pem here)
  • /usr/share/rspi-bios/html/ (place index.html here)

Build .deb

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

Tools

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

License

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