I am rewritting the program in rust to make it more stable and offer a full CLI and desktop GUI. I will also be creating a live boot version of this application fully supporting ARM64 builds so the application can be booted from the orange pi via SD Card and the OS will be written directly to the nvme/emmc.
Most, if not all the code was restored
A comprehensive C application for building custom Ubuntu images and firmware for Orange Pi 5 Plus single-board computers with RK3588 SoC.
- Overview
- Features
- System Requirements
- Installation
- Quick Start
- Detailed Usage
- Configuration
- Build Process
- Output Files
- Hardware Support
- Troubleshooting
- Development
- Contributing
- License
- Acknowledgments
The Orange Pi 5 Plus Ubuntu Builder is a native C application designed to create complete, custom Ubuntu systems for Orange Pi 5 Plus hardware. Unlike simple image flashers, this tool builds everything from source - kernels, bootloaders, root filesystems, and GPU drivers - providing maximum customization and optimization for the RK3588 SoC.
- Source-based builds: Compiles everything from source code for optimal performance
- Complete firmware generation: Creates both .bin firmware files and .img bootable images
- GPU optimization: Multiple Mali G610 driver options including custom patches
- Frontend integration: Built-in support for gaming and media center environments
- Professional tooling: Enterprise-grade build system with comprehensive logging
- Custom Kernel Building: Linux kernels optimized for Orange Pi 5 Plus with RK3588-specific patches
- U-Boot Compilation: Bootloader building with Orange Pi configurations and firmware generation
- Ubuntu Root Filesystem: Complete Ubuntu 22.04 systems created with debootstrap
- Cross-compilation Support: Full ARM64 toolchain integration for x86_64 host systems
- RetroArch Integration: Pre-configured retro gaming frontend with optimized settings
- EmulationStation Support: Popular retro gaming interface with theme support
- Lakka Integration: Lightweight gaming-focused Linux distribution option
- Kodi Media Center: Full media center installation with hardware acceleration
- Mali G610 MP4 Support: Native driver support for RK3588 GPU
- Multiple Driver Options:
- Panfrost (default open-source driver)
- Armbian GPU patches for enhanced compatibility
- Framework for custom driver development
- Vulkan API Support: Hardware-accelerated graphics for modern applications
- OpenCL Support: GPU compute acceleration for compatible software
- Interactive Menu System: User-friendly interface for all operations
- Automated Dependency Management: Handles complex build requirements automatically
- Comprehensive Logging: Detailed build process tracking with error reporting
- Modular Architecture: Extensible C codebase for additional features
- Configuration Management: File-based settings for build customization
- Operating System: Ubuntu 20.04+ or Debian 11+ (x86_64)
- Privileges: Root access (sudo) required for system operations
- Disk Space: Minimum 20GB free space (40GB+ recommended)
- Memory: 4GB RAM minimum (8GB+ recommended for parallel builds)
- Network: Internet connection for downloading sources and packages
The following packages are automatically managed by the installer:
build-essential gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
libncurses-dev gawk flex bison openssl libssl-dev git wget curl
bc rsync python3 debootstrap fakeroot device-tree-compiler
mesa-opencl-icd vulkan-tools libvulkan-dev opencl-headers- Board: Orange Pi 5 Plus
- SoC: Rockchip RK3588 (ARM64)
- GPU: Mali G610 MP4
- Storage: SD card (16GB+) or eMMC module
- RAM: 4GB, 8GB, 16GB, or 32GB variants supported
# Download the latest release
wget https://github.com/orangepi/builder/releases/download/v2.0.0/builder_2.0.0-1_amd64.deb
# Install the package
sudo dpkg -i builder_2.0.0-1_amd64.deb
# Fix any dependency issues
sudo apt-get install -f# Clone the repository
git clone https://github.com/orangepi/builder.git
cd builder
# Install build dependencies
sudo ./install_dependencies.sh
# Build the application
make clean && make
# Install system-wide (optional)
sudo make install# Launch the builder with root privileges
sudo builder- Full Build - Complete automated build process
- Build Kernel - Compile custom kernel only
- Build U-Boot - Compile bootloader only
- Build RootFS - Create Ubuntu filesystem only
- GPU/Gaming Setup - Install GPU drivers and gaming frontends
- Create Images - Generate bootable SD card images
- System Configuration - Advanced build settings
# Start the application
sudo builder
# Select option 1 for "Full Build"
# Choose your preferred configuration:
# - Gaming optimized (includes RetroArch, EmulationStation)
# - Media center (includes Kodi)
# - Developer build (includes development tools)
# - Server optimized (minimal, headless)
# The build process will:
# 1. Check and install dependencies
# 2. Download kernel and U-Boot sources
# 3. Apply Orange Pi patches
# 4. Compile kernel and U-Boot
# 5. Create Ubuntu root filesystem
# 6. Install GPU drivers and selected frontends
# 7. Generate bootable image# Global configuration:
/etc/builder/builder.conf
# User configuration (per-build):
~/.config/builder/build.conf
# Patch directories:
/etc/builder/patches/kernel/
/etc/builder/patches/uboot/# Edit: /etc/builder/builder.conf
# Kernel settings
KERNEL_VERSION=6.1
KERNEL_CONFIG=rockchip_linux_defconfig
ENABLE_CUSTOM_PATCHES=1
# Build settings
BUILD_JOBS=4 # Number of parallel compilation jobs
CROSS_COMPILE=aarch64-linux-gnu-
TARGET_ARCH=arm64
# GPU settings
ENABLE_GPU=1
INSTALL_MESA=1
INSTALL_VULKAN=1
INSTALL_OPENCL=1
# Frontend settings
INSTALL_RETROARCH=1
INSTALL_EMULATIONSTATION=1
INSTALL_KODI=1
# Image settings
IMAGE_SIZE=8GB # Final image size
COMPRESS_IMAGE=1 # Compress final image/tmp/orangepi_build/
├── kernel/ # Kernel source and build artifacts
│ ├── linux/ # Kernel source code
│ ├── Image # Compiled kernel image
│ ├── rk3588-orangepi-5-plus.dtb # Device tree blob
│ └── modules/ # Kernel modules
├── uboot/ # U-Boot source and binaries
│ ├── u-boot/ # U-Boot source code
│ ├── u-boot-rockchip.bin # Main U-Boot binary
│ ├── idbloader.img # Initial boot loader
│ └── u-boot.itb # U-Boot FIT image
├── rootfs/ # Ubuntu root filesystem
│ ├── bin/, usr/, etc/ # Standard Linux directories
│ └── [complete Ubuntu system]
├── gpu_sources/ # GPU driver sources
│ ├── mesa/ # Mesa 3D graphics library
│ └── linux-firmware/ # GPU firmware files
└── output/ # Final images and installation files
├── orangepi_ubuntu_*.img # Bootable image file
├── flash-uboot.sh # U-Boot installation script
└── checksums.txt # File verification checksums
# Flash image to SD card:
sudo dd if=/tmp/orangepi_build/output/orangepi_ubuntu_*.img of=/dev/sdX bs=4M status=progress
# Install U-Boot only:
sudo /tmp/orangepi_build/output/flash-uboot.sh /dev/sdX
# Verify image integrity:
sha256sum -c /tmp/orangepi_build/output/checksums.txt- Orange Pi 5 Plus (primary target)
- Orange Pi 5 (experimental support)
- Future RK3588-based models (planned)
CPU: ARM Cortex-A76 (4x) + Cortex-A55 (4x)
GPU: Mali G610 MP4
NPU: 6 TOPS AI acceleration
Video: 8K decode, 4K encode
Memory: Up to 32GB LPDDR4/5
Storage: eMMC, SATA, NVMe, SD card
# Issue: "No space left on device"
# Solution: Ensure 20GB+ free space
df -h /tmp
# Clean previous builds:
sudo rm -rf /tmp/orangepi_build/*
# Issue: "Cross-compiler not found"
# Solution: Install cross-compilation tools
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu# Issue: "GPU not detected"
# Check: Verify driver installation
lsmod | grep panfrost
dmesg | grep mali
# Issue: "3D acceleration not working"
# Check: Test GPU functionality
glxinfo | grep renderer
vulkaninfo --summary- Check the logs: Always review
/tmp/orangepi_build.logfirst - Verify hardware: Ensure Orange Pi 5 Plus compatibility
- Test SD card: Try a different, high-quality SD card
- Serial console: Connect serial adapter for boot debugging
- Community support: Join Orange Pi forums and communities
builder/
├── src/ # Source code modules
│ ├── auth.c/h # Authentication and API access
│ ├── dependencies.c/h # Dependency management
│ ├── gaming.c/h # Gaming frontend integration
│ ├── gpu.c/h # GPU driver management
│ ├── image.c/h # Image creation and partitioning
│ ├── kernel.c/h # Kernel building and configuration
│ ├── logging.c/h # Logging and error handling
│ ├── rootfs.c/h # Root filesystem creation
│ ├── system_utils.c/h # System utilities and commands
│ └── uboot.c/h # U-Boot building and installation
├── debian/ # Debian package configuration
├── config/ # Configuration files and templates
├── builder.c # Main application entry point
├── Makefile # Build system configuration
├── CLAUDE.md # Development documentation
└── README.md # This file
# Clone repository:
git clone https://github.com/orangepi/builder.git
cd builder
# Install development dependencies:
sudo apt install build-essential git
# Build application:
make clean && make
# Install for development:
sudo make install PREFIX=/usr/localWe welcome contributions to the Orange Pi 5 Plus Ubuntu Builder! Here's how you can help:
- Bug Reports: Report issues with detailed reproduction steps
- Feature Requests: Suggest new functionality or improvements
- Code Contributions: Submit patches and new features
- Documentation: Improve documentation and examples
- Testing: Test on different hardware configurations
- Community Support: Help other users in forums and issues
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with appropriate tests
- Commit with descriptive messages:
git commit -m 'Add amazing feature' - Push to your branch:
git push origin feature/amazing-feature - Open a Pull Request with detailed description
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Freedom to use: Use the software for any purpose
- Freedom to study: Access and study the source code
- Freedom to modify: Make changes and improvements
- Freedom to distribute: Share the software and your modifications
- Copyleft: Derivative works must also be GPL-3.0 licensed
- Linux Kernel: GPL-2.0 (with GPL-2.0+ compatibility)
- U-Boot: GPL-2.0+
- Mesa: MIT License
- Ubuntu Packages: Various licenses (mostly GPL, MIT, Apache)
This project builds upon the excellent work of many open-source projects and communities. We are grateful to all contributors and maintainers of the following projects:
- Linux Kernel - The foundation of our custom builds
- Ubuntu - Base operating system and package ecosystem
- Debian - Package management and build system inspiration
- Armbian - ARM board support and GPU patches
- Orange Pi Linux - Hardware-specific kernel patches and drivers
- U-Boot - Universal bootloader for embedded systems
- Orange Pi U-Boot - Orange Pi specific U-Boot configurations
- Rockchip U-Boot - RK3588 SoC bootloader support
- Device Tree Compiler - Hardware description compilation
- Mesa 3D - Open-source graphics drivers including Panfrost
- Panfrost Driver - Open-source Mali GPU driver
- ARM Mali Driver - Proprietary Mali GPU drivers
- Linux Firmware - GPU firmware binaries
- libdrm - Direct Rendering Manager library
- RetroArch - Cross-platform retro gaming frontend
- GitHub: libretro/RetroArch
- EmulationStation - Popular retro gaming interface
- GitHub: RetroPie/EmulationStation
- Lakka - Lightweight retro gaming Linux distribution
- GitHub: libretro/Lakka-LibreELEC
- Kodi - Open-source media center software
- GitHub: xbmc/xbmc
- Box86/Box64 - x86/x64 emulation on ARM
- GitHub: ptitSeb/box86, ptitSeb/box64
- GNU Make - Build automation tool
- GCC - GNU Compiler Collection for cross-compilation
- Debootstrap - Debian/Ubuntu system bootstrapping
- QEMU - Emulation for cross-architecture builds
- Meson - Build system for Mesa and other components
- Ninja - Fast build system backend
- Vulkan - Low-level graphics and compute API
- OpenCL - Cross-platform parallel computing
- OpenGL ES - Graphics API for embedded systems
- V4L2 - Video4Linux2 API for media devices
- Git - Version control system
- pkg-config - Library configuration tool
- ncurses - Terminal user interface library
- OpenSSL - Cryptography and SSL/TLS toolkit
- Orange Pi - Single-board computer hardware and community
- Rockchip - RK3588 SoC design and documentation
- ARM - Mali GPU architecture and documentation
- Khronos Group - Graphics and compute API specifications
- Manjaro ARM - ARM Linux distribution insights
- Arch Linux ARM - ARM-specific Linux distribution
- Buildroot - Embedded Linux build system inspiration
- Yocto Project - Custom Linux distribution framework
- OpenWrt - Embedded Linux router firmware project
- Orange Pi Community Forums - Hardware support, testing, and user feedback
- Armbian Community - ARM board expertise and patch contributions
- LibreELEC - Media center distribution architecture insights
- RetroPie - Retro gaming setup and configuration knowledge
- Pine64 Community - ARM development best practices
This project incorporates code, configurations, and techniques from:
- Armbian build scripts - GPU driver installation and hardware optimization
- Orange Pi official images - Hardware-specific configurations and patches
- Mesa build configurations - GPU driver compilation for ARM64
- U-Boot Orange Pi configs - Bootloader configurations and device trees
- Ubuntu ARM builds - Package selection and system configuration
- RetroArch ARM configs - Gaming frontend optimization for ARM hardware
We extend our heartfelt gratitude to all developers, maintainers, and communities who have made this project possible. The open-source ecosystem's collaborative spirit enables projects like this to exist and thrive.
We are committed to contributing improvements back to the upstream projects where possible. Our contributions include:
- Bug reports and testing feedback
- Hardware-specific patches and configurations
- Documentation improvements
- Community support and knowledge sharing
If you are a maintainer of any of the above projects and have suggestions or concerns about our usage, please reach out through our GitHub issues.