Overview
The Podman build method is the recommended approach for building Redox OS. It provides a consistent, reproducible build environment by using containerization, eliminating issues caused by different host configurations.Why Podman? Podman provides rootless containers with better security than traditional Docker, and it’s the default containerization solution for Redox OS builds.
Prerequisites
System Requirements
- Operating System: Linux, macOS, FreeBSD, or Windows WSL2
- Memory: At least 8GB RAM (16GB recommended)
- Disk Space: 20-30GB free space
- Podman: Version 3.0 or higher
Required Software
- Linux (Debian/Ubuntu)
- Linux (Fedora)
- Linux (Arch)
- macOS (Homebrew)
- FreeBSD
Bootstrap Installation
Redox provides an automated bootstrap script that installs all dependencies and sets up the build environment.Using the Bootstrap Script
What the Bootstrap Does
Thepodman_bootstrap.sh script performs these actions:
Dependency Installation
Dependency Installation
- Detects your operating system
- Installs Podman and required packages
- Installs the selected emulator (QEMU or VirtualBox)
- Sets up FUSE and overlay filesystem support
Rust Installation
Rust Installation
- Checks for existing Rust installations
- Offers to install rustup if not present
- Configures the stable Rust toolchain
- Updates PATH for cargo binaries
Repository Clone
Repository Clone
- Clones the Redox OS repository from GitLab
- Creates
.configwithPODMAN_BUILD=1 - Sets up the directory structure
Manual Setup
If you prefer to set up manually or the bootstrap script doesn’t work for your system:1. Clone the Repository
2. Create Configuration File
Create a.config file in the repository root:
.config
.config
3. Install Rust
If you don’t have Rust installed:Building Redox OS
Container Setup
The first time you runmake, the build system will automatically create the Podman container:
- Builds a Podman image based on
podman/redox-base-containerfile - Installs build dependencies inside the container
- Sets up the Rust toolchain in the container
- Creates a tag file at
build/container.tag
Build Process Flow
When using Podman builds, make targets automatically delegate to the container:Configuration Variables
The Podman build system uses several environment variables defined inmk/podman.mk:
Docker image tag for the Podman container
Working directory inside the container
Enable SELinux volume flags (
:Z) for systems with SELinuxPull cached layers from Docker Hub to speed up builds
Build Examples
Container Management
Container Shell Access
To get a shell inside the build container:- Debugging build issues
- Inspecting build artifacts
- Running custom commands in the build environment
Rebuilding the Container
If you need to rebuild the container (e.g., after updating the Containerfile):Container Cleanup
Podman Configuration Details
Volume Mounts
The container mounts these volumes:Environment Variables
These variables are passed to the container:Container Capabilities
The container runs with these capabilities:Filesystem Tools in Podman
By default, filesystem tools (redoxfs, redox_installer) run on the host. To run them inside Podman:.config
Running filesystem tools in Podman requires proper FUSE support in your container environment.
Troubleshooting
Container fails to build
Container fails to build
Symptoms: Error during
podman build commandSolutions:- Check your internet connection
- Verify Podman is properly installed:
podman --version - Try cleaning and rebuilding:
make container_clean && make all - Check system logs:
journalctl -xe | grep podman
FUSE permission errors
FUSE permission errors
Symptoms: Cannot mount filesystem, permission deniedSolutions:
- Ensure FUSE is installed on host
- Check FUSE device permissions:
ls -l /dev/fuse - Verify user is in fuse group:
groups - Try rootless Podman:
podman unshare cat /proc/self/uid_map
SELinux issues
SELinux issues
Symptoms: Volume mount errors on Fedora/RHELSolutions:
- Disable SELinux volume flags in
.config: - Or configure SELinux to allow container access
Slow builds
Slow builds
Symptoms: Builds take hours to completeSolutions:
- Enable binary packages:
- Enable pre-built toolchain:
- Use a minimal configuration:
Advanced Topics
Custom Containerfile
You can specify a custom Containerfile:.config
Cache Management
Podman builds support layer caching via Docker Hub:.config
Multi-Architecture Builds
Build for different architectures from the same host:Next Steps
Configuration Options
Customize your build settings
Recipe System
Learn about building packages