Simplify to kernel-install-only; default to BBR + CAKE + ECN

Strip the project down to installing the BBRv3 kernel and nothing else, and
ship a single standard kernel (x86_64 + arm64, latest stable).

- install.sh: 1413 -> ~490 lines. Menu reduced to install latest / install
  specific / status / uninstall. Removed all qdisc/TCP-tuning/speedtest/
  smart-bandwidth/"madness"/clear-config features, the security (Dirty-Frag)
  mitigations, the profile (standard/max) selection, and the self-installing
  `b` quick command. Map dep command->package (sysctl->procps, awk->gawk) and
  abort clearly when a hard dependency is missing.
- Default network stack: on install write /etc/sysctl.d/99-bbrv3.conf with
  net.core.default_qdisc=cake, net.ipv4.tcp_congestion_control=bbr,
  net.ipv4.tcp_ecn=1 (CAKE has no compile-time default-qdisc option, so it is
  set via sysctl); uninstall removes the drop-in.
- prepare-kernel-config.sh: build sch_cake in (=y) so cake works at boot; drop
  the now-dead build-configs/ output.
- build.yml: matrix is just x86_64 + arm64 standard; tags are <arch>-<version>;
  removed the max profile/steps and the update-config-baseline auto-commit job;
  releases carry only the kernel .deb assets.
