Replace git patch with portable shell script and parameterize OpenWrt version
- Convert enable_wcn36xx_mac80211.patch to apply_patches.sh (sed + heredoc) for cross-version compatibility (old patch moved to TBR/) - GHA workflows auto-resolve latest OpenWrt 25.12.x tag via git ls-remote - Unify build.yml and build-all.yml into single workflow with dynamic matrix - Local dev (Dockerfile/docker-compose) defaults to main (snapshot) - Remove target-specific APK feed on first boot (msm89xx not on downloads.openwrt.org) - Make LuCI odhcpd fix conditional - Update README with new build instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ac475d7ab1
commit
e89f2c8bfb
9 files changed
+159
-125
No files matched your search
@@ -1,101 +0,0 @@
|
||||
name: OpenWrt Builder (All Devices)
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
UPLOAD_FIRMWARE: true
|
||||
TZ: Europe/Madrid
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
device: [uz801, uf02]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Initialization environment
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
||||
sudo docker image prune --all --force
|
||||
sudo -E apt-get -qq update
|
||||
sudo -E ./devenv/dependencies.sh
|
||||
sudo -E apt-get -qq autoremove --purge
|
||||
sudo -E apt-get -qq clean
|
||||
sudo timedatectl set-timezone "$TZ"
|
||||
|
||||
- name: Clone OpenWrt source code
|
||||
run: |
|
||||
df -hT $PWD
|
||||
git clone https://git.openwrt.org/openwrt/openwrt.git openwrt
|
||||
git -C openwrt checkout 00ceb1ed1763f7479df6edf92ffada948f0e7d45
|
||||
|
||||
- name: Load msm89xx target and packages
|
||||
run: |
|
||||
git apply --unsafe-paths enable_wcn36xx_mac80211.patch
|
||||
mv msm89xx openwrt/target/linux/msm89xx
|
||||
mv packages openwrt/package/uz801
|
||||
|
||||
- name: Update and install feeds
|
||||
run: |
|
||||
cd openwrt
|
||||
rm -rf tmp
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
|
||||
- name: Load diffconfig
|
||||
run: |
|
||||
DEVICE="${{ matrix.device }}"
|
||||
DIFFCONFIG="diffconfig_${DEVICE}"
|
||||
[ -f "$DIFFCONFIG" ] && mv "$DIFFCONFIG" openwrt/.config
|
||||
|
||||
- name: Download package
|
||||
id: package
|
||||
run: |
|
||||
cd openwrt
|
||||
make defconfig
|
||||
make download -j8
|
||||
find dl -size -1024c -exec ls -l {} \; || true
|
||||
find dl -size -1024c -exec rm -f {} \; || true
|
||||
|
||||
- name: Compile the firmware
|
||||
id: compile
|
||||
run: |
|
||||
cd openwrt
|
||||
echo -e "$(nproc) thread compile"
|
||||
make -j$(nproc) || make -j1 || make -j1 V=s
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME
|
||||
[ -s DEVICE_NAME ] && echo "DEVICE_NAME=$(cat DEVICE_NAME)" >> $GITHUB_ENV
|
||||
echo "FILE_DATE=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
|
||||
|
||||
- name: Organize files
|
||||
id: organize
|
||||
if: env.UPLOAD_FIRMWARE == 'true' && !cancelled()
|
||||
run: |
|
||||
cd openwrt/bin/targets/*/*
|
||||
rm -rf packages
|
||||
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload firmware
|
||||
uses: actions/upload-artifact@v4
|
||||
if: steps.organize.outputs.status == 'success' && !cancelled()
|
||||
with:
|
||||
name: openwrt_firmware_${{ env.DEVICE_NAME }}_${{ env.FILE_DATE }}
|
||||
path: |
|
||||
${{ env.FIRMWARE }}/openwrt-msm89xx-msm8916-${{ env.DEVICE_NAME }}-squashfs-gpt_both0.bin
|
||||
${{ env.FIRMWARE }}/openwrt-msm89xx-msm8916-${{ env.DEVICE_NAME }}-squashfs-boot.img
|
||||
${{ env.FIRMWARE }}/openwrt-msm89xx-msm8916-${{ env.DEVICE_NAME }}-squashfs-system.img
|
||||
${{ env.FIRMWARE }}/openwrt-msm89xx-msm8916-${{ env.DEVICE_NAME }}.manifest
|
||||
${{ env.FIRMWARE }}/openwrt-msm89xx-msm8916-${{ env.DEVICE_NAME }}-flash.sh
|
||||
${{ env.FIRMWARE }}/openwrt-msm89xx-msm8916-${{ env.DEVICE_NAME }}-firmware.zip
|
||||
@@ -18,6 +18,14 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Resolve latest OpenWrt 25.12.x tag
|
||||
id: resolve
|
||||
run: |
|
||||
VERSION=$(git ls-remote --tags https://git.openwrt.org/openwrt/openwrt.git 'v25.12.*' \
|
||||
| grep -oP 'v25\.12\.\d+$' | sort -V | tail -1)
|
||||
echo "Resolved OpenWrt version: $VERSION"
|
||||
echo "OPENWRT_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Initialization environment
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
@@ -32,12 +40,13 @@ jobs:
|
||||
|
||||
- name: Clone OpenWrt source code
|
||||
run: |
|
||||
echo "Using OpenWrt ${{ env.OPENWRT_VERSION }}"
|
||||
git clone https://git.openwrt.org/openwrt/openwrt.git openwrt
|
||||
git -C openwrt checkout 00ceb1ed1763f7479df6edf92ffada948f0e7d45
|
||||
git -C openwrt checkout ${{ env.OPENWRT_VERSION }}
|
||||
|
||||
- name: Load msm89xx target and packages
|
||||
run: |
|
||||
git apply --unsafe-paths enable_wcn36xx_mac80211.patch
|
||||
chmod +x apply_patches.sh && ./apply_patches.sh openwrt
|
||||
mv msm89xx openwrt/target/linux/msm89xx
|
||||
mv packages openwrt/package/uz801
|
||||
|
||||
|
||||
@@ -5,11 +5,12 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
device:
|
||||
description: 'Target device'
|
||||
required: true
|
||||
description: 'Target device (all = build all devices)'
|
||||
required: false
|
||||
type: choice
|
||||
default: uz801
|
||||
default: all
|
||||
options:
|
||||
- all
|
||||
- uz801
|
||||
- uf02
|
||||
|
||||
@@ -18,8 +19,27 @@ env:
|
||||
TZ: Europe/Madrid
|
||||
|
||||
jobs:
|
||||
build:
|
||||
resolve-version:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
openwrt_version: ${{ steps.resolve.outputs.version }}
|
||||
steps:
|
||||
- name: Resolve latest OpenWrt 25.12.x tag
|
||||
id: resolve
|
||||
run: |
|
||||
VERSION=$(git ls-remote --tags https://git.openwrt.org/openwrt/openwrt.git 'v25.12.*' \
|
||||
| grep -oP 'v25\.12\.\d+$' | sort -V | tail -1)
|
||||
echo "Resolved OpenWrt version: $VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
needs: resolve-version
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
device: ${{ fromJSON(inputs.device == 'all' || inputs.device == '' && '["uz801","uf02"]' || format('["{0}"]', inputs.device)) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -40,12 +60,13 @@ jobs:
|
||||
- name: Clone OpenWrt source code
|
||||
run: |
|
||||
df -hT $PWD
|
||||
echo "Using OpenWrt ${{ needs.resolve-version.outputs.openwrt_version }}"
|
||||
git clone https://git.openwrt.org/openwrt/openwrt.git openwrt
|
||||
git -C openwrt checkout 00ceb1ed1763f7479df6edf92ffada948f0e7d45
|
||||
git -C openwrt checkout ${{ needs.resolve-version.outputs.openwrt_version }}
|
||||
|
||||
- name: Load msm89xx target and packages
|
||||
run: |
|
||||
git apply --unsafe-paths enable_wcn36xx_mac80211.patch
|
||||
chmod +x apply_patches.sh && ./apply_patches.sh openwrt
|
||||
mv msm89xx openwrt/target/linux/msm89xx
|
||||
mv packages openwrt/package/uz801
|
||||
|
||||
@@ -58,7 +79,7 @@ jobs:
|
||||
|
||||
- name: Load diffconfig
|
||||
run: |
|
||||
DEVICE="${{ inputs.device || 'uz801' }}"
|
||||
DEVICE="${{ matrix.device }}"
|
||||
DIFFCONFIG="diffconfig_${DEVICE}"
|
||||
[ -f "$DIFFCONFIG" ] && mv "$DIFFCONFIG" openwrt/.config
|
||||
|
||||
|
||||
Reference in new issue
Block a user