Skip to content

Commit

Permalink
feat: 适配 OpenWrt-23.05
Browse files Browse the repository at this point in the history
  • Loading branch information
fanck0605 committed Apr 26, 2024
1 parent 0dc54bc commit c8de6d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 46 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# Copyright (c) 2020, Chuck <[email protected]>
#

name: openwrt-22.03
name: openwrt-23.05

on:
push:
branches: [ openwrt-22.03 ]
branches: [ openwrt-23.05 ]
tags:
- v22.03.*
- v23.05.*
pull_request:
branches: [ openwrt-22.03 ]
branches: [ openwrt-23.05 ]

jobs:
build:
Expand All @@ -33,34 +33,28 @@ jobs:
- name: Checkout Project
uses: actions/checkout@v4
with:
ref: openwrt-22.03
ref: openwrt-23.05

- name: Show large directories
run: |
df -h
sudo du -xh --exclude=/{proc,sys,dev} / | grep -E '^[0-9.]*?[GTPEZY]'

- name: Initialize Environment
- name: Initialize environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo du -xh -d4 --exclude=/{proc,sys,dev} / | grep -E '^[0-9.]*?[GTPEZY]'
sudo rm -rf /usr/local/lib/android
sudo apt-get update
sudo apt-get install build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libelf-dev libncurses-dev libssl-dev python3-distutils quilt rsync subversion unzip zlib1g-dev file wget
sudo apt-get install build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libelf-dev libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget
sudo apt-get autoremove --purge
sudo apt-get clean
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Show disk space usage
run: |
df -h
- name: Build OpenWrt
run: |
./build.sh -t ${{ matrix.target }}
- name: Upload Artifact
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openwrt-${{ matrix.target }}
Expand All @@ -70,7 +64,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
needs: build

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/download-artifact@v4
Expand Down
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@

- 刷机最好**不要**保留配置,以免产生未知的问题!

- 后台 IP: 192.168.33.1
- 后台 IP: 10.33.0.1

## 自行编译

### 1. 安装依赖

**注意:** 相比 OpenWrt 的官方版本多了 `quilt` 这个软件包

```
sudo apt update
sudo apt install build-essential ccache ecj fastjar file g++ gawk gettext git java-propose-classpath libelf-dev libncurses5-dev libncursesw5-dev libssl-dev python python2.7-dev python3 unzip wget python-distutils-extra python3-setuptools python3-dev quilt rsync subversion swig time xsltproc zlib1g-dev
sudo apt install build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libelf-dev libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget
```

### 2. 固件编译
Expand Down Expand Up @@ -59,19 +57,5 @@ cd ../
不同版本补丁不一定兼容,可能初始化失败

```
./build.sh -v openwrt-22.03
```

### 刷新补丁

因为使用 `./script/feeds update -i` 可能会把 quilt 储存在 .pc 文件夹下的临时文件识别成软件包,因此在使用 `./build.sh` 初始化源码后会把 quilt 产生的临时文件夹移除,需要使用 `-s` 参数重新装载,如果已经使用过一次 `-s` 参数则无需再次添加

```
./build.sh -r [-s]
```

通过配合 `-m` 参数可以直接克隆源码并刷新补丁

```
./build.sh -msr
./build.sh -v openwrt-23.05
```
17 changes: 6 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -euo pipefail
PROJ_DIR=$(pwd)
readonly PROJ_DIR

VERSION=openwrt-22.03
VERSION=openwrt-23.05
MANUAL=false
ORIGIN=origin
BUILD=false
Expand Down Expand Up @@ -143,9 +143,9 @@ init_packages() {
rm -rf OpenClash
git clone --depth 1 -b master https://github.com/vernesong/OpenClash.git
rm -rf immortalwrt-luci
git clone --depth 1 -b openwrt-21.02 https://github.com/immortalwrt/luci.git immortalwrt-luci
git clone --depth 1 -b openwrt-23.05 https://github.com/immortalwrt/luci.git immortalwrt-luci
rm -rf immortalwrt-packages
git clone --depth 1 -b openwrt-21.02 https://github.com/immortalwrt/packages.git immortalwrt-packages
git clone --depth 1 -b openwrt-23.05 https://github.com/immortalwrt/packages.git immortalwrt-packages

# addition packages
cd "$PROJ_DIR/openwrt"
Expand Down Expand Up @@ -205,6 +205,9 @@ build() {

while getopts 'msrbv:o:t:' opt; do
case $opt in
t)
target=$OPTARG
;;
m)
MANUAL=true
AUTO_BUILD=false
Expand All @@ -221,9 +224,6 @@ while getopts 'msrbv:o:t:' opt; do
BUILD=true
AUTO_BUILD=false
;;
t)
target=$OPTARG
;;
*)
echo "usage: $0 [-msrb] [-v version] [-o origin] [-t target]"
exit 1
Expand All @@ -233,9 +233,7 @@ done

if $MANUAL; then
init_trunk

init_packages

prepare_build
fi

Expand All @@ -245,10 +243,7 @@ fi

if $AUTO_BUILD; then
init_trunk

init_packages

prepare_build

build
fi

0 comments on commit c8de6d4

Please sign in to comment.