diff options
| -rw-r--r-- | openwrt/BUILDING.md | 74 | ||||
| -rw-r--r-- | openwrt/Makefile | 52 | ||||
| -rw-r--r-- | openwrt/menuconfig-network.png | bin | 0 -> 75002 bytes | |||
| -rw-r--r-- | openwrt/menuconfig-networkQuality.png | bin | 0 -> 253485 bytes |
4 files changed, 126 insertions, 0 deletions
diff --git a/openwrt/BUILDING.md b/openwrt/BUILDING.md new file mode 100644 index 0000000..a50735e --- /dev/null +++ b/openwrt/BUILDING.md @@ -0,0 +1,74 @@ +# Building for OpenWRT + +## Prerequisites + +It is, unfortunately, necessary that you are aware of most (if not all) of the subtleties of the OpenWRT build system to complete this process. For additional information on that process, check out their extensive build system documentation online [here](https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem) and [here](https://openwrt.org/docs/guide-developer/toolchain/buildsystem_essentials). + +In this documentation, it is assumed that your OpenWRT source tree exists in `${OPENWRT_SRC}`. + +Finally, before building you will want to make sure that you have configured building the version of this client that you want. The version is selected by commit hash and you can customize that by changing the `PKG_SOURCE_VERSION` variable in the `Makefile`. + +### Caveats + +One of the things that seems to cause problems is that the steps for preparing the build system are scattered throughout the documentation. One of the easy-to-miss steps is + +```console +$ make target +$ make target/install +``` + +It seems like [this](https://openwrt.org/docs/guide-developer/helloworld/chapter1) documentation would be good to merge with the documentation on the build system, but ... + +If/when you attempt to build a different version of the client (i.e., when you change the `PKG_SOURCE_VERSION` in `Makefile` ), you can force the new version to be fetched by + +```console +$ rm -f ${OPENWRT_SRC}/networkQuality* +``` + +The OpenWRT build system caches the source and does not seem to handle well changing the `PKG_SOURCE_VERSION`. There is probably an easier way to do this cache reset, but ... + +## Create Files + +The driver (in the non-technical sense) of this entire process is a goresponsiveness-specific Makefile that will build the package. In order for the OpenWRT Build System to register that there is a new package, we have to put a `Makefile` in the proper spot. + +1. Make a directory name `networkQuality` in `${OPENWRT_SRC}/feeds/packages/net/`. + +Then + +2. Move (or, better yet, symbolically link) the `Makefile` in this directory to that newly created directory. + +## Update the Feeds + +Next, we have to update the build system's configuration so that it recognizes that the `networkQuality` package is now something that can be built. To do this, run + +```console +$ make menuconfig +``` + +## Select networkQuality To Be Built + +In `menuconfig`, navigate to `networkQuality` and select it to be built _as a module_. Building as a module means that you will get an `ipkg` that is easier to move between OpenWRT installations. + +The `networkQuality` package is under `Network`: + + + +To configure it to build as a module, you will want the space between the `<` and the `>` to be an `M` (indicated by the green arrow in the image below). To toggle through build types, use the space bar. Once you have configured it to build as a module, exit the configuration (indicated by the blue arrow in the image below). + + + +## Build the Package + +```console +$ make package/networkQuality/{clean,compile} +``` + +## Find the Result + +That was pretty successful, wasn't it? Now we just have to find out where the build system stuck the resulting package! And that is easier said than done! + +Depending on the target system for which you are building OpenWRT, the package that you just built will be in + +``` +${OPENWRT_SRC}/bin/packages/<target>/packages/ +```
\ No newline at end of file diff --git a/openwrt/Makefile b/openwrt/Makefile new file mode 100644 index 0000000..378eddf --- /dev/null +++ b/openwrt/Makefile @@ -0,0 +1,52 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=networkQuality +PKG_VERSION:=0.1 +PKG_RELEASE:=0.1 +PKG_MAINTAINER:=Will Hawkins ([email protected]) +PKG_LICENSE:=GPL-2.0-only + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/network-quality/goresponsiveness.git +#We can configure this once we have a hash that we want to be the source +#of the first release. See +#https://openwrt.org/docs/guide-developer/packages#use_source_repository +#for information on how to use it. +PKG_MIRROR_HASH:=skip +#Note: You will want to make sure that this hash is the one you want! +#Temporarily set the package to build from the HEAD of main. +PKG_SOURCE_VERSION:=af7dd5fa1e683be9bc25dce18c339ed07eaef215 + +PKG_BUILD_DEPENDS=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 + +GO_PKG:=github.com/network-quality/goresponsiveness +GO_PKG_LDFLAGS_X:=main.version=$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/networkQuality + SECTION:=net + CATEGORY:=Network + TITLE:=Responsiveness Under Working Conditions client + DEPENDS:=$(GO_ARCH_DEPENDS) +endef + +define Package/networkQuality/description + Official open-source client for the Responsiveness Under Working Conditions IETF spec. +endef + +define Package/networkQuality/install + $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) + + #Because we cannot control the `go build` invocation to get a + #executable name that we want, let's do this little workaround + #to make sure that our binary is named `networkQuality`! + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/goresponsiveness $(1)/usr/bin/networkQuality +endef + +$(eval $(call GoBinPackage,networkQuality)) +$(eval $(call BuildPackage,networkQuality)) diff --git a/openwrt/menuconfig-network.png b/openwrt/menuconfig-network.png Binary files differnew file mode 100644 index 0000000..ce49d7f --- /dev/null +++ b/openwrt/menuconfig-network.png diff --git a/openwrt/menuconfig-networkQuality.png b/openwrt/menuconfig-networkQuality.png Binary files differnew file mode 100644 index 0000000..e7078ea --- /dev/null +++ b/openwrt/menuconfig-networkQuality.png |
