- Manage your own list(s) of OpenWRT packages to install
- Optionally resize default embedded partitions to unlock extra filesystem storage
- Optionally convert new OpenWRT builds into into QEMU, Virtualbox, HyperV or VMware virtual machine images
- Automated installation of all Linux dependencies required to build OpenWRT images
-
Enter your preferred OpenWRT release version (or hit enter for latest snapshot version)
-
Modify partition sizes or keep OpenWRT defaults? [y/n] (Y = follow the prompt's instructions for paritition resize)
-
Enter an image filename tag (to help uniquely identify your new build image)
-
Optional: Convert OpenWRT builds into virtual machine images? [y/n] (Y = select a VM disk format: qcow2, qed, vdi, vhdx or vmdk)
-
Optional: Copy your custom OpenWRT config files into the build tree to permanently bake these into the new image
-
When the script completes, your new OpenWRT images are located at
$(pwd)/openwrt_build_output/firmware_images
, and their corresponding converted VM images at$(pwd)openwrt_build_output/vm
.
Any recent x86 Debian-flavored OS with the sudo package installed should work fine. Curl and all other image building Linux dependencies are automatically installed on first run (the user must have sudo permissions for initial install of dependency packages). Windows subsystem for Linux users have a few more steps: https://openwrt.org/docs/guide-developer/toolchain/wsl
-
📥 Download the image builder script and make it executable:
chmod +x x86-imagebuilder.sh
-
🛠️ Customize your package list in the
CUSTOM_PACKAGES
section. The included list of packages are examples and can be removed. Ensure each package is compatible with your OpenWRT build target & doesn't conflict with others. (Search https://openwrt.org/packages/start for your desired package names or use the OpenWRT online firmware selector to check for any package conflicts.) -
▶️ Run the script without sudo (it will prompt for sudo) and follow the setup prompts:./x86-imagebuilder.sh
It is possible to combine default SquashFS with a third persistent EXT4 data partition that won't be wiped by future sysupgrades.
- After image flash or vm launch, simply create a new EXT4 partition and add its new PART-UUID details into the OpenWRT /etc/fstab file.
- Next, re-run the script and add the new fstab file (along with any other custom files) to
$(pwd)/openwrt_inject_files
when prompted. - Reflash or relaunch your system with the new fstab build. Now the EXT4 partition's location and details are permanently baked into the build.
- Note 1: Unless expert, this script should only be used with x86 builds. Do not attempt to resize partitions of firmware images intended for specific router models with NAND flash memory.
- Note 2: Images with modified default partition sizes may have issues with online attended sysupgrades. Resized paritions may require manual re-flashing with upgraded images created with the same resized settings.