|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | +# OpenWrt Builder |
| 4 | + |
| 5 | +Build your customized OpenWrt firmware with ease |
| 6 | + |
| 7 | +GUI + CLI for a simpler, faster firmware build experience |
| 8 | + |
| 9 | +[](https://github.com/EkkoG/OpenWrt/releases/tag/alpha) |
| 10 | +[](LICENSE) |
| 11 | +[](https://github.com/EkkoG/OpenWrt/stargazers) |
| 12 | + |
| 13 | +</div> |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Features at a glance |
| 18 | + |
| 19 | +- **Ready to use**: Based on official ImageBuilder, build in minutes |
| 20 | +- **Modular**: Built‑in common modules, supports custom module directory |
| 21 | +- **One‑click build**: GUI or script commands with real‑time logs and progress |
| 22 | +- **Containerized**: Docker‑isolated build environment; no toolchain setup required |
| 23 | +- **Reusable configs**: Multiple build presets; environment variables centrally managed |
| 24 | + |
| 25 | +## UI Preview |
| 26 | + |
| 27 | +<div align="center"> |
| 28 | +<table> |
| 29 | +<tr> |
| 30 | +<td><img src="./assets/screentshot1.png" width="420" alt="Home" /></td> |
| 31 | +<td><img src="./assets/screentshot2.png" width="420" alt="Build" /></td> |
| 32 | +</tr> |
| 33 | +</table> |
| 34 | +</div> |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## Download & Install (GUI) |
| 39 | + |
| 40 | +- Download prebuilt installers from the releases page: [Releases](https://github.com/EkkoG/OpenWrt/releases) |
| 41 | + |
| 42 | +| Platform | Package | Notes | |
| 43 | +|------|-----------|------| |
| 44 | +| macOS | `.dmg` | Apple Silicon choose `aarch64`, Intel choose `x86_64` | |
| 45 | +| Windows | `.msi` / `.exe` | Windows 10/11 | |
| 46 | +| Linux | `.deb` / `.AppImage` | Ubuntu 20.04+ and other major distros | |
| 47 | + |
| 48 | +Alternatively build from source: see “Development & Build” below. |
| 49 | + |
| 50 | +Note: Please install and start Docker before using the GUI to build firmware. |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Quick Start |
| 55 | + |
| 56 | +### Method 1: Graphical UI (Recommended) |
| 57 | + |
| 58 | +**Installation steps:** |
| 59 | + |
| 60 | +0) Install and start Docker (required) |
| 61 | + - **Linux**: `sudo apt install docker.io` or `sudo pacman -S docker` |
| 62 | + - **macOS/Windows**: Install Docker Desktop |
| 63 | + |
| 64 | +1) Download and install OpenWrt Builder |
| 65 | + - **Linux (.deb)**: `sudo dpkg -i openwrt-builder_*.deb` |
| 66 | + - **Linux (.AppImage)**: `chmod +x OpenWrt-Builder-*.AppImage` |
| 67 | + - **macOS**: Open the .dmg and drag to Applications |
| 68 | + - **Windows**: Run the .msi installer |
| 69 | + |
| 70 | +2) Choose image (OpenWrt/ImmortalWrt) and target platform/version |
| 71 | +3) On the “Modules” page, select the modules you need |
| 72 | +4) Optional: Set output directory, mirror acceleration, etc. |
| 73 | +5) One‑click build in “Build Center” and wait for completion |
| 74 | + |
| 75 | +Tip: The first build downloads more resources; subsequent builds are much faster. |
| 76 | + |
| 77 | +### Method 2: Command Line (Advanced) |
| 78 | + |
| 79 | +**Linux/macOS:** |
| 80 | +From repository root, use `run.sh`: |
| 81 | + |
| 82 | +```bash |
| 83 | +# Help |
| 84 | +./run.sh --help |
| 85 | + |
| 86 | +# Minimal example (ImmortalWrt Rockchip) |
| 87 | +./run.sh \ |
| 88 | + --image=immortalwrt/imagebuilder:rockchip-armv8-openwrt-23.05.1 \ |
| 89 | + --profile=friendlyarm_nanopi-r2s \ |
| 90 | + --with-pull --rm-first --use-mirror |
| 91 | +``` |
| 92 | + |
| 93 | +**Windows:** |
| 94 | +From repository root, in PowerShell run `run.ps1`: |
| 95 | + |
| 96 | +```powershell |
| 97 | +# Help |
| 98 | +.\run.ps1 -Help |
| 99 | +
|
| 100 | +# Minimal example (ImmortalWrt Rockchip) |
| 101 | +.\run.ps1 ` |
| 102 | + -Image "immortalwrt/imagebuilder:rockchip-armv8-openwrt-23.05.1" ` |
| 103 | + -Profile "friendlyarm_nanopi-r2s" ` |
| 104 | + -WithPull -RmFirst -UseMirror |
| 105 | +``` |
| 106 | + |
| 107 | +**Common options:** |
| 108 | + |
| 109 | +Linux/macOS (Bash): |
| 110 | +```bash |
| 111 | +--image=... ImageBuilder image (required) |
| 112 | +--profile=... Device profile (optional) |
| 113 | +--output=... Output directory (default: ./bin) |
| 114 | +--custom-modules=... Custom modules directory (default: ./custom_modules) |
| 115 | +--with-pull Pull image before build |
| 116 | +--rm-first Clean container before build |
| 117 | +--use-mirror Use mirror acceleration (enabled by default) |
| 118 | +--mirror=... Mirror domain, e.g. mirrors.pku.edu.cn |
| 119 | +``` |
| 120 | + |
| 121 | +Windows (PowerShell): |
| 122 | +```powershell |
| 123 | +-Image "..." ImageBuilder image (required) |
| 124 | +-Profile "..." Device profile (optional) |
| 125 | +-Output "..." Output directory (default: ./bin) |
| 126 | +-CustomModules "..." Custom modules directory (default: ./custom_modules) |
| 127 | +-WithPull Pull image before build |
| 128 | +-RmFirst Clean container before build |
| 129 | +-UseMirror Use mirror acceleration (enabled by default) |
| 130 | +-Mirror "..." Mirror domain, e.g. mirrors.pku.edu.cn |
| 131 | +``` |
| 132 | + |
| 133 | +Environment variables (`.env`) example: |
| 134 | + |
| 135 | +```bash |
| 136 | +# Adjust relative to default module set |
| 137 | +MODULES="openclash lan pppoe -tools" |
| 138 | + |
| 139 | +# Or fully override the default module set (higher priority) |
| 140 | +ENABLE_MODULES="argon base lan" |
| 141 | + |
| 142 | +# System env vars are enabled by default; modules can reference variables defined in root .env |
| 143 | + |
| 144 | +# Common ImageBuilder parameters |
| 145 | +CONFIG_TARGET_KERNEL_PARTSIZE=32 |
| 146 | +CONFIG_TARGET_ROOTFS_PARTSIZE=256 |
| 147 | +``` |
| 148 | + |
| 149 | +Default output directory is `./bin`; override with `--output`. |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +## Module System (Brief) |
| 154 | + |
| 155 | +- **Default module set**: `add-all-device-to-lan argon base opkg-mirror prefer-ipv6-settings statistics system tools` |
| 156 | +- Two selection methods: |
| 157 | + - **ENABLE_MODULES**: Fully replace the enabled module list |
| 158 | + - **MODULES**: Add/remove on top of the default set (`-` prefix to exclude) |
| 159 | +- Module locations: supports both `modules/` (built‑in) and `custom_modules/` (user) |
| 160 | +- Directory structure: |
| 161 | + |
| 162 | +``` |
| 163 | +my-module/ |
| 164 | +├─ packages # Dependency packages (space‑separated list or executable script) |
| 165 | +├─ files/ # Files to include in the firmware |
| 166 | +├─ post-files.sh # Optional: post‑processing after files copy |
| 167 | +├─ .env # Optional: module‑level variables |
| 168 | +└─ README.md # Optional: module description |
| 169 | +``` |
| 170 | + |
| 171 | +Advanced features: |
| 172 | +- Env var sharing: modules can reference variables from root `.env` (enabled by default) |
| 173 | +- Variable substitution: files under `files/etc/uci-defaults` support `$VARNAME` replacement |
| 174 | +- Conflict protection: build fails if multiple modules generate the same target path (to prevent overwrite) |
| 175 | + |
| 176 | +--- |
| 177 | + |
| 178 | +## FAQ |
| 179 | + |
| 180 | +**General:** |
| 181 | +- Slow build/limited bandwidth? Enable `--use-mirror` or specify `--mirror=mirrors.pku.edu.cn` |
| 182 | +- Docker not installed? Install Docker Desktop (macOS/Windows) or Docker Engine (Linux) |
| 183 | +- Where are outputs? Default `./bin` (change with `--output`) |
| 184 | +- GUI build fails/unresponsive? Ensure Docker is installed and running; running from source also requires Node.js 18+ and pnpm 8+. See “Development & Build”. |
| 185 | + |
| 186 | +**Windows specific:** |
| 187 | +- PowerShell scripts won’t run? Execute `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser` |
| 188 | +- Docker not found? Ensure Docker Desktop is installed and running; try restarting the terminal |
| 189 | +- Permission issues? Run PowerShell or Docker Desktop as Administrator |
| 190 | +- Non‑ASCII path issues? Prefer checking out the repo into an ASCII‑only path |
| 191 | + |
| 192 | +**Linux specific:** |
| 193 | +- AppImage won’t start? `sudo apt install fuse` to install FUSE support |
| 194 | +- No Docker permission? Add your user to the docker group: `sudo usermod -aG docker $USER`, then re‑login |
| 195 | +- .deb installation failed? `sudo apt-get install -f` to fix dependencies |
| 196 | +- GUI won’t launch? Ensure required desktop and system libraries are installed |
| 197 | + |
| 198 | +--- |
| 199 | + |
| 200 | +## Development & Build |
| 201 | + |
| 202 | +Directory layout: |
| 203 | + |
| 204 | +``` |
| 205 | +. |
| 206 | +├─ build.sh # Actual build script inside container (cross‑platform) |
| 207 | +├─ run.sh # Linux/macOS build script (Docker Compose) |
| 208 | +├─ run.ps1 # Windows PowerShell build script |
| 209 | +├─ modules/ # Built‑in module library |
| 210 | +├─ custom_modules/ # Put your custom modules here |
| 211 | +├─ setup/ # Pre‑build setup scripts |
| 212 | +├─ tauri-app/ # GUI app (Tauri 2 + Vue 3) |
| 213 | +└─ LICENSE # MIT license |
| 214 | +``` |
| 215 | + |
| 216 | +**Run GUI from source and package:** |
| 217 | + |
| 218 | +```bash |
| 219 | +cd tauri-app |
| 220 | +pnpm install |
| 221 | + |
| 222 | +# Development (Tauri dev, fixed port 1420) |
| 223 | +pnpm tauri dev |
| 224 | + |
| 225 | +# Production packaging (desktop installers) |
| 226 | +pnpm tauri build |
| 227 | +``` |
| 228 | + |
| 229 | +**Platform specific requirements:** |
| 230 | + |
| 231 | +*Windows:* |
| 232 | +- Install Rust toolchain (with MSVC) |
| 233 | +- Install Visual Studio Build Tools or Visual Studio |
| 234 | +- Ensure PowerShell 5.1+ or PowerShell Core 7+ |
| 235 | + |
| 236 | +*Linux:* |
| 237 | +- Build tools: `sudo apt install build-essential` |
| 238 | +- GTK libs: `sudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev` |
| 239 | +- Others: `sudo apt install libappindicator3-dev librsvg2-dev patchelf` |
| 240 | + |
| 241 | +*macOS:* |
| 242 | +- Install Xcode Command Line Tools: `xcode-select --install` |
| 243 | + |
| 244 | +Note: Packaging bundles root `build.sh`, `run.sh`, `run.ps1`, `setup/`, `modules/` as resources. Platform‑specific installers (.dmg/.msi/.deb/.AppImage) will be generated. |
| 245 | + |
| 246 | +--- |
| 247 | + |
| 248 | +## Contributing |
| 249 | + |
| 250 | +- **Bug reports**: [Open an Issue](https://github.com/EkkoG/OpenWrt/issues) |
| 251 | +- **Feature requests**: [Request feature](https://github.com/EkkoG/OpenWrt/issues/new) |
| 252 | +- **Code contributions**: [Submit a Pull Request](https://github.com/EkkoG/OpenWrt/pulls) |
| 253 | +- **Docs improvements**: Help improve README and Wiki |
| 254 | +- **Module sharing**: Share your custom modules |
| 255 | + |
| 256 | +## Acknowledgements |
| 257 | + |
| 258 | +<div align="center"> |
| 259 | + |
| 260 | +### Core |
| 261 | +[**OpenWrt**](https://openwrt.org/) • [**ImmortalWrt**](http://immortalwrt.org/) • [**Docker**](https://www.docker.com/) |
| 262 | + |
| 263 | +### Networking |
| 264 | +[**OpenClash**](https://github.com/vernesong/OpenClash) • [**dae**](https://github.com/daeuniverse/dae) • [**Passwall**](https://github.com/xiaorouji/openwrt-passwall) |
| 265 | + |
| 266 | +### Frameworks |
| 267 | +[**Tauri**](https://tauri.app/) • [**Vue.js**](https://vuejs.org/) • [**Vuetify**](https://vuetifyjs.com/) |
| 268 | + |
| 269 | +</div> |
| 270 | + |
| 271 | +## License |
| 272 | + |
| 273 | +Released under the MIT License. See `LICENSE`. |
| 274 | + |
| 275 | +--- |
| 276 | + |
| 277 | +<div align="center"> |
| 278 | + |
| 279 | +[](https://star-history.com/#EkkoG/OpenWrt&Date) |
| 280 | + |
| 281 | +</div> |
0 commit comments