Tools to build OpenWRT firwmare for the Omega2 and Omega2+ using the OpenWRT Image Builder in an easily repeatable and maintainable way.
We recommend using Ubuntu 22.04 Linux to build this repo. See the OpenWRT Build System Setup instructions for details on what packages are required.
By default, this repo is setup to build OpenWRT firmware for the Onion Omega2 and Omega2+
- Run
bash onion_buildenv setup_imagebuilder
to download and setup the image builder - Run
bash onion_buildenv build_all_firmware
to build the Omega2 and Omega2+ firmware - Find the compiled firmware in the
output
directory
The bash onion_buildenv setup_imagebuilder
script:
- Will download and setup the OpenWRT image builder
- Add the package repo specified as env variable
PACKAGE_REPOS
in a buildprofile
to the image builder
The bash onion_buildenv build_all_firmware
script:
- Will compile firmware for the Onion Omega2 and Omega2+
- Output binary files will be in the
output
directory
By default, the bash onion_buildenv build_all_firmware
command will build firmware for the target devices specified in the BUILD_MODELS
variable in profiles
.
To build for a specific target device, use this command: bash onion_buildenv build_firmware <target>
OpenWRT packages can be added to the compiled firmware.
In the bash onion_buildenv build_all_firmware
script, the env variable IMAGE_BUILDER_PACKAGES
controls which packages are included in the firmware. Each package has to be added in na new line or in a space separated list.
Everything from the additions/
directory will be copied into the image builder directory before build.
For example, adding a additions/files
directory will allow you to include custom files (like custom configuration files) in the firmware image.
Note: adding .hidden files/directories to the firmware image works, but just not in the
/
directory.
By default, the firmware will be built including packages from published package repos. Like the the Onion Package Repo or the OpenWRT package repo.
While your packages are still in development, it might be useful to work with local copies of the packages.
To work with local copies of your packages:
- Say you've set up the OpenWRT SDK and you're compiling packages to your local machine
- Update
PACKAGE_REPOS
env variable to point to the local packages. Seeprofiles/README.md
for details. - Make any changes to your packages and compile them into IPK files
- Run
bash onion_buildenv setup_imagebuilder
to download and setup the image builder - Run
bash onion_buildenv build_firmware <target>
to build the firmware - Find the compiled firmware in the
output
directory - Test the firmware on your device. If more changes to your packages are required, start again from step 3
Say we've used the OpenWRT SDK to build packages locally and the output files can be found at the /home/ubuntu/openwrt-sdk-wrapper/openwrt-sdk/bin/packages/mipsel_24kc/custom/
directory.
And say we wanted to build firmware that uses those locally compiled packages, we would do the following:
- Update
PACKAGE_REPOS
env variable in a profile file:- comment out the existing line
- add a new line:
PACKAGE_REPOS="src custom file:///home/ubuntu/openwrt-sdk-wrapper/openwrt-sdk/bin/packages/mipsel_24kc/custom/"
- Make any changes to your packages and compile them into IPK files
- Run
bash onion_buildenv setup_imagebuilder
to download and setup the image builder - Run
bash onion_buildenv build_firmware <target>
to build the firmware - Find the compiled firmware in the
output
directory