Skip to content

Commit

Permalink
update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
arix00 committed Oct 14, 2024
1 parent 3d136cc commit 3138184
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build_mx4300_nss.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- name: Release
uses: ncipollo/release-action@v1
with:
tag: qualcommax-nss-${{ env.SHA }}
artifacts: release/*
bodyFile: note.md
16 changes: 16 additions & 0 deletions genconfig_nss.sh
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions release_nss.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3138184

Please sign in to comment.