Installation

System Requirements

  • Operating System: Linux (Ubuntu 22.04+, Debian-based systems)
  • Rust: 1.70 or later (for building from source)
  • Architecture: x86_64, ARM64
  • Optional: systemd for service integration

Building from Source

Install Rust

If you don't have Rust installed:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Clone the Repository

git clone https://github.com/Astute-Systems/bit.git
cd bit

Build the Project

Build all components:

cargo build --release

The compiled binaries will be in target/release/: - bit-manager - Main test orchestrator - bit-learn - Configuration generator - bit-inspect - Test inspection tool

Test plugins (.so files) will also be in target/release/.

Installing System-Wide

Using Debian Package

Build and install the Debian package:

# Install cargo-deb if not already installed
cargo install cargo-deb

# Build the package
cargo deb -p bit_manager

# Install the package
sudo dpkg -i target/debian/bit-manager_*.deb

This installs: - Binaries to /usr/bin/ - Test plugins to /usr/local/lib/bit_manager/ - Configuration directory: /etc/bit/ - Systemd service: bit_manager.service

Manual Installation

If you prefer manual installation:

# Copy binaries
sudo cp target/release/bit-manager /usr/local/bin/
sudo cp target/release/bit-learn /usr/local/bin/
sudo cp target/release/bit-inspect /usr/local/bin/

# Create directories
sudo mkdir -p /usr/local/lib/bit_manager
sudo mkdir -p /etc/bit

# Copy test plugins
sudo cp target/release/*.so /usr/local/lib/bit_manager/

# Copy systemd service file
sudo cp bit_manager/bit_manager.service /etc/systemd/system/
sudo systemctl daemon-reload

Configuration Setup

After installation, generate configuration files for your system:

# Set the configuration path
export BIT_CONFIG_PATH=/etc/bit

# Run the interactive configuration generator
sudo bit-learn

The bit-learn tool will: - Detect your system hardware - Prompt for test thresholds (with defaults) - Generate TOML configuration files

Just press Enter to accept default values for each prompt.

Verify Installation

Check that tests are discoverable:

# Set environment variables
export BIT_CONFIG_PATH=/etc/bit
export BIT_TEST_PATH=/usr/local/lib/bit_manager

# List all available tests
bit-inspect

You should see a list of all PBIT, CBIT, and FBIT tests.

Running as a Service

Enable and start the BIT manager service:

sudo systemctl enable bit_manager
sudo systemctl start bit_manager

Check service status:

sudo systemctl status bit_manager

View logs:

# Real-time logs
sudo journalctl -u bit_manager -f

# Recent logs
sudo journalctl -u bit_manager -n 100

Development Setup

For development, you typically run without installing:

# Build in debug mode
cargo build

# Set local paths
export BIT_CONFIG_PATH=./bit_manager/config
export BIT_TEST_PATH=./target/debug

# Generate configs
./target/debug/bit-learn

# Run manager once
./target/debug/bit-manager -o

Troubleshooting

Permission Issues

Some tests require elevated privileges: - GPIO, CAN, serial port tests need hardware access - dmesg tests need root to read kernel buffer

Run with sudo or configure capabilities:

sudo bit-manager

Missing Test Plugins

If tests don't appear in bit-inspect, check:

# Verify plugin directory exists
ls -l $BIT_TEST_PATH/*.so

# Check environment variable
echo $BIT_TEST_PATH

Configuration Errors

If tests fail to load configs:

# Verify config directory
ls -l $BIT_CONFIG_PATH/*.toml

# Regenerate configs
bit-learn

Next Steps