OpenWRT Custom Build

OpenWRT is a ubiquitous operating system found in edge devices across the globe. It is a popular choice for system integrators (OEMs) building routers due to its flexibility, stability, and extensive feature set - attributes such as:

  • Open-source and vendor independence
  • Highly customizable and modular
  • Advanced networking features
  • Strong security and stability
  • Developer-friendly and automation-ready
  • Proven track record in commercial and industrial use
  • Portability

The last attribute, portability, is especially significant for Netify. Although Netify has been accepted into the OpenWRT community and public repositories, there are several limiting factors that make it less than ideal:

Versioning
For stability reasons, OpenWRT does not accept version upgrades or releases except for bug and security patches. For this reason, only older versions of Netify are available on some OpenWRT versions.
Limited Plugins
OpenWRT only accepts open-source packages, which restricts functionality for proprietary Netify plugins.
Continuous Integration
Most software development teams will require integration into their existing CI/CD functions, requiring custom buildroots based on OpenWRT.

For these reasons, this guide is available to assist teams responsible for compiling and maintaining Netify and its plugin ecosystem in custom OpenWRT build environments.

Setup

Step 1 - Install required dependencies

On a Debian-based environment, install the necessary packages.

Terminal - Netify
×
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential clang flex bison g++ gawk gcc-multilib g++-multilib \
    gettext git libncurses-dev libssl-dev python3 python3-distutils python3-setuptools \
    rsync unzip wget zlib1g-dev file sudo ccache

Step 2 - Clone the OpenWRT Source Code

Terminal - Netify
×
cd ~
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt

Step 3 - Checkout an OpenWRT Release Tag

Terminal - Netify
×
git checkout v23.05.3

Step 4 - Create a feeds.conf File

Terminal - Netify
×
cp feeds.conf.default feeds.conf

Step 5 - Update and Install the Feeds

Terminal - Netify
×
./scripts/feeds update -a
./scripts/feeds install -a

Step 6 - Remove Netify

Netify is already included in the OpenWRT third-party feeds and needs to be removed so that the custom feed that will be added later is selected.

Don't skip this step or you will inadvertently be compiling older Netify versions.

Terminal - Netify
×
./scripts/feeds uninstall netifyd

Step 7 - Configure the Build

Terminal - Netify
×
make menuconfig

What to Select:

  • Target System: Choose the chipset for your device (e.g., Atheros, Mediatek).
  • Target Profile: Select the specific hardware model.
  • Base Packages: Choose essential packages to include.
  • LuCI Web Interface: (Optional) If you want a web UI, enable LuCI under Base system -> LuCI.

When done, press Save, then Exit.

Step 8 - Build

At this point, you should be able to run make and begin compiling the OpenWRT core and selected packages. In fact, compiling Netify's packages from the custom feed will require this at some point, and it could take a while, so you could start the process and then continue to the next step while it's building.

Terminal - Netify
×
make -j$(nproc) V=s

Adding Netify Custom Feed

Netify's development and integration team has created a script to make it easier to correctly set up your environment to build Netify and plugin packages from source.

Step 1 - Create a Folder for Netify Source

Terminal - Netify
×
cd ~
mkdir netify-openwrt

Step 2 - Download the Netify Feed Generator Script

Terminal - Netify
×
cd netify-openwrt
curl https://www.netify.ai/integration/netify-openwrt-feeds.sh
chmod +x netify-openwrt-feeds.sh

Step 3 - Configure the Script (Optional)

If you wish, you can configure which plugins are compiled and which are not.

For proprietary plugins, you will need an NDA and Netify Integrator License Agreement from eGloo as well as a source code token granted through our Git repository.

Step 4 - Generate the Feed

Terminal - Netify
×
NETIFY_BRANCH=v5.0.x ../netify-openwrt-feeds.sh
Netify OpenWrt Feeds Generator
------------------------------
https://www.netify.ai/documentation

>>> Required package dependencies:
autoconf automake bison build-essential flex gawk git libcurl4-openssl-dev libpcap-dev libtool pkg-config rsync uuid