- Remove cve_2026_31431_detector.py and the two max-profile helper scripts.
- README rewritten to the 4-action, kernel-only scope.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-06-17 14:24:56 +08:00
parent c9c52c7e94
commit d888a9700e
7 changed files with 137 additions and 1770 deletions
+20 -118
View File
@@ -1,15 +1,10 @@
name: 构建带有BBRv3的内核
# Gitea Actions reads workflows from .github/workflows/ (and .gitea/workflows/).
# This workflow targets a self-hosted Gitea instance:
# * release existence checks, creation and asset uploads go through the Gitea
# REST API (curl), not the GitHub `gh` CLI;
# * config-baseline data is passed between jobs via Gitea release assets, NOT via
# actions/upload-artifact@v4 — the upstream artifact v4 actions detect Gitea as
# GHES and abort, so they are avoided entirely;
# * arm64 kernels are cross-compiled on the x86_64 runner
# (CROSS_COMPILE=aarch64-linux-gnu-), so only a single ubuntu-latest runner is
# required.
# This workflow targets a self-hosted Gitea instance: release existence checks,
# creation and asset uploads go through the Gitea REST API (curl), not the GitHub
# `gh` CLI. arm64 is cross-compiled on the x86_64 runner
# (CROSS_COMPILE=aarch64-linux-gnu-), so only a single ubuntu-latest runner is needed.
on:
workflow_dispatch:
@@ -74,15 +69,13 @@ jobs:
missing=0
for arch in x86_64 arm64; do
for suffix in "" "-max"; do
tag="$arch-$version$suffix"
if release_exists "$tag"; then
echo "$tag already exists."
else
echo "$tag is missing."
missing=1
fi
done
tag="$arch-$version"
if release_exists "$tag"; then
echo "$tag already exists."
else
echo "$tag is missing."
missing=1
fi
done
if [ "$missing" -eq 0 ]; then
@@ -100,35 +93,15 @@ jobs:
fail-fast: false
matrix:
include:
# All targets build on a single x86_64 runner; arm64 is cross-compiled.
# Both targets build on a single x86_64 runner; arm64 is cross-compiled.
- arch: x86_64
runs_on: ubuntu-latest
cross_compile: ""
profile: standard
profile_name: BBRv3
release_suffix: ""
localversion: -bbrv3
- arch: arm64
runs_on: ubuntu-latest
cross_compile: aarch64-linux-gnu-
profile: standard
profile_name: BBRv3
release_suffix: ""
localversion: -bbrv3
- arch: x86_64
runs_on: ubuntu-latest
cross_compile: ""
profile: max
profile_name: BBRv3 Max
release_suffix: -max
localversion: -bbrv3-max
- arch: arm64
runs_on: ubuntu-latest
cross_compile: aarch64-linux-gnu-
profile: max
profile_name: BBRv3 Max
release_suffix: -max
localversion: -bbrv3-max
runs-on: ${{ matrix.runs_on }}
env:
ARCH: ${{ matrix.arch }}
@@ -137,8 +110,7 @@ jobs:
- name: 检查是否已发布
id: check_release
env:
TAG: ${{ matrix.arch }}-${{ needs.preflight.outputs.kernel_version }}${{ matrix.release_suffix }}
PROFILE_NAME: ${{ matrix.profile_name }}
TAG: ${{ matrix.arch }}-${{ needs.preflight.outputs.kernel_version }}
run: |
code=$(curl -sS -o /dev/null -w '%{http_code}' \
-H "Authorization: token $GITEA_TOKEN" \
@@ -148,7 +120,7 @@ jobs:
echo "$TAG already exists; skipping build."
else
echo "BUILD_NEEDED=true" >> "$GITHUB_ENV"
echo "$TAG does not exist; building latest kernel with $PROFILE_NAME."
echo "$TAG does not exist; building latest BBRv3 kernel."
fi
- name: 检出代码
@@ -190,27 +162,13 @@ jobs:
bash "$GITHUB_WORKSPACE/scripts/apply-bbrv3-port.sh"
grep -n "BBR_VERSION" net/ipv4/tcp_bbr.c
- name: 应用 BBRv3 Max 极限内核配置
if: env.BUILD_NEEDED == 'true' && matrix.profile == 'max'
working-directory: ./kernel/linux
run: |
bash "$GITHUB_WORKSPACE/scripts/apply-bbrv3-max-profile.sh"
- name: 编译声明
if: env.BUILD_NEEDED == 'true'
working-directory: ./kernel/linux
env:
PROFILE: ${{ matrix.profile }}
run: |
grep -v "MODULE_DESCRIPTION" net/ipv4/tcp_bbr.c > net/ipv4/tcp_bbr.c.tmp
mv net/ipv4/tcp_bbr.c.tmp net/ipv4/tcp_bbr.c
if [ "$PROFILE" = "max" ]; then
echo 'MODULE_DESCRIPTION("TCP BBR v3 Max - aggressive throughput profile by Joey");' >> net/ipv4/tcp_bbr.c
else
echo 'MODULE_DESCRIPTION("TCP BBR v3 (Bottleneck Bandwidth and RTT) - Compiled & Optimized by Joey");' >> net/ipv4/tcp_bbr.c
fi
echo 'MODULE_DESCRIPTION("TCP BBR v3 (Bottleneck Bandwidth and RTT) - Compiled & Optimized by Joey");' >> net/ipv4/tcp_bbr.c
tail -n 5 net/ipv4/tcp_bbr.c
- name: 更新 Makefile 中的版本号
@@ -264,7 +222,7 @@ jobs:
- name: 发布前复查是否已发布
if: env.BUILD_NEEDED == 'true'
env:
TAG: ${{ matrix.arch }}-${{ needs.preflight.outputs.kernel_version }}${{ matrix.release_suffix }}
TAG: ${{ matrix.arch }}-${{ needs.preflight.outputs.kernel_version }}
run: |
code=$(curl -sS -o /dev/null -w '%{http_code}' \
-H "Authorization: token $GITEA_TOKEN" \
@@ -280,13 +238,12 @@ jobs:
- name: 发布到 Gitea Release
if: env.BUILD_NEEDED == 'true' && env.PUBLISH_NEEDED == 'true'
env:
TAG: ${{ matrix.arch }}-${{ needs.preflight.outputs.kernel_version }}${{ matrix.release_suffix }}
PROFILE_NAME: ${{ matrix.profile_name }}
TAG: ${{ matrix.arch }}-${{ needs.preflight.outputs.kernel_version }}
TARGET_ARCH: ${{ matrix.arch }}
TARGET_SHA: ${{ github.sha }}
run: |
set -euo pipefail
body="带有 $PROFILE_NAME 的最新内核,适用于 $TARGET_ARCH 架构。Compiled & Optimized by Joey."
body="带有 BBRv3 的最新内核,适用于 $TARGET_ARCH 架构。Compiled & Optimized by Joey."
auth=(-H "Authorization: token $GITEA_TOKEN")
@@ -309,14 +266,11 @@ jobs:
exit 1
fi
# Collect assets: kernel debs plus the versioned arch config.
# Upload the kernel .deb packages as release assets.
shopt -s nullglob
assets=( ./kernel/linux-*.deb )
cfg="./build-configs/$TARGET_ARCH-$KERNEL_VERSION.config"
[ -f "$cfg" ] && assets+=( "$cfg" )
if [ "${#assets[@]}" -eq 0 ]; then
echo "No assets found to upload for $TAG" >&2
echo "No .deb assets found to upload for $TAG" >&2
exit 1
fi
@@ -328,55 +282,3 @@ jobs:
-F "attachment=@$f" >/dev/null
done
echo "Published $TAG with ${#assets[@]} asset(s)."
update-config-baseline:
needs: [preflight, build]
if: ${{ needs.preflight.outputs.build_needed == 'true' && needs.build.result == 'success' }}
runs-on: ubuntu-latest
env:
KERNEL_VERSION: ${{ needs.preflight.outputs.kernel_version }}
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 回写配置基线
run: |
set -euxo pipefail
auth=(-H "Authorization: token $GITEA_TOKEN")
# Pull the generated .config for a freshly published standard release back
# into the repo baseline. Config travels as a Gitea release asset (named
# "<arch>-<version>.config"), so no actions/artifact is needed.
refresh_baseline() {
local arch="$1" baseline="$2"
local tag="$arch-$KERNEL_VERSION" # standard release (no -max)
local rel asset_name url
rel=$(curl -sS "${auth[@]}" "$GITEA_API/releases/tags/$tag")
if [ -z "$(echo "$rel" | jq -r '.id // empty')" ]; then
echo "Release $tag not found; skipping $baseline."
return 0
fi
asset_name="$arch-$KERNEL_VERSION.config"
url=$(echo "$rel" | jq -r --arg n "$asset_name" \
'.assets[]? | select(.name == $n) | .browser_download_url' | head -n1)
if [ -z "$url" ]; then
echo "Config asset $asset_name not found on $tag; skipping $baseline."
return 0
fi
curl -fsSL "${auth[@]}" -o "$baseline" "$url"
echo "Refreshed $baseline from $tag."
}
refresh_baseline x86_64 x86-64.config
refresh_baseline arm64 arm64.config
if git diff --quiet -- x86-64.config arm64.config; then
echo "Generated configs match current baselines."
exit 0
fi
git config user.name "gitea-actions[bot]"
git config user.email "gitea-actions[bot]@noreply.git.chilldove.com"
git add x86-64.config arm64.config
git commit -m "Refresh generated kernel config baselines [skip ci]"
git push