/openwrt-package-builder

dockerized OpenWrt-Package-Builder scripts for Linux, Windows 10 and macOS

Primary LanguageShellMIT LicenseMIT

dockerized OpenWrt Package-Builder script

Description

The package-builder script builder.sh/.ps1 will setup, compile and can patch, host openwrt packages from official or custom openwrt feeds, via a config .txt file. It handles all task's automatically and only requires editing/creating the config files.

Features

  • fully isolated build environment, utilizing Docker for Linux, Windows and Mac
  • automatic setup of a openwrt package build environment, via official sdk
  • automatic management/update of sdk versions to compile against ('18.06.0', '18.06.x', '19.07.0-rc1', 'snapshots')
  • automatic patch support via locally provided patches or github PR numbers in config
  • local feed support
  • ability to locally host the build packages via a tiny webserver
  • debug support, via config options or manual shell access into the docker containers

Requirements

ALL Versions:

Windows:

  • Virtualisation capable CPU and enabled in Bios (Intel VT or AMD-V)
  • Windows 10 Pro, Enterprise and Education, (Build > 1607)
  • requirements can be tested via .\builder.ps1

Mac:

  • Virtualisation capable CPU and enabled in Bios (Intel VT or AMD-V)
  • macOS El Capitan 10.11 and newer

Installation

  • install Docker for your system Win, Mac, Linux
    For quick installation on Linux try the official Docker convenience script.
  • Get/unpack the script via release page (zip/tar) or git clone https://github.com/Andy2244/openwrt-package-builder.git

Windows: it is recommend to use Docker in 'LCOW' mode, to-do so: - check use Windows Containers instead of Linux Containers during installation or Switch to Windows Containers via docker tray - enable Experimental features via Docker tray Settings/Daemon UPDATE: The powershell script should work in normal and WSL1/2 mode, but are untested.

Mac:

  • macOS might ask multiple times per run for your SUDO password, thats because the default SUDO timeout is 5 minutes, which can be changed to 30 minutes via:
    sudo sh -c 'echo "\nDefaults timestamp_timeout=30">>/etc/sudoers'

Useage

  • check the examples and create a config file for your router/sdk
  • make sure VERSION, TARGET, SUBTARGET matches your router's firmware
  • Check your routers openwrt firmware UI '/System/Software/Configuration/Distribution feeds' to confirm values
  • start Docker

Linux, Mac (shell):

make script executeable
chmod +x builder.sh

build your config
./builder.sh build [config].txt

host the results localy, for easy luci-ui installation
./builder.sh host [config].txt

Windows (Admin Powershell):

build your config
.\builder.ps1 build [config].txt

host the results localy, for easy luci-ui installation
.\builder.ps1 host [config].txt

Notes

  • you can speed-up the build process by re-using a previously setup/updated environment via build_quick. This will not perform any updates
  • the cleanall command will remove all existing package-builder Docker containers and outdated images, freeing up space

Advanced config Options

Limitations