Skip to content

Manually building the package

alex-massa edited this page Jun 18, 2024 · 1 revision

The following steps are derived from the "Hello, world!" for OpenWrt guide.

  1. Prepare a local OpenWrt build system environment.
    If you are not running a compatible GNU/Linux environment or would rather avoid cluttering your local environment, a virtual machine or even a container should work just as fine.

  2. Clone the OpenWrt repository in a directory named source, then checkout the branch corresponding to the version of OpenWrt you are running on your target device (as of May 2024, the latest stable release is v23.05.3):

    git clone https://git.openwrt.org/openwrt/openwrt.git source
    cd source
    git checkout v23.05.3
    make distclean
  3. Clone this repository in a directory named mypackages, which should be a sibling of the source directory:

    git clone https://github.com/alex-massa/ifmqtoggle $(dirname $(pwd))/mypackages/ifmqtoggle
  4. Define a new package feed, update all package feeds, then install the packages from the newly created feed:

    echo "src-link mypackages $(dirname $(pwd))/mypackages" >> feeds.conf.default
    ./scripts/feeds update -a
    ./scripts/feeds install -a -p mypackages
  5. Configure the cross-compilation environment for the target device:

    make menuconfig
    • From the menu, chose the values for Target System, Subtarget, and Target Profile that are suitable for your target device.
      The correct values can usually be inferred by checking the content of /etc/openwrt_release on the target device.
    • Navigate to Network, select ifmqtoggle from the list of available packages, then use the Y key to include the package in the firmware configuration.
    • Exit the configuration menu and save the changes.

Note

The package should be installable on any OpenWrt installation regardless of the targets specified above, as long as its version is aligned to that of the present SDK, though this is not thoroughly tested.
As such, the default values for Target System, Subtarget and Target Profile should be sufficient.

  1. Build the target-independent tools and the cross-compilation toolchain (this might take some time):

    make toolchain/install
  2. Build the package:

    make package/ifmqtoggle/{clean,compile}

With the above steps completed, the package should be built in the bin/packages/<arch>/mypackages directory as a bundled archive having the .ipk extension.

Clone this wiki locally