Files
openwrt-builder/.github/workflows/bpi-r4-main_router.yaml
Daniel Pawlik 7ab228a45c Add new patch related to WED issue
Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com>
2025-10-08 09:04:32 +02:00

173 lines
6.7 KiB
YAML

---
name: BPI-R4 + main_router packages + GCC15
on:
workflow_dispatch:
env:
#
#REMOTE_REPOSITORY: danpawlik/openwrt
#REMOTE_BRANCH: main-mt76-fw
#
REMOTE_REPOSITORY: openwrt/openwrt
REMOTE_BRANCH: main
RELEASE_PREFIX: Mediatek_mt7988a_bpi-r4
jobs:
check_commits:
name: Check Commits
runs-on: ubuntu-24.04
outputs:
latest_commit_sha: ${{ steps.get_sha.outputs.latest_commit_sha }}
steps:
- name: Checkout remote repository
uses: actions/checkout@v4
with:
repository: ${{ env.REMOTE_REPOSITORY }}
ref: ${{ env.REMOTE_BRANCH }}
- name: Get the latest commit SHA
id: get_sha
run: |
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
build:
name: Build OpenWRT for BPI-R4 with BE14 and main-router packages
needs: [check_commits]
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
build-essential clang flex bison g++ gawk \
gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \
python3-setuptools rsync swig unzip zlib1g-dev file wget curl zstd \
git
sudo apt full-upgrade -y
- name: Checkout remote repository
uses: actions/checkout@v4
with:
repository: ${{ env.REMOTE_REPOSITORY }}
ref: ${{ env.REMOTE_BRANCH }}
- name: Update and install feeds
run: |
./scripts/feeds update -a
./scripts/feeds install -a
- name: Configure firmware image
run: |
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/mediatek/mt7988a/bpi-r4 > .config
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/common/main-router >> .config
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/common/snapshot >> .config
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/common/optimize >> .config
- name: Enable MLO
run: |
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/common/mlo >> .config
- name: Enable openssl
run: |
sed -i '/CONFIG_PACKAGE_wpad-mbedtls=y/d' .config
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/common/openssl >> .config
- name: Add patches for 4GB WED
run: |
mkdir -p package/kernel/mt76/patches
curl -SL https://github.com/LorenzoBianconi/mt76/commit/35bc8effe9e495ccded5d6722b299dafadce060e.patch > package/kernel/mt76/patches/999-mtk-mt76-mt7996-use-GFP_DMA32-for-page_pool.patch
curl -SL https://github.com/LorenzoBianconi/net-next/commit/93dfca902f0d79126612b8e3cc553b5d891c1f55.patch > target/linux/mediatek/patches-6.12/999-wed-dma-mask-limitation.patch
# From https://github.com/LorenzoBianconi/wireless-next/commit/3e444c68513934d47b019b236ad083c386b0d85b
- name: Copy patches for WED kernel traceback
run: |
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/patches/999-use-proper-wed-reference-in-wed-kernel.patch > target/linux/mediatek/patches-6.12/999-use-proper-wed-reference-in-wed-kernel.patch
curl -SL https://github.com/LorenzoBianconi/mt76/commit/92f22edf7fd119cde26218a7431919e4cdf1628e.patch > package/kernel/mt76/patches/999-use-proper-wed-reference-in-wed-mt76.patch
#- name: Enable wolfssl
# run: |
# sed -i '/CONFIG_PACKAGE_wpad-mbedtls=y/d' .config
# curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/common/wolfssl >> .config
#
### EEPROM FIX ###
#
## https://github.com/openwrt/mt76/pull/954
#- name: Use patch from Yukariin
# run: |
# mkdir -p package/kernel/mt76/patches
# curl -SL https://github.com/openwrt/mt76/commit/8088940ffd047a6d282a95af829562e8038f5b2d.patch > package/kernel/mt76/patches/001-Add-tx_power-check-Yukariin.patch
#
## https://github.com/openwrt/mt76/pull/968
#- name: Use patch from im-0
# run: |
# mkdir -p package/kernel/mt76/patches
# curl -SL https://github.com/openwrt/mt76/commit/aaf90b24fde77a38ee9f0a60d7097ded6a94ad1f.patch > package/kernel/mt76/patches/001-use-tx_power-from-default-fw-if-EEPROM-contains-0s-im-0.patch
#
#################
- name: Add librespeed-go
run: |
echo "CONFIG_PACKAGE_librespeed-go=y" >> .config
- name: Run defconfig
run: |
make defconfig
- name: Remove packages that are marked as modules
run: |
grep "=m" .config | grep -v 'CONFIG_PACKAGE_libustream-mbedtls=m' | while read -r line; do module=$(echo "$line" | cut -f1 -d'='); sed -i "s/^$line$/# $module is not set/" .config; done
- name: Build the firmware image
run: make -j $(nproc) defconfig download world
- name: Package output
run: tar -cvf bpi_r4-images.tar bin/targets/mediatek/filogic
- name: Add config file
run: cp .config bin/targets/mediatek/filogic/config-full
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: bpi_r4-images
path: bpi_r4-images.tar
release:
name: Create release
needs: [build, check_commits]
if: needs.build.result == 'success'
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: bpi_r4-images
- name: Extract artifacts
run: tar xf bpi_r4-images.tar
- name: Get current date
run: echo "RELEASE_DATE=$(date +%F)" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@master
with:
files: bin/targets/mediatek/filogic/*
tag_name: ${{ env.RELEASE_PREFIX }}-${{ env.REMOTE_BRANCH }}-${{ env.RELEASE_DATE }}
name: OpenWRT BPI-R4 + MLO + main_router packages + GCC15 + WED 4GB patch - ${{ env.REMOTE_BRANCH }} - ${{ env.RELEASE_DATE }}
body: |
Updated prebuilt images with main_router packages, patches for working 4GB RAM WED build with GCC14 - ${{ env.RELEASE_DATE }},
Build Commit: ${{ needs.check_commits.outputs.latest_commit_sha }}
- name: Clean up old releases
uses: dev-drprasad/delete-older-releases@master
with:
keep_latest: 5
delete_tags: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}