Install package dependencies (requires sudo)? y
[sudo] password for devel:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
autoconf is already the newest version (2.71-2).
automake is already the newest version (1:1.16.5-1.3).
bison is already the newest version (2:3.8.2+dfsg-1build1).
build-essential is already the newest version (12.9ubuntu3).
flex is already the newest version (2.6.4-8build2).
libtool is already the newest version (2.4.6-15build2).
pkg-config is already the newest version (0.29.2-1ubuntu3).
uuid is already the newest version (1.6.2-1.5build9).
gawk is already the newest version (1:5.1.0-1ubuntu0.1).
git is already the newest version (1:2.34.1-1ubuntu1.12).
libcurl4-openssl-dev is already the newest version (7.81.0-1ubuntu1.20).
libpcap-dev is already the newest version (1.10.1-4ubuntu1.22.04.1).
rsync is already the newest version (3.2.7-0ubuntu0.22.04.4).
The following packages were automatically installed and are no longer required:
  bridge-utils dns-root-data dnsmasq-base libflashrom1 libftdi1-2 ubuntu-fan
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 38 not upgraded.
mkdir: created directory '/home/devel/netify-openwrt/netify-feeds'
mkdir: created directory '/home/devel/netify-openwrt/netify-feeds/net'
mkdir: created directory '/home/devel/netify-openwrt/netify-feeds/libs'

>>> Preparing: netify-agent...
Cloning into 'netify-agent'...
remote: Enumerating objects: 21830, done.
remote: Counting objects: 100% (363/363), done.
remote: Compressing objects: 100% (357/357), done.
remote: Total 21830 (delta 223), reused 0 (delta 0), pack-reused 21467 (from 1)
Receiving objects: 100% (21830/21830), 6.20 MiB | 8.95 MiB/s, done.
Resolving deltas: 100% (16483/16483), done.
~/netify-openwrt/netify-agent ~/netify-openwrt
Already on 'master'
Your branch is up to date with 'origin/master'.
...
..
.

>>> Netify Feeds created:
Add the following to your custom feeds.conf:
src-link netify /home/devel/netify-openwrt/netify-feeds

>>> For generic OpenWrt builds, the Netify Feeds can be installed using:
./scripts/feeds update -a
./scripts/feeds install -p netify -a

>>> Done.

By modifying the NETIFY_BRANCH environment variable, you can control which versions of Netify you are compiling for. Our integration support team can provide recommendations if you are unsure.

Compiling and Building Packages

With the Netify custom feeds folder populated with the Netify sources, it's time to add the custom feed to the OpenWRT feeds.conf file. Using the output generated by the script:

Terminal - Netify
×
src-link netify /home/devel/netify-openwrt/netify-feeds

and add this line to the end of your feeds.conf file, so that it looks similar to the following:

Terminal - Netify
×
cat ~/openwrt/feeds.conf
src-git packages https://git.openwrt.org/feed/packages.git^063b2393cbc3e5aab9d2b40b2911cab1c3967c59
src-git luci https://git.openwrt.org/project/luci.git^b07cf9dcfc37e021e5619a41c847e63afbd5d34a
src-git routing https://git.openwrt.org/feed/routing.git^648753932d5a7deff7f2bdb33c000018a709ad84
src-git telephony https://git.openwrt.org/feed/telephony.git^86af194d03592121f5321474ec9918dd109d3057
src-link netify /home/devel/netify-openwrt/netify-feeds

Next, update your feeds.

Terminal - Netify
×
cd ~/openwrt
./scripts/feeds update -a
./scripts/feeds install -a -p netify

Packages

Terminal - Netify
×
make -j$(nproc) V=s package/netifyd/compile

If successful, the packages you have built can be found under the ./bin/packages folder.

Terminal - Netify
×
find ./bin/packages/ -type f | grep netify | grep ipk
./bin/packages/mips_24kc/netify/netifyd_2025-01-01-v5.0.62-1_mips_24kc.ipk
./bin/packages/mips_24kc/netify/netify-proc-core_2025-01-01-v1.0.85-1_mips_24kc.ipk
./bin/packages/mips_24kc/netify/netify-sink-socket_2025-01-01-v1.0.71-1_mips_24kc.ipk
./bin/packages/mips_24kc/netify/netify-sink-http_2025-01-01-v1.0.60-1_mips_24kc.ipk
./bin/packages/mips_24kc/netify/netify-sink-log_2025-01-01-v1.0.58-1_mips_24kc.ipk

Rebuilding Packages

If you make modifications to your Netify custom feeds folder (e.g., version changes or updated code), run the following to force a package rebuild.

Terminal - Netify
×
cd ~/openwrt
make -j$(nproc) V=s package/netifyd/clean
make -j$(nproc) V=s package/netifyd/compile