From 3138184c96ce4ac341e2c32a8474f15aba28070d Mon Sep 17 00:00:00 2001 From: arix00 <15333224+arix00@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:35:41 -0700 Subject: [PATCH] update build script --- .github/workflows/build_mx4300_nss.yml | 59 ++++++++++++++++++++++++++ genconfig_nss.sh | 16 +++++++ release_nss.sh | 24 +++++++++++ 3 files changed, 99 insertions(+) create mode 100644 .github/workflows/build_mx4300_nss.yml create mode 100644 genconfig_nss.sh create mode 100644 release_nss.sh diff --git a/.github/workflows/build_mx4300_nss.yml b/.github/workflows/build_mx4300_nss.yml new file mode 100644 index 00000000000000..014ef618fd1986 --- /dev/null +++ b/.github/workflows/build_mx4300_nss.yml @@ -0,0 +1,59 @@ +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-setuptools \ + 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: Prepare release + run: sh release_nss.sh + + - name: Get SHA + uses: benjlevesque/short-sha@v3.0 + + - name: Release + uses: ncipollo/release-action@v1 + with: + tag: qualcommax-nss-${{ env.SHA }} + artifacts: release/* + bodyFile: note.md diff --git a/genconfig_nss.sh b/genconfig_nss.sh new file mode 100644 index 00000000000000..f6185265ec681c --- /dev/null +++ b/genconfig_nss.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +echo > .config + +cat nss-setup/config-nss.seed | grep -v CONFIG_PACKAGE_luci >> .config +echo " +CONFIG_TARGET_qualcommax_ipq807x_DEVICE_linksys_mx4300=y +CONFIG_PACKAGE_luci=y +CONFIG_FEED_nss_packages=n" >> .config +make defconfig + +if [ "$1" = "full" ]; then + kmods=$(wget -qO- https://downloads.openwrt.org/snapshots/targets/qualcommax/ipq807x/packages/Packages.manifest | grep "Package: kmod" | grep -v ath | grep -v kmod-bonding | grep -v vxlan | grep -v kmod-nat46 | cut -d ' ' -f 2) + for k in $kmods; do grep -q $k=y .config || echo CONFIG_PACKAGE_$k=m >> .config; done + make defconfig +fi diff --git a/release_nss.sh b/release_nss.sh new file mode 100644 index 00000000000000..42d7a2bf31e481 --- /dev/null +++ b/release_nss.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +mkdir kmods +cp bin/targets/qualcommax/ipq807x/packages/Packages* kmods +cp bin/targets/qualcommax/ipq807x/packages/kmod-* kmods +tar cfz kmods.tar.gz kmods/ + +MD="note.md" +mkdir release +cp bin/targets/qualcommax/ipq807x/openwrt-qualcommax-ipq807x-linksys_mx4300-* release/ +cp bin/targets/qualcommax/ipq807x/openwrt-qualcommax-ipq807x-linksys_mx4300.manifest release/ +cp kmods.tar.gz release/ + +kernel=$(cat release/openwrt-qualcommax-ipq807x-linksys_mx4300.manifest | grep ^kernel | cut -d '~' -f 1) +checksum=$(sha256sum release/* | sed 's/release\///') +#echo $checksum +echo "- $kernel + +- sha256sum +\`\`\` +$checksum +\`\`\` + +- [use kmods](https://github.com/arix00/openwrt-mx4300/blob/doc/nss-kmods.md)" > $MD