Skip to content

YuzukiTsuru/OpenixCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenixCLI

License: MIT Rust

A command-line & tui firmware flashing tool for Allwinner chips, written in Rust.

4610154f-10af-4016-afdd-cf5bdebb59e2

Overview

OpenixCLI is a powerful and user-friendly CLI tool designed for flashing firmware to devices powered by Allwinner SoCs. It supports both FEL (USB Boot) mode and FES (U-Boot) mode, providing a complete solution for firmware deployment.

Features

  • Device Scanning: Automatically detect connected Allwinner devices
  • Firmware Flashing: Flash firmware images with multiple modes
  • FEL/FES Support: Handles both FEL (USB Boot) and FES (U-Boot) device modes
  • Verification: Optional write verification for data integrity
  • Progress Tracking: Visual progress indicators during flash operations
  • Partition Selection: Flash specific partitions or entire firmware
  • Verbose Logging: Detailed debug output for troubleshooting

Installation

Prerequisites

  • Rust toolchain (1.70 or later)
  • libusb development libraries

Build from Source

git clone https://github.com/YuzukiTsuru/OpenixCLI
cd OpenixCLI
cargo build --release

The compiled binary will be available at target/release/openixcli.

Usage

Launch the interactive TUI:

openixcli

You can also launch it explicitly:

openixcli tui

Scan for Devices

List all connected Allwinner devices:

openixcli scan

Flash Firmware

Flash firmware to a device:

openixcli flash <firmware_file> [options]

Flash Options

Option Short Description
--bus -b USB bus number
--port -P USB port number
--verify -V Enable verification after write (default: true)
--mode -m Flash mode: partition, keep_data, partition_erase, full_erase (default: full_erase)
--partitions -p Comma-separated list of partitions to flash
--post-action -a Post-flash action: reboot, poweroff, shutdown (default: reboot)
--verbose -v Enable verbose output

Flash Examples

Flash firmware to a specific device:

openixcli flash firmware.img --bus 1 --port 5

Flash only specific partitions:

openixcli flash firmware.img --partitions "boot,system"

Flash with verification disabled:

openixcli flash firmware.img --verify false

Flash and power off after completion:

openixcli flash firmware.img --post-action poweroff

Flash Modes

Mode Description
partition Flash specific partitions only
keep_data Flash while preserving user data
partition_erase Erase and flash specific partitions
full_erase Full erase before flashing (default)

Device Modes

OpenixCLI supports the following device modes:

  • FEL (USB Boot): Initial boot mode for firmware flashing
  • FES (U-Boot): Secondary mode after U-Boot is loaded
  • UPDATE_COOL/UPDATE_HOT: Update modes

Project Structure

OpenixCLI/
├── src/
│   ├── commands/      # CLI command implementations
│   ├── config/        # Configuration parsing (MBR, sys_config)
│   ├── firmware/      # Firmware image handling
│   ├── flash/         # Flashing logic (FEL/FES handlers)
│   ├── process/       # Stage and progress tracking
│   ├── tui/           # Interactive terminal UI
│   ├── utils/         # Utilities (logging, errors)
│   ├── cli.rs         # CLI argument definitions
│   ├── lib.rs         # Library exports
│   └── main.rs        # Application entry point
├── Cargo.toml
└── LICENSE

See ARCHITECTURE.md for the current module responsibilities and flash flow.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with libefex for Allwinner USB communication
  • Inspired by the need for a modern, reliable firmware flashing tool for Allwinner devices

About

Open Source CLI Tools for Flash Allwinner Firmware to Devices. Support Windows, Linux, macOS

Resources

License

Stars

30 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors