====== OpenWRT 19.07.x for RouterBOARD 750Gr3 ====== ===== Introduction ===== * We created this page for the 19.07 release of OpenWRT since the CoovaChilli that comes standard included with this release of OpenWRT **DOES NOT INCLUDE** the JSON Interface (Utilised by RADIUSdesk). * Our instructions here will help you build your own built of OpenWRT which will include CoovaChilli that has the support for the JSON interface included. ===== Prepare the system ===== * We assume you have a standard install of Ubuntu 18.04 or Ubuntu 20.04 * Install the required packages to ensure the SDK can build the firmware sudo apt-get update sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl unzip mercurial ===== Create the location for the SDK ===== * Our suggestion is to create a folder that will indicate the version of the firmware you'll be building. * Here we create a folder for the 19.07.6 release (The latest for the 19.07 branch). # Create the working directory mkdir 19.07.6 # Change to our working directory cd 19.07.6 ===== Checkout the SDK ===== * Do a clean checkout of the OpenWRT repository git clone https://git.openwrt.org/openwrt/openwrt.git * This repository has various branches. To see which branches are available and which one we are currently set to use, issue the following command. #We may first need to change our directory to the openwrt directory cd openwrt git branch -a #Also to see the tags git tag -l * We will be checking out the v19.07.6 tag. git checkout v19.07.6 * Confirm that this **v19.07.6** is now checked out. git branch * Update the package feeds ./scripts/feeds update ===== Install the required packages ===== * Ensure the following packages are installed since they are required by the firmware ./scripts/feeds install coova-chilli ./scripts/feeds install luci ./scripts/feeds install luci-theme-material ===== Tweak CoovaChilli to include support for JSON ===== * We will borrow some things from the config files inside the the master branch of OpenWRT to include the option for the JOSN interface when configuring the firmware before building it. * Edit the **openwrt/feeds/packages/net/coova-chilli/Config.in** to look like this (Repalce with this file) # CoovaChilli advanced configuration if PACKAGE_coova-chilli config COOVACHILLI_PROXY bool "Enable support for chilli proxy. Required for AAA Proxy through http" default n config COOVACHILLI_REDIR bool "Enable support for redir server. Required for uamregex" default n config COOVACHILLI_MINIPORTAL bool "Enable support Coova miniportal" default n config COOVACHILLI_USERAGENT bool "Enable recording user-agent" default n config COOVACHILLI_UAMDOMAINFILE bool "Enable loading of mass uamdomains from file" default n config COOVACHILLI_LARGELIMITS bool "Enable larger limits for use with non-embedded systems" default n config COOVACHILLI_JSONINTERFACE bool "Enable the JSON interface for the CoovaChilli Controller" default n choice prompt "SSL library" default COOVACHILLI_NOSSL config COOVACHILLI_NOSSL bool "No SSL support" config COOVACHILLI_WOLFSSL bool "wolfSSL" config COOVACHILLI_OPENSSL bool "OpenSSL" endchoice endif * Edit the **openwrt/feeds/packages/net/coova-chilli/Makefile** to look like this (Replace existing one) # # Copyright (C) 2007-2018 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk PKG_NAME:=coova-chilli PKG_VERSION:=1.4 PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/coova/coova-chilli/tar.gz/$(PKG_VERSION)? PKG_HASH:=987647a4c8efe7b1e2d7108d56068e3bd7830d326680f0eaa2c705e4c59c46d9 PKG_MAINTAINER:=Jaehoon You PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=0 PKG_CONFIG_DEPENDS:= \ COOVACHILLI_JSONINTERFACE \ COOVACHILLI_LARGELIMITS \ COOVACHILLI_MINIPORTAL \ COOVACHILLI_NOSSL \ COOVACHILLI_OPENSSL \ COOVACHILLI_PROXY \ COOVACHILLI_REDIR \ COOVACHILLI_UAMDOMAINFILE \ COOVACHILLI_USERAGENT \ COOVACHILLI_WOLFSSL \ IPV6 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/kernel.mk define Package/coova-chilli SUBMENU:=Captive Portals SECTION:=net CATEGORY:=Network DEPENDS:=+kmod-tun +librt +COOVACHILLI_MINIPORTAL:haserl \ +COOVACHILLI_WOLFSSL:libwolfssl +COOVACHILLI_OPENSSL:libopenssl \ +COOVACHILLI_JSONINTERFACE:libjson-c TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version) URL:=https://coova.github.io/ MENU:=1 endef define Package/coova-chilli/description CoovaChilli is an open source access controller for wireless LAN access points and is based on ChilliSpot. It is used for authenticating users of a wireless (or wired) LAN. It supports web based login (UAM) which is today's standard for public HotSpots and it supports Wireless Protected Access (WPA) which is the standard of the future. Authentication, authorization and accounting (AAA) is handled by your favorite radius server. endef define Package/coova-chilli/config source "$(SOURCE)/Config.in" endef define KernelPackage/ipt-coova URL:=http://www.coova.org/CoovaChilli SUBMENU:=Netfilter Extensions DEPENDS:=coova-chilli +kmod-ipt-core +libxtables TITLE:=Coova netfilter module FILES:=$(PKG_BUILD_DIR)/src/linux/xt_*.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoProbe,xt_coova) endef define KernelPackage/ipt-coova/description Netfilter kernel module for CoovaChilli Includes: - coova endef DISABLE_NLS= TARGET_CFLAGS += $(FPIC) -Wno-error CONFIGURE_VARS += \ ARCH="$(LINUX_KARCH)" \ KERNEL_DIR="$(LINUX_DIR)" MAKE_FLAGS += \ ARCH="$(LINUX_KARCH)" \ KERNEL_DIR="$(LINUX_DIR)" MAKE_INSTALL_FLAGS += \ ARCH="$(LINUX_KARCH)" \ KERNEL_DIR="$(LINUX_DIR)" \ INSTALL_MOD_PATH="$(PKG_INSTALL_DIR)" define Build/Prepare $(call Build/Prepare/Default) ( cd $(PKG_BUILD_DIR) ; \ [ -f ./configure ] || { \ ./bootstrap ; \ } \ ) endef define Build/Configure $(call Build/Configure/Default, \ $(if $(CONFIG_COOVACHILLI_PROXY),--enable,--disable)-chilliproxy \ $(if $(CONFIG_COOVACHILLI_REDIR),--enable,--disable)-chilliredir \ $(if $(CONFIG_COOVACHILLI_MINIPORTAL),--enable,--disable)-miniportal \ $(if $(CONFIG_COOVACHILLI_USERAGENT),--enable,--disable)-useragent \ $(if $(CONFIG_COOVACHILLI_LARGELIMITS),--enable,--disable)-largelimits \ $(if $(CONFIG_COOVACHILLI_JSONINTERFACE),--enable,--disable)-libjson \ $(if $(CONFIG_COOVACHILLI_JSONINTERFACE),--enable,--disable)-json \ $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \ $(if $(CONFIG_IPV6),--with,--without)-ipv6 \ $(if $(CONFIG_COOVACHILLI_WOLFSSL),--with,--without)-cyassl \ $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \ $(if $(CONFIG_PACKAGE_kmod-ipt-coova),--with-nfcoova) \ ) endef define Package/coova-chilli/conffiles /etc/config/chilli endef define Package/coova-chilli/install $(INSTALL_DIR) $(1)/etc $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/ $(INSTALL_DIR) $(1)/etc/chilli $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/ $(INSTALL_DIR) $(1)/etc/hotplug.d/iface $(INSTALL_DATA) ./files/chilli.hotplug $(1)/etc/hotplug.d/iface/30-chilli $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ $(if $(CONFIG_PACKAGE_kmod-ipt-coova), \ $(INSTALL_DIR) $(1)/usr/lib/iptables; \ $(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib*.so $(1)/usr/lib/iptables/ \ ) $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) files/chilli.init $(1)/etc/init.d/chilli $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DATA) files/chilli.config $(1)/etc/config/chilli endef $(eval $(call BuildPackage,coova-chilli)) $(eval $(call KernelPackage,ipt-coova)) ===== Select target system and model ===== * Under the **openwrt** folder type: make menuconfig * For **Target System** select **MediaTek Ralink MIPS** * For **Subtarget** select **MT7621based boards** * For **Profile** select **Mikrotik RouterBOARD 750Gr3** Next we will select the packages to include ===== Select required packages ===== * The default package selection by OpenWRT is pretty good to get a standard working firmware done. * We will do the following additional selections ^ Package ^ Location ^ Comment ^ | coova-chilli | Network -> Captive Portals | Select **Enable the JSON interface for the CoovaChilli Controller**, **Enable support Coova miniportal** and **OpenSSL** as **SSL Library** | | luci | Luci -> Collections | Required for web management | | luci-theme-material | Luci -> Themes | Modern theme as a nice-to-have | * After that you can save and exit ===== Kick off the built ===== * Everything is now in place to start the firmware built * Enter the following under the **openwrt** folder make * If the build completes with success it will be located here: ls -l bin/targets/ramips/mt7621/ total 9412 -rw-r--r-- 1 system system 1590 Feb 16 15:39 config.buildinfo -rw-r--r-- 1 system system 343 Feb 16 15:39 feeds.buildinfo -rw-r--r-- 1 system system 3196 Feb 16 15:41 openwrt-ramips-mt7621-device-mikrotik-rb750gr3.manifest -rwxr-xr-x 1 system system 4692436 Feb 16 15:41 openwrt-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin -rw-r--r-- 1 system system 4915980 Feb 16 15:41 openwrt-ramips-mt7621-mikrotik_rb750gr3-squashfs-sysupgrade.bin drwxr-xr-x 2 system system 4096 Feb 16 15:40 packages -rw-r--r-- 1 system system 628 Feb 16 15:41 sha256sums -rw-r--r-- 1 system system 18 Feb 16 15:39 version.buildinfo