From d3ad601996f0ec42613b19bac3cecb16cc618fc6 Mon Sep 17 00:00:00 2001 From: arix00 <15333224+arix00@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:42:27 -0700 Subject: [PATCH] build script --- .github/workflows/build_mx4300_nss.yml | 58 ++++++++++++++++++++++++++ genconfig_nss.sh | 13 ++++++ pack_kmod.sh | 6 +++ 3 files changed, 77 insertions(+) create mode 100644 .github/workflows/build_mx4300_nss.yml create mode 100644 genconfig_nss.sh create mode 100644 pack_kmod.sh diff --git a/.github/workflows/build_mx4300_nss.yml b/.github/workflows/build_mx4300_nss.yml new file mode 100644 index 00000000000000..27c19cf378b94e --- /dev/null +++ b/.github/workflows/build_mx4300_nss.yml @@ -0,0 +1,58 @@ +name: nss build with kmod + +on: workflow_dispatch + +jobs: + build: + name: nss build with kmod + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Install packages + run: | + sudo apt-get update && \ + sudo apt-get install -y \ + build-essential \ + clang \ + flex \ + bison \ + g++ \ + gawk \ + gcc-multilib \ + g++-multilib \ + gettext \ + git \ + libncurses-dev \ + libssl-dev \ + python3-distutils \ + rsync \ + unzip \ + zlib1g-dev \ + file \ + wget && \ + sudo apt-get clean + + - name: Checkout + uses: actions/checkout@v4 + + - name: Update feed + run: scripts/feeds update -a && scripts/feeds install -a + + - name: Generate config with extra kmod + run: sh genconfig_nss.sh full + + - name: Build firmware images + run: make -j$(($(nproc)+1)) world + + - name: Pack packages + run: sh pack_kmod.sh + + - name: Get SHA + uses: benjlevesque/short-sha@v2.2 + + - name: Release + uses: ncipollo/release-action@v1 + with: + tag: qualcommax-nss-${{ env.SHA }} + artifacts: bin/targets/qualcommax/ipq807x/openwrt-qualcommax-ipq807x-*, kmod.tar.gz diff --git a/genconfig_nss.sh b/genconfig_nss.sh new file mode 100644 index 00000000000000..35dc89c880a5a8 --- /dev/null +++ b/genconfig_nss.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +cat nss-setup/config-nss.seed | grep -v luci- > .config +echo CONFIG_FEED_nss_packages=n >> .config +make defconfig + + +if [ "$1" = "full" ]; then + kmods=$(wget -qO- https://downloads.openwrt.org/snapshots/targets/qualcommax/ipq807x/packages/ | grep kmod- | grep -v ath | grep -v mt7 | awk -F'<|>' '{print $7}' | cut -d '_' -f 1) + for k in $kmods; do grep -q $k=y .config || echo CONFIG_PACKAGE_$k=m >> .config; done + make defconfig +fi + diff --git a/pack_kmod.sh b/pack_kmod.sh new file mode 100644 index 00000000000000..8c4903c61a25b3 --- /dev/null +++ b/pack_kmod.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +mkdir kmod +cp bin/targets/qualcommax/ipq807x/packages/Packages* kmod +cp bin/targets/qualcommax/ipq807x/packages/kmod-* kmod +tar cfz kmod.tar.gz kmod/