Skip to content

Commit

Permalink
Add support for Xiaomi AX3000T
Browse files Browse the repository at this point in the history
  • Loading branch information
danpawlik committed Dec 12, 2024
1 parent 4fdaff3 commit 2cdd0ae
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 0 deletions.
131 changes: 131 additions & 0 deletions .github/workflows/ax3000t.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
# Based on https://github.com/JuliusBairaktaris/Qualcommax_NSS_Builder/blob/main/.github/workflows/build.yaml
name: Xiaomi AX3000T

on:
workflow_dispatch:
inputs:
DEVICE_CONFIG:
description: "Device configuration selection: stock layout or u-boot (default: u-boot)"
required: true
type: choice
default: 'u-boot'
options:
- stock
- u-boot

env:
REMOTE_REPOSITORY: danpawlik/openwrt
REMOTE_BRANCH: ax3000t
RELEASE_PREFIX: Mediatek_mt7981b_ax3000t
DEVICE_CONFIG: ${{ inputs.DEVICE_CONFIG == 'stock' && 'configs/mediatek/mt7981b/ax3000t-stock-layout' || 'configs/mediatek/mt7981b/ax3000t' }}
ROLE_CONFIG: configs/common/dumb_ap

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 AX3000T
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
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/mt7981b/ax3000t > .config
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/${{ env.ROLE_CONFIG }} >> .config
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/common/snapshot-short >> .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: 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 ax_3000t-images.tar bin/targets/mediatek/filogic

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ax_3000t-images
path: ax_3000t-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: ax_3000t-images
- name: Extract artifacts
run: tar xf ax_3000t-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 AX3000T ${{ inputs.DEVICE_CONFIG == 'stock' && 'stock layout' || 'u-boot layout' }} - community release - ${{ env.REMOTE_BRANCH }} - ${{ env.RELEASE_DATE }}
body: |
Updated prebuilt images for AX3000T ${{ inputs.DEVICE_CONFIG == 'stock' && 'stock partition layout' || 'u-boot partition layout' }}
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 }}
10 changes: 10 additions & 0 deletions configs/mediatek/mt7981b/ax3000t
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/mediatek/mt7981b/ax3000t > .config
#

## NOTE: It uses u-boot partition layout!
# https://openwrt.org/inbox/toh/xiaomi/ax3000t#change_to_openwrt_u-boot

CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_filogic=y
CONFIG_TARGET_mediatek_filogic_DEVICE_xiaomi_mi-router-ax3000t-ubootmod=y
10 changes: 10 additions & 0 deletions configs/mediatek/mt7981b/ax3000t-stock-layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/mediatek/mt7981b/ax3000t-stock-layout > .config
#

## NOTE: it uses stock partition layout!
# https://openwrt.org/inbox/toh/xiaomi/ax3000t#change_to_openwrt_u-boot

CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_filogic=y
CONFIG_TARGET_mediatek_filogic_DEVICE_xiaomi_mi-router-ax3000t=y

0 comments on commit 2cdd0ae

Please sign in to comment.