How to add package(s) to AP firmware?

Adding a package that exists in OpenWRT
i. In profiles/edgecore_eap101.yml,
image

ii. Add package name below like
image

iii. To verify the name of the package and the related packages that might need to be enabled as well

tip/wlan-ap$ cd openwrt
tip/wlan-ap/openwrt$ make menuconfig

iv. Add packages, check the diff of the .config (using an editor like VS code is convenient for such process) and add the name of the packages accordingly.
For example, if you want to add ‘wwan’ package to the config, it shows

CONFIG_PACKAGE_wwan=y

v. So the profiles/edgecore_eap101.yml should be changed as
image

vi. Then, you can apply the new config

tip/wlan-ap$ cd openwrt
tip/wlan-ap/openwrt$ ./scripts/gen_config.py edgecore_eap101

vii. And the .config file will contain

CONFIG_PACKAGE_wwan=y

Build specific package
Now that wwan is included in the config, you can find ‘wwan’ in the package/ directory

tip/wlan-ap/openwrt$ package/network/utils/wwan

To build this package

tip/wlan-ap/openwrt$ package/network/utils/wwan/{clean,compile} V=s -j1

Add a customized Package
For customized packages that are not available in OpenWRT.
i. We can create a new directory which will contain customized packages in feeds/ directory

tip/wlan-ap$ cd feeds
tip/wlan-ap/feeds$ mkdir my-packages

ii. Now create a directory ‘package01_dir’ which can contain necessary files for the package ‘package01’

tip/wlan-ap/feeds$ cd my-packages
tip/wlan-ap/feeds/my-packages$ mkdir package01_dir

iii. Add a new package to the directory ‘package01_dir’
• Need 3 files or directories: Makefile, files, src
Makefile: Most important; it provides the steps required to compile the package
files directory is optional. Typically includes default config or init files
src contains the source code

For more details, refer to [OpenWrt Wiki] Creating packages

For example, copy source code to

feeds/my-packages/package01_dir/package01/src/

Create Makefile

feeds/my-packages/package01_dir/package01/Makefile

Create init script (package01.init) in

feeds/my-packages/package01_dir/package01/src/files/

iv. Accordingly, modify profiles/edgecore_eap101.yml by adding ‘package01’ to the package list and also add it’s path to the feeds section
feeds:

  • name: package01_dir
    path: …/…/feeds/my-packages/package01_dir
    packages:
  • package01

v. And in openwrt/feeds.conf, add the following

src-link package01_dir …/…/feeds/my-packages/package01_dir