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.
This commit is contained in:
Hamish Coleman 2023-01-29 18:51:26 +00:00
parent 99ae88c85b
commit 40f4b04bb2
6 changed files with 125 additions and 3 deletions

View File

@ -404,6 +404,84 @@ jobs:
name: packages-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:
name: Binaries for Windows (x86_64-pc-mingw64)
needs:
@ -605,6 +683,7 @@ jobs:
needs:
- package_dpkg
- package_rpm
- package_ipk
- binaries_windows
- binaries_macos
- binaries_macos_universal
@ -643,3 +722,4 @@ jobs:
files: |
artifacts/packages-dpkg/*.deb
artifacts/packages-rpm/*.rpm
artifacts/packages-ipk/*/base/*.pkg

18
.gitignore vendored
View File

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

View File

@ -36,13 +36,16 @@ the n2n repository.
git clone https://github.com/ntop/n2n n2n
N2N_PKG_VERSION=$(n2n/scripts/version.sh)
export N2N_PKG_VERSION
echo $N2N_PKG_VERSION
cp -r n2n/packages/openwrt openwrt/package/n2n
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/prepare USE_SOURCE_DIR=../n2n V=s
make package/n2n/prepare USE_SOURCE_DIR=$(realpath ../n2n) V=s
make package/n2n/compile V=s
```

View File

@ -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

View File

@ -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

View File

@ -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