Browse Source

Add quicker OpenWrt build to regular builds.

Use the upstream build environment to speed up the compiling of OpenWrt
ipk packages.  (And minor doc updates after running this.
pull/1076/head
Hamish Coleman 2 years ago
parent
commit
40f4b04bb2
  1. 80
      .github/workflows/tests.yml
  2. 18
      .gitignore
  3. 7
      packages/openwrt/README.md
  4. 11
      packages/openwrt/config.bthh5a
  5. 7
      packages/openwrt/config.n2n
  6. 5
      packages/openwrt/config.x86

80
.github/workflows/tests.yml

@ -404,6 +404,84 @@ jobs:
name: packages-rpm name: packages-rpm
path: rpmbuild/RPMS/x86_64/*.rpm path: rpmbuild/RPMS/x86_64/*.rpm
package_ipk:
name: Package for OpenWrt
needs:
- test_linux
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- name: bthh5a
sdk: https://downloads.openwrt.org/releases/22.03.3/targets/lantiq/xrx200/openwrt-sdk-22.03.3-lantiq-xrx200_gcc-11.2.0_musl.Linux-x86_64.tar.xz
- name: x86
sdk: https://downloads.openwrt.org/releases/22.03.3/targets/x86/generic/openwrt-sdk-22.03.3-x86-generic_gcc-11.2.0_musl.Linux-x86_64.tar.xz
defaults:
run:
working-directory: openwrt
steps:
- name: Get sdk
run: |
wget ${{ matrix.sdk }} -O openwrt-sdk.tar.xz
tar xf openwrt-sdk.tar.xz
mv openwrt-sdk-* openwrt
working-directory: ./
- name: Checkout n2n
uses: actions/checkout@v3
with:
path: n2n
fetch-depth: 0
- name: Fix Checkout
run: |
git fetch --force --tags
working-directory: n2n
- name: Copy n2n package definition into openwrt
run: |
cp -r n2n/packages/openwrt openwrt/package/n2n
working-directory: ./
- name: Configure OpenWrt
run: |
make defconfig
- name: Build n2n openwrt packages
run: |
export N2N_PKG_VERSION=$(../n2n/scripts/version.sh)
echo "Build for $N2N_PKG_VERSION"
make package/n2n/clean V=s
make package/n2n/prepare USE_SOURCE_DIR=$GITHUB_WORKSPACE/n2n V=s
make package/n2n/compile V=s
# FIXME: add a way to run the test suite!
# - name: Run embedded tests
# run: make test
- name: Save config used
if: always()
run: |
cp openwrt/.config config.${{ matrix.name }}
working-directory: ./
- name: Upload config file used for build
if: always()
uses: actions/upload-artifact@v3
with:
name: openwrt-config
path: config.*
- name: Upload ipk
uses: actions/upload-artifact@v3
with:
name: packages-ipk
path: openwrt/bin/packages/*/base/*.ipk
binaries_windows: binaries_windows:
name: Binaries for Windows (x86_64-pc-mingw64) name: Binaries for Windows (x86_64-pc-mingw64)
needs: needs:
@ -605,6 +683,7 @@ jobs:
needs: needs:
- package_dpkg - package_dpkg
- package_rpm - package_rpm
- package_ipk
- binaries_windows - binaries_windows
- binaries_macos - binaries_macos
- binaries_macos_universal - binaries_macos_universal
@ -643,3 +722,4 @@ jobs:
files: | files: |
artifacts/packages-dpkg/*.deb artifacts/packages-dpkg/*.deb
artifacts/packages-rpm/*.rpm artifacts/packages-rpm/*.rpm
artifacts/packages-ipk/*/base/*.pkg

18
.gitignore

@ -2,7 +2,11 @@
*.a *.a
*.gz *.gz
configure configure
config.* config.log
config.rpath
config.status
include/config.h
include/config.h.in
/Makefile /Makefile
tools/Makefile tools/Makefile
autom4te.cache autom4te.cache
@ -53,3 +57,15 @@ coverage/
*.indent *.indent
*.unc-backup.md5~ *.unc-backup.md5~
*.unc-backup~ *.unc-backup~
# Empty files created by the openwrt build
/.built
/.built_check
/.configured_*
/.prepared
/.quilt_checked
/.source_dir
/ABOUT-NLS
/AUTHORS
/ChangeLog
/NEWS

7
packages/openwrt/README.md

@ -36,13 +36,16 @@ the n2n repository.
git clone https://github.com/ntop/n2n n2n git clone https://github.com/ntop/n2n n2n
N2N_PKG_VERSION=$(n2n/scripts/version.sh) N2N_PKG_VERSION=$(n2n/scripts/version.sh)
export N2N_PKG_VERSION export N2N_PKG_VERSION
echo $N2N_PKG_VERSION
cp -r n2n/packages/openwrt openwrt/package/n2n cp -r n2n/packages/openwrt openwrt/package/n2n
cd openwrt cd openwrt
make menuconfig # select Network -> VPN -> n2n-edge and n2n-supernode make oldconfig
# In the VPN section, select "m" for n2n-edge and n2n-supernode
make package/n2n/clean V=s make package/n2n/clean V=s
make package/n2n/prepare USE_SOURCE_DIR=../n2n V=s make package/n2n/prepare USE_SOURCE_DIR=$(realpath ../n2n) V=s
make package/n2n/compile V=s make package/n2n/compile V=s
``` ```

11
packages/openwrt/config.bthh5a

@ -0,0 +1,11 @@
# OpenWrt Configuration snippet
# - will enable building for BT Home Hub 5a
#
CONFIG_TARGET_lantiq=y
CONFIG_TARGET_lantiq_xrx200=y
CONFIG_TARGET_lantiq_xrx200_DEVICE_bt_homehub-v5a=y
# Would be needed for a full standalone build, but are packages that should
# be available from the distributed openwrt build repository
# CONFIG_PACKAGE_kmod-tun=m
# CONFIG_PACKAGE_libcap=m

7
packages/openwrt/config.n2n

@ -0,0 +1,7 @@
# OpenWrt Configuration snippet
# - will enable building the N2N packages
#
CONFIG_TARGET_lantiq=y
CONFIG_TARGET_lantiq_xrx200=y
CONFIG_TARGET_lantiq_xrx200_DEVICE_bt_homehub-v5a=y

5
packages/openwrt/config.x86

@ -0,0 +1,5 @@
# OpenWrt Configuration snippet
# - will enable building on x86 target (mainly for build tests)
#
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_64=y
Loading…
Cancel
Save