Skip to content

Commit

Permalink
update build script for apk
Browse files Browse the repository at this point in the history
  • Loading branch information
arix00 committed Nov 17, 2024
1 parent fa06d08 commit c469d48
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build_mx4300_foss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
unzip \
zlib1g-dev \
file \
jq \
wget && \
sudo apt-get clean
Expand All @@ -39,20 +40,20 @@ jobs:
run: scripts/feeds update -a && scripts/feeds install -a

- name: Generate config
run: sh genconfig.sh
run: sh genconfig.sh snapshots

- name: Build firmware images
run: make -j$(($(nproc)+1)) world

- name: Prepare release
run: sh release.sh
run: sh release.sh ${{ env.ver }}

- name: Get SHA
uses: benjlevesque/[email protected]

- name: Release
uses: ncipollo/release-action@v1
with:
tag: qualcommax-foss-${{ env.SHA }}
tag: qualcommax-foss-${{ env.ver }}-${{ env.SHA }}
artifacts: release/*
bodyFile: note.md
14 changes: 11 additions & 3 deletions genconfig.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/sh

wget -qO- https://downloads.openwrt.org/snapshots/targets/qualcommax/ipq807x/config.buildinfo | grep -v CONFIG_TARGET_DEVICE_ | grep -v CONFIG_TARGET_ALL_PROFILES | grep -v CONFIG_TARGET_MULTI_PROFILE > .config
if [ ! -z "$1" ] && [ "$1" != "snapshots" ]; then
buildinfo="https://downloads.openwrt.org/releases/$1/targets/qualcommax/ipq807x/config.buildinfo"
echo "ver=$1" >> $GITHUB_ENV
else
buildinfo="https://downloads.openwrt.org/snapshots/targets/qualcommax/ipq807x/config.buildinfo"
echo "ver=snapshots" >> $GITHUB_ENV
fi

wget -qO- $buildinfo | grep -v CONFIG_TARGET_DEVICE_ | grep -v CONFIG_TARGET_ALL_PROFILES | grep -v CONFIG_TARGET_MULTI_PROFILE > .config
echo CONFIG_TARGET_ALL_PROFILES=n >> .config
echo CONFIG_TARGET_MULTI_PROFILE=n >> .config
echo CONFIG_TARGET_qualcommax_ipq807x_DEVICE_linksys_mx4300=y >> .config
Expand All @@ -14,6 +22,6 @@ make defconfig
#echo CONFIG_PACKAGE_libpam=y >> .config

#skip xdp compile
cat .config | grep -v "CONFIG_PACKAGE.*xdp" > .config.tmp
cp .config.tmp .config
#cat .config | grep -v "CONFIG_PACKAGE.*xdp" > .config.tmp
#cp .config.tmp .config

29 changes: 24 additions & 5 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,36 @@

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 bin/targets/qualcommax/ipq807x/openwrt-qualcommax-ipq807x-linksys_mx4300-* release/
cp bin/targets/qualcommax/ipq807x/openwrt-qualcommax-ipq807x-linksys_mx4300.manifest release/
cp bin/targets/qualcommax/ipq807x/openwrt-imagebuilder* release/
kernel=$(cat release/openwrt-qualcommax-ipq807x-linksys_mx4300.manifest | grep ^kernel)
checksum=$(sha256sum release/* | sed 's/release\///')
#echo $checksum
echo "- $kernel

if grep -q "CONFIG_USE_APK=y" .config ; then
errmsg="ERROR: unable to select packages"
mdfile="foss-kmod-apk.md"
warning="APK package manager"
echo "pkg=apk" >> $GITHUB_ENV
else
errmsg="pkg_hash_check_unresolved: cannot find dependency kernel"
mdfile="foss-kmod-opkg.md"
warning="OPKG package manager"
echo "pkg=opkg" >> $GITHUB_ENV
fi

echo "- $warning
- $kernel
- sha256sum
\`\`\`
$checksum
\`\`\`
\`\`\`" > $MD

if [ "$1" = "snapshots" ]; then
echo "
- \"$errmsg\" [fix](https://github.com/arix00/openwrt-mx4300/blob/doc/$mdfile)" >> $MD
fi

- \"pkg_hash_check_unresolved: cannot find dependency kernel\" [fix](https://github.com/arix00/openwrt-mx4300/blob/doc/snapshot-dependency-guide.md)" > $MD

0 comments on commit c469d48

Please sign in to comment.