Skip to content

Commit

Permalink
upgrade to plus custom edition
Browse files Browse the repository at this point in the history
  • Loading branch information
pmkol committed Jun 28, 2024
1 parent 5f0b144 commit 34d09b7
Show file tree
Hide file tree
Showing 11 changed files with 367 additions and 97 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ jobs:
run: |
export PATH="/opt/clang/bin:$PATH"
mkdir /opt/clang
curl -LO https://github.com/sbwml/redhat-llvm-project/releases/download/18.1.6/clang-18.1.6-x86_64-redhat-linux.tar.xz --progress-bar
sudo tar --strip-components=1 -C /opt/clang -xf clang-18.1.6-x86_64-redhat-linux.tar.xz
rm -rf clang-18.1.6-x86_64-redhat-linux.tar.xz
curl -LO https://github.com/sbwml/redhat-llvm-project/releases/download/18.1.8/clang-18.1.8-x86_64-redhat-linux.tar.xz --progress-bar
sudo tar --strip-components=1 -C /opt/clang -xf clang-18.1.8-x86_64-redhat-linux.tar.xz
rm -rf clang-18.1.8-x86_64-redhat-linux.tar.xz
clang --version
- name: Compile OpenWrt
Expand All @@ -113,10 +113,12 @@ jobs:
run: |
export PATH="/opt/clang/bin:$PATH"
export GITHUB_REPO=${{ github.repository }}
BUILD_FAST=y ENABLE_LTO=y ENABLE_LRNG=y ENABLE_BPF=y USE_GCC13=y USE_MOLD=y bash <(curl -sS https://raw.githubusercontent.com/${{ github.repository }}/master/openwrt/build.sh) ${{ matrix.tag.type }} ${{ matrix.model }}
export KERNEL_CLANG_LTO=y BUILD_FAST=y ENABLE_UHTTPD=y ENABLE_LTO=y ENABLE_LRNG=y ENABLE_BPF=y USE_GCC14=y USE_MOLD=y
bash <(curl -sS https://raw.githubusercontent.com/${{ github.repository }}/master/openwrt/build.sh) ${{ matrix.tag.type }} ${{ matrix.model }}
cd openwrt
tags=$(git describe --abbrev=0 --tags)
echo "latest_release=$tags" >>$GITHUB_ENV
kernel=$(curl -s "https://raw.githubusercontent.com/${{ github.repository }}/master/tags/kernel-6.6" | awk -F"LINUX_KERNEL_HASH-| =" '/LINUX_KERNEL_HASH/{print $2}')
echo "latest_release=$tags-k$kernel" >>$GITHUB_ENV
- name: Extensive logs after a failed compilation
working-directory: /builder
Expand All @@ -143,17 +145,12 @@ jobs:
elif [ "${{ matrix.model }}" = "x86_64" ]; then
cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/
cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/
cp -a openwrt/bin/targets/x86/*/*-generic-rootfs.tar.gz rom/
cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt
cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo
cd rom && sha256sum *gz > ../info/sha256sums.txt
elif [ "${{ matrix.model }}" = "armv8" ]; then
tar zcf rom/u-boot-qemu_armv8.tar.gz -C openwrt/bin/targets/armsr/armv8*/ ./u-boot-qemu_armv8
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-initramfs-kernel.bin rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-kernel.bin rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-ext4-combined-efi.img.gz rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-squashfs-combined-efi.img.gz rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-rootfs.tar.gz rom/
cp -a openwrt/bin/targets/armsr/armv8*/*.manifest info/manifest.txt
cp -a openwrt/bin/targets/armsr/armv8*/config.buildinfo info/config.buildinfo
cd rom && sha256sum * > ../info/sha256sums.txt
Expand All @@ -163,15 +160,16 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.model }}-${{ matrix.tag.version }}
path: ${{ env.WORKDIR }}/rom/*
path: ${{ env.WORKDIR }}/rom/*.gz

- name: Create release
continue-on-error: true
uses: sbwml/release-action@main
with:
name: OpenWRT-${{ env.latest_release }}
name: OpenWrt-${{ env.latest_release }}
allowUpdates: true
tag: ${{ env.latest_release }}
body: OpenWrt 23.05 with Kernel 6.6 Enhanced
commit: master
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
150 changes: 150 additions & 0 deletions .github/workflows/build-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Build x86_64

on:
workflow_dispatch:

jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
name: Build ${{ matrix.model }}-${{ matrix.tag.version }}
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
model:
- x86_64
tag:
- type: rc2
version: openwrt-23.05

steps:
- name: Checkout
uses: actions/checkout@main
with:
ref: x86_64

- name: Set time zone
run: sudo timedatectl set-timezone 'Asia/Shanghai'

- name: Show system
run: |
lscpu
free -h
df -Th
uname -a
- name: Set release env
run: |
sudo mkdir -p /builder
sudo chown -R runner.runner /builder
echo WORKDIR="/builder" >> "$GITHUB_ENV"
- name: Free disk space
run: |
sudo rm -rf /etc/apt/sources.list.d
sudo swapoff -a
sudo rm -f /swapfile /mnt/swapfile
sudo docker image prune -a -f
sudo systemctl stop docker
sudo snap set system refresh.retain=2
sudo apt-get -y purge firefox clang* ghc* google* llvm* mono* mongo* mysql* php*
sudo apt-get -y autoremove --purge
sudo apt-get clean
sudo rm -rf /etc/mysql /etc/php /usr/lib/jvm /usr/libexec/docker /usr/local /usr/src/* /var/lib/docker /var/lib/gems /var/lib/mysql /var/lib/snapd /etc/skel /opt/{microsoft,az,hostedtoolcache,cni,mssql-tools,pipx} /usr/share/{az*,dotnet,swift,miniconda,gradle*,java,kotlinc,ri,sbt} /root/{.sbt,.local,.npm}
sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile}
rm -rf ~/{.cargo,.dotnet,.rustup}
df -Th
- name: Build System Setup
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install -y build-essential flex bison cmake g++ gawk gcc-multilib g++-multilib gettext git libfuse-dev libncurses5-dev libssl-dev python3 python3-pip python3-ply python3-distutils python3-pyelftools rsync unzip zlib1g-dev file wget subversion patch upx-ucl autoconf automake curl asciidoc binutils bzip2 lib32gcc-s1 libc6-dev-i386 uglifyjs msmtp texinfo libreadline-dev libglib2.0-dev xmlto libelf-dev libtool autopoint antlr3 gperf ccache swig coreutils haveged scons libpython3-dev rename qemu-utils
sudo apt-get clean
git config --global user.name 'GitHub Actions' && git config --global user.email 'noreply@github.com'
df -Th
- name: Install LLVM
run: |
export PATH="/opt/clang/bin:$PATH"
mkdir /opt/clang
curl -LO https://github.com/sbwml/redhat-llvm-project/releases/download/18.1.8/clang-18.1.8-x86_64-redhat-linux.tar.xz --progress-bar
sudo tar --strip-components=1 -C /opt/clang -xf clang-18.1.8-x86_64-redhat-linux.tar.xz
rm -rf clang-18.1.8-x86_64-redhat-linux.tar.xz
clang --version
- name: Compile OpenWrt
working-directory: /builder
id: compile
continue-on-error: true
run: |
export PATH="/opt/clang/bin:$PATH"
export GITHUB_REPO=${{ github.repository }}
export KERNEL_CLANG_LTO=y BUILD_FAST=y ENABLE_UHTTPD=y ENABLE_LTO=y ENABLE_LRNG=y ENABLE_BPF=y USE_GCC14=y USE_MOLD=y
bash <(curl -sS https://raw.githubusercontent.com/${{ github.repository }}/x86_64/openwrt/build.sh) ${{ matrix.tag.type }} ${{ matrix.model }}
cd openwrt
tags=$(git describe --abbrev=0 --tags)
echo "latest_release=$tags" >>$GITHUB_ENV
- name: Extensive logs after a failed compilation
working-directory: /builder
if: steps.compile.outcome == 'failure'
run: |
export PATH="/opt/clang/bin:$PATH"
cd openwrt
make V=s
- name: Prepare Firmware Files
working-directory: /builder
run: |
mkdir -p rom info
if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then
cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/
cp -a openwrt/bin/targets/rockchip/*/*-r4s.manifest info/manifest.txt
cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo
cd rom && sha256sum *gz > ../info/sha256sums.txt
elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then
cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/
cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest.txt
cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo
cd rom && sha256sum *gz > ../info/sha256sums.txt
elif [ "${{ matrix.model }}" = "x86_64" ]; then
cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/
cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/
cp -a openwrt/bin/targets/x86/*/*-generic-rootfs.tar.gz rom/
cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt
cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo
cd rom && sha256sum *gz > ../info/sha256sums.txt
elif [ "${{ matrix.model }}" = "armv8" ]; then
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-initramfs-kernel.bin rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-kernel.bin rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-ext4-combined.img.gz rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-generic-squashfs-combined.img.gz rom/
cp -a openwrt/bin/targets/armsr/armv8*/*-rootfs.tar.gz rom/
cp -a openwrt/bin/targets/armsr/armv8*/*.manifest info/manifest.txt
cp -a openwrt/bin/targets/armsr/armv8*/config.buildinfo info/config.buildinfo
cd rom && sha256sum * > ../info/sha256sums.txt
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.model }}-${{ matrix.tag.version }}
path: ${{ env.WORKDIR }}/rom/*

- name: Create release
continue-on-error: true
uses: sbwml/release-action@main
with:
name: OpenWrt-${{ env.latest_release }}
allowUpdates: true
prerelease: true
tag: ${{ env.latest_release }}
commit: x86_64
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{ env.WORKDIR }}/rom/*
30 changes: 30 additions & 0 deletions .github/workflows/sync-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Sync Fork

on:
schedule:
- cron: '0 23 * * *'
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: 'master'
fetch-depth: 0

- name: Configure Git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
- name: Merge upstream changes
run: |
git remote add upstream https://github.com/sbwml/r4s_build_script.git
git fetch upstream
git merge upstream/master --allow-unrelated-histories --no-edit || exit 1
- name: Push changes
run: git push
47 changes: 38 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
# NanoPi R4S/R5S/R5C & X86_64 OpenWrt 简易构建脚本存档
# OpenWrt Plus 23.05

### 存档来自:https://init2.cooluc.com
### NanoPi R4S/R5S/R5C & X86_64 固件下载:

---------------

## 基于 Linux 6.6 LTS 固件下载:
https://github.com/pmkol/openwrt-plus/releases

#### NanoPi R4S: https://r4s.cooluc.com
```
【首次登陆】
地址:10.0.0.1(默认)
用户:root
密码:空
#### NanoPi R5S/R5C: https://r5s.cooluc.com
【分区挂载】
系统/磁盘管理 将系统盘剩余空间创建新分区
系统/挂载点 启用新分区并挂载至/opt目录
```

#### X86_64: https://x86.cooluc.com
---------------

#### 构建来源: https://github.com/sbwml/builder
#### 固件编译脚本存档来自:https://init2.cooluc.com

- 优化系统内核
- [x] Full cone NAT
- [x] TCP BBRv3
- [x] TCP Brutal
- [x] LLVM-BPF
- [x] Shortcut-FE
- 使用 OpenWrt+ImmortalWrt 软件源,支持更多插件的在线安装与升级
- 最小化集成常用插件,修复多处上游插件BUG

| ⚓ 服务 | 🗳️ Docker | 🩺 网络 |
| :---- | :---- | :---- |
| PassWall | Dockerman | 网速测试 |
| Mihomo | Docker | SQM队列管理 |
| MosDNS | Dockerd | UPnP |
| 硬盘休眠 | Docker-compose | 带宽监控 |
| Watchcat | | Socat |
| Aira2 | | 访问控制 |
| FRP客户端 | | IP限速 |
| 网络共享 | | |
| 网络唤醒 | | |
| ZeroTier | | |

自定义预装插件建议fork上游原项目,以免因本项目未及时同步导致编译失败

---------------

Expand Down
Loading

0 comments on commit 34d09b7

Please sign in to comment.