From ce5f68714f0bdc626039cbd10f79d79b09e29144 Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Mon, 30 Nov 2026 12:03:41 +0100 Subject: [PATCH 1/3] =?UTF-8?q?KernelSU=20=E6=A8=A1=E5=9D=97=E9=9A=8F?= =?UTF-8?q?=E6=95=B4=E5=8C=85=E9=93=BE=E5=BC=8F=E5=8F=91=E7=89=88=EF=BC=9A?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=94=B9=E6=88=90=20v0.N.P=EF=BC=8C=E5=8A=A0?= =?UTF-8?q?=20release.yml=20=E5=92=8C=20changelog.d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 标签跟整包走(v0.N.P),已发的 v3.3.1-a14-6.1 保留并注明是旧规则;附件名不变。 - 新增 release.yml:只认 v0.N.P 标签、提交须在 main 上;跳过钉值为 null 的目标(全为 null 则失败);调用 build-ksu-lkm.yml(改成可 workflow_call)编译并和 targets.json 比大小、SHA-256;生成 SHA256SUMS.txt,建草稿 Release,同标签已有 Release 就失败。 - README 中英:写明发布流程,补 observer-release-mount-reference.patch 的说明。 - 新增 changelog.d(格式照其它组件仓库)和 #4 修复的一条。 Refs ModAVD/ModAVD#341 Refs ModAVD/ModAVD#309 --- .github/workflows/build-ksu-lkm.yml | 48 ++++++- .github/workflows/release.yml | 146 ++++++++++++++++++++ README.en.md | 23 ++- README.md | 23 ++- changelog.d/309-ksu-shutdown-unmount.fix.md | 2 + changelog.d/README.md | 45 ++++++ 6 files changed, 267 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 changelog.d/309-ksu-shutdown-unmount.fix.md create mode 100644 changelog.d/README.md diff --git a/.github/workflows/build-ksu-lkm.yml b/.github/workflows/build-ksu-lkm.yml index d39f6a7..0df111e 100644 --- a/.github/workflows/build-ksu-lkm.yml +++ b/.github/workflows/build-ksu-lkm.yml @@ -7,6 +7,17 @@ on: description: Target id from targets.json (or "all") default: a14-api34-6.1 type: string + # release.yml calls this with release: true to build every pinned target for a tag. + workflow_call: + inputs: + target: + description: Target id from targets.json (or "all") + default: all + type: string + release: + description: Build only targets with pinned digests and upload them as verified artifacts + default: false + type: boolean pull_request: paths: - build-lkm.sh @@ -35,14 +46,35 @@ jobs: shell: bash env: INPUT_TARGET: ${{ inputs.target }} + INPUT_RELEASE: ${{ inputs.release == true }} run: | set -euo pipefail target="${INPUT_TARGET:-a14-api34-6.1}" - matrix=$(jq -ce --arg t "$target" ' - [.targets[] | select($t == "all" or .id == $t) - | {id, ksu_version, ksu_commit, lkm_sha256, lkm_size}] - | select(length > 0) - ' targets.json) + if [[ "$INPUT_RELEASE" == "true" ]]; then + # A null pin means the module has not passed device validation: skip it, never release it. + skipped=$(jq -r --arg t "$target" ' + [.targets[] | select($t == "all" or .id == $t) + | select(.lkm_sha256 == null or .lkm_size == null) | .id] | join(" ") + ' targets.json) + if [[ -n "$skipped" ]]; then + echo "::notice::Not released (no pinned LKM digest): $skipped" + fi + if ! matrix=$(jq -ce --arg t "$target" ' + [.targets[] | select($t == "all" or .id == $t) + | select(.lkm_sha256 != null and .lkm_size != null) + | {id, ksu_version, ksu_commit, lkm_sha256, lkm_size}] + | select(length > 0) + ' targets.json); then + echo "::error::No selected target has a pinned lkm_sha256 and lkm_size; nothing to release" + exit 1 + fi + else + matrix=$(jq -ce --arg t "$target" ' + [.targets[] | select($t == "all" or .id == $t) + | {id, ksu_version, ksu_commit, lkm_sha256, lkm_size}] + | select(length > 0) + ' targets.json) + fi echo "matrix=$matrix" >> "$GITHUB_OUTPUT" build: @@ -136,8 +168,12 @@ jobs: path: ${{ runner.temp }}/ksu-candidate/* if-no-files-found: error retention-days: 5 + # Manual runs on main, or release.yml on a v0.N.P tag (it checks that the tag is on main). - name: Upload verified LKM from upstream main - if: github.event_name == 'workflow_dispatch' && github.repository == 'ModAVD/ModAVDKernelSU' && github.ref == 'refs/heads/main' && matrix.target.lkm_sha256 != null + if: >- + github.repository == 'ModAVD/ModAVDKernelSU' && matrix.target.lkm_sha256 != null && + ((github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || + (inputs.release == true && startsWith(github.ref, 'refs/tags/v0.'))) uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: verified-ksu-lkm-${{ matrix.target.id }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a5152ac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,146 @@ +name: Release + +# Pushing a v0.N.P tag (the ModAVD package version this module ships with) builds every +# target whose lkm_sha256 / lkm_size are pinned in targets.json, checks the output against +# those pins, and creates a draft Release. The ModAVD release script publishes the draft +# after the package release is approved. + +on: + push: + tags: ["v*"] + +permissions: {} + +concurrency: + group: release-${{ github.ref_name }} + cancel-in-progress: false + +jobs: + check: + if: github.repository == 'ModAVD/ModAVDKernelSU' + runs-on: ubuntu-24.04 + timeout-minutes: 5 + permissions: + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + fetch-depth: 0 + - name: Verify tag name and that it is on main + shell: bash + env: + TAG: ${{ github.ref_name }} + SHA: ${{ github.sha }} + run: | + set -euo pipefail + # Only package versions. Tags in the old style (v3.3.1-a14-6.1) are not released by this workflow. + if [[ ! "$TAG" =~ ^v0\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then + echo "::error::Tag $TAG is not v0.N.P; not releasing" + exit 1 + fi + [[ "$SHA" =~ ^[0-9a-f]{40}$ ]] + # Full ref name: a tag called origin/main would otherwise win over the branch. + if ! git merge-base --is-ancestor "$SHA" refs/remotes/origin/main; then + echo "::error::$TAG ($SHA) is not on main" + exit 1 + fi + + build: + needs: check + permissions: + contents: read + uses: ./.github/workflows/build-ksu-lkm.yml + with: + target: all + release: true + + draft: + needs: build + runs-on: ubuntu-24.04 + timeout-minutes: 10 + permissions: + contents: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + pattern: verified-ksu-lkm-* + path: ${{ runner.temp }}/verified + - name: Check modules against targets.json + shell: bash + env: + VERIFIED: ${{ runner.temp }}/verified + DIST: ${{ runner.temp }}/dist + run: | + set -euo pipefail + mkdir -p "$DIST" + # Exactly the pinned targets, checked against the tag's own targets.json. + mapfile -t pinned < <(jq -r '.targets[] | select(.lkm_sha256 != null and .lkm_size != null) | .id' targets.json) + if (( ${#pinned[@]} == 0 )); then + echo "::error::No target has a pinned LKM digest" + exit 1 + fi + have=$(cd "$VERIFIED" && ls -1 | sort | tr '\n' ' ') + want=$(printf 'verified-ksu-lkm-%s\n' "${pinned[@]}" | sort | tr '\n' ' ') + if [[ "$have" != "$want" ]]; then + echo "::error::Artifacts [$have] do not match pinned targets [$want]" + exit 1 + fi + for id in "${pinned[@]}"; do + [[ "$id" =~ ^[a-z0-9][a-z0-9._-]*$ ]] + ksu_version=$(jq -r --arg id "$id" '.targets[] | select(.id == $id) | .ksu_version' targets.json) + want_sha=$(jq -r --arg id "$id" '.targets[] | select(.id == $id) | .lkm_sha256' targets.json) + want_size=$(jq -r --arg id "$id" '.targets[] | select(.id == $id) | .lkm_size' targets.json) + [[ "$ksu_version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] + [[ "$want_sha" =~ ^[0-9a-f]{64}$ ]] + [[ "$want_size" =~ ^[1-9][0-9]*$ ]] + ko="${id}_kernelsu-${ksu_version}_kernelsu.ko" + src="$VERIFIED/verified-ksu-lkm-$id" + got_sha=$(sha256sum "$src/$ko") + got_sha=${got_sha%% *} + got_size=$(stat -c %s "$src/$ko") + if [[ "$got_sha" != "$want_sha" || "$got_size" != "$want_size" ]]; then + echo "::error::$ko is $got_size bytes, $got_sha; targets.json pins $want_size bytes, $want_sha" + exit 1 + fi + cp "$src/$ko" "$DIST/$ko" + cp "$src/$id.env" "$DIST/$id.env" + done + # One SHA256SUMS.txt over the modules, the same form as the earlier releases. + (cd "$DIST" && sha256sum -- *_kernelsu.ko > SHA256SUMS.txt) + cat "$DIST/SHA256SUMS.txt" + - name: Create draft release + shell: bash + env: + TAG: ${{ github.ref_name }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + DIST: ${{ runner.temp }}/dist + run: | + set -euo pipefail + [[ "$TAG" =~ ^v0\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]] + version=${TAG#v} + # Drafts are not bound to their tag, so list every release, drafts included. + tags=$(gh api "repos/$GH_REPO/releases?per_page=100" --paginate --jq '.[].tag_name') + if grep -Fxq -- "$TAG" <<< "$tags"; then + echo "::error::A release for $TAG already exists (draft or published); not overwriting" + exit 1 + fi + notes="$RUNNER_TEMP/notes.md" + if [[ -f "release/$version.md" ]]; then + cp "release/$version.md" "$notes" + else + { + echo "随 ModAVD $version 发布。" + echo + echo "Released with ModAVD $version." + echo + echo '```text' + cat "$DIST/SHA256SUMS.txt" + echo '```' + } > "$notes" + fi + gh release create "$TAG" --draft --verify-tag --title "$TAG" --notes-file "$notes" "$DIST"/* diff --git a/README.en.md b/README.en.md index 0095adb..b57ad09 100644 --- a/README.en.md +++ b/README.en.md @@ -9,6 +9,7 @@ Builds `kernelsu.ko` for ModAVD's Android 14 API 34 Google APIs x86_64 r14 image - `x86_64-seccomp-skip.patch` preserves the kernel's decision to skip a system call when the call number is read again. - `x86_64-do_syscall_64-fallback.patch` selects the compatibility entry when r14 lacks `x64_sys_call`. It applies after the first patch. - `disable-module-unload.patch` disables live unloading. In-flight system calls may return to module code. Shut down the guest normally to remove the module. +- `observer-release-mount-reference.patch` stops the package observer from pinning the `/data` mount. KernelSU watches `/data/system` to update its package list. It used to hold a path reference to that directory for as long as the watch existed, so `/data` could not be unmounted at shutdown: shutdown waited for the unmount timeout and was slower, and the next boot replayed the ext4 journal and ran a full check (ModAVD/ModAVD#309). The patch keeps the watch but releases the path reference right after registering it; the `fsnotify` mark holds the inode. Use Docker, Python 3, and Git on Linux x86_64. Prepare a full KernelSU clone containing the configured `ksu_commit` and pass the target ID, checkout path, and working directory to `build-target.sh`. Outputs are in `/out` under that directory. The log includes the module SHA-256 and vermagic. @@ -16,20 +17,28 @@ PR builds validate changes. While `lkm_sha256` and `lkm_size` are not pinned in ## Release tag and file name -This target's module is published in this repository's Release `v3.3.1-a14-6.1` as `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`. ModAVDManager's download URL hard-codes this tag and file name. +The module is released together with the ModAVD package, and its tag follows the package. -- Tag: `-a-`, that is `ksu_version` followed by `kmi` with `android` shortened to `a` (`android14-6.1` → `a14-6.1`). -- File name: `_kernelsu-_kernelsu.ko`, the same name as the file in the `verified-` artifact. +- Tag: `v0.N.P`, the version of the ModAVD package that ships this module. A tag is made only in a release where the module changed (`targets.json`, patches, or build scripts); otherwise the package keeps the previous tag and nothing is released again. +- File name, unchanged: `_kernelsu-_kernelsu.ko`, the same name as the file in the `verified-` artifact, for example `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`. The upstream KernelSU version stays in the file name. Each target also has `.env` (its build inputs), and one `SHA256SUMS.txt` covers all `.ko` files. +- The existing `v3.3.1-a14-6.1` was released under the old rule (`-a-`) and stays as it is. The old rule gives the same tag when only the patches change and the KernelSU version does not, and Release assets cannot be replaced, so the rule was changed. -Follow these rules when changing the KernelSU version or adding a target, and update ModAVDManager's download URL to match. +The tag, file name, size, and SHA-256 that ModAVDManager downloads follow the package: a new tag means the package switches to the new set (to be recorded in the package's `components\kernelsu.json`, with the manager's built-in set as the fallback). ## How maintainers publish a new version -1. When changing build inputs (`targets.json`, patches, scripts), reset `lkm_sha256` and `lkm_size` to `null` and open a PR. Once the PR build passes, download the `UNVERIFIED-candidate-…` artifact from that run's Actions page. The step summary shows its size and SHA-256. +1. When changing build inputs (`targets.json`, patches, scripts), reset `lkm_sha256` and `lkm_size` to `null` and open a PR. Once the PR build passes, download the `UNVERIFIED-candidate-…` artifact from that run's Actions page. The step summary shows its size and SHA-256. A change users can see also adds a [`changelog.d`](changelog.d/README.md) file in the same PR. 2. Validate the candidate on a disposable r14 test instance. Import it with `modavd components import-ksu --lkm-sha256 `, then check that it loads, its vermagic is the full kernel release, unloading returns EBUSY, and the guest boots and shuts down normally. 3. Once it passes, copy the size and SHA-256 from the step summary into `lkm_size` and `lkm_sha256` in `targets.json` and open a PR. That PR build checks both the size and the digest and fails on a mismatch. When possible, confirm the digest with an independent build. -4. After merging, run this workflow manually on `main` (Actions → Build KernelSU LKM → Run workflow) to get the `verified-ksu-lkm-` artifact, kept for 14 days. -5. Create the tag and Release named by the rules above, attach the `.ko`, `SHA256SUMS.txt`, and `.env` from the `verified-` artifact, and pin the same size and SHA-256 in ModAVDManager's KernelSU manifest. +4. After merging, wait for the package release; the module is not released on its own. **Only targets whose pins are not `null` and are merged into `main` count as validated and can be released.** Targets still pinned to `null` are not released, and the package keeps the previous tag. + +The ModAVD release script releases the module as part of the package release; Releases are not created by hand: + +1. The script tags the `main` commit `v0.N.P`. +2. The tag triggers [`release.yml`](.github/workflows/release.yml). It checks that the tag is `v0.N.P` and the commit is on `main`; skips targets pinned to `null` (and fails if all are); builds the modules with the same build workflow as above and compares them with the size and SHA-256 in `targets.json`; writes `SHA256SUMS.txt`; and creates a **draft** Release. If the tag already has a Release (draft or published), it fails instead of overwriting it. +3. After the maintainer approves the package release, the script publishes the draft, then the package. + +For a standalone release artifact (for example to recheck on a device), you can still run the build manually on `main` (Actions → Build KernelSU LKM → Run workflow) to get the `verified-ksu-lkm-` artifact, kept for 14 days. ## License and sources diff --git a/README.md b/README.md index 66bdb4c..4bbcd52 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ - `x86_64-seccomp-skip.patch` 保留内核已决定跳过的系统调用。后续重新读取系统调用号时仍保留这个结果。 - `x86_64-do_syscall_64-fallback.patch` 在 r14 缺少 `x64_sys_call` 时选用现有兼容入口,按顺序在前一份补丁之后应用。 - `disable-module-unload.patch` 禁止在线卸载。运行中的系统调用返回时仍可能经过模块代码,通过正常关闭客体移除模块。 +- `observer-release-mount-reference.patch` 修正包监听对 `/data` 挂载的占用。KernelSU 监听 `/data/system` 的变化来更新包列表,原来注册监听后一直持有这个目录的路径引用,`/data` 因此在关机时卸不掉,要等到卸载超时,关机变慢,下次开机还要回放 ext4 日志、全盘检查(ModAVD/ModAVD#309)。补丁保留监听,注册后立即释放路径引用,inode 交给 `fsnotify` 的标记持有。 在 Linux x86_64 上使用 Docker、Python 3 和 Git。准备一份完整克隆,能解析配置中 `ksu_commit` 的 KernelSU Git 仓库,将目标 ID、该仓库路径和工作目录传给 `build-target.sh`。输出在工作目录的 `<目标 ID>/out`,日志包含模块的 SHA-256 和 vermagic。 @@ -16,20 +17,28 @@ PR 构建用于验证。`targets.json` 里还没钉模块的 `lkm_sha256` 和 `l ## 发布标签和文件名 -这个目标的模块发布在本仓库的 Release `v3.3.1-a14-6.1`,附件名是 `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`。ModAVDManager 的下载地址写死了这个标签和文件名。 +模块随 ModAVD 整包一起发版,标签跟整包走。 -- 标签:`-a-<内核主次版本>`,也就是 `ksu_version` 接上 `kmi` 把 `android` 缩写成 `a` 以后的部分(`android14-6.1` → `a14-6.1`)。 -- 文件名:`<目标 ID>_kernelsu-_kernelsu.ko`,和 `verified-` 制品里的文件同名。 +- 标签:`v0.N.P`,就是带上这份模块的 ModAVD 整包版本。只在模块有变化(`targets.json`、补丁、构建脚本改了)的那一版才打;没变的版本沿用上一个标签,不重发。 +- 文件名不变:`<目标 ID>_kernelsu-_kernelsu.ko`,和 `verified-` 制品里的文件同名,比如 `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`。KernelSU 上游版本留在文件名里。每个目标另附 `<目标 ID>.env`(构建输入),再加一份覆盖全部 `.ko` 的 `SHA256SUMS.txt`。 +- 已发的 `v3.3.1-a14-6.1` 是旧规则(`-a-<内核主次版本>`)下发的,保留不动。旧规则在 KernelSU 版本不变、只改补丁时会算出同一个标签,而 Release 的附件不能替换,所以改成了现在的规则。 -换 KernelSU 版本或者加目标时按这个规则起名,并同步改 ModAVDManager 的下载地址。 +ModAVDManager 下载模块用的标签、文件名、大小和 SHA-256 跟着整包走:出了新标签,整包要同步换成新的一组(以后由整包里的 `components\kernelsu.json` 记录,管理器读不到时用内置的那份)。 ## 维护者怎么出一个新版本 -1. 改构建输入(`targets.json`、补丁、脚本)时,把 `lkm_sha256`、`lkm_size` 改回 `null`,开 PR。PR 构建通过后,在这次运行的 Actions 页面下载 `UNVERIFIED-candidate-…` 制品;step summary 里有它的大小和 SHA-256。 +1. 改构建输入(`targets.json`、补丁、脚本)时,把 `lkm_sha256`、`lkm_size` 改回 `null`,开 PR。PR 构建通过后,在这次运行的 Actions 页面下载 `UNVERIFIED-candidate-…` 制品;step summary 里有它的大小和 SHA-256。用户看得见的改动,在同一个 PR 里加一个 [`changelog.d`](changelog.d/README.md) 文件。 2. 在一次性的 r14 测试实例上验证这份候选模块:用 `modavd components import-ksu <解压出的 .ko 或文件夹> --lkm-sha256 ` 导入,然后确认能加载,vermagic 是完整的内核版本串,卸载返回 EBUSY,客体能正常开机和关机。 3. 验证通过后,把 step summary 里的大小和 SHA-256 填进 `targets.json` 的 `lkm_size`、`lkm_sha256`,开 PR。这次 PR 构建会同时比对大小和哈希,不一致就失败。有条件时另做一次独立构建,确认哈希一致。 -4. 合并后,在 `main` 上手动触发这个工作流(Actions → Build KernelSU LKM → Run workflow),得到 `verified-ksu-lkm-<目标 ID>` 制品,保留 14 天。 -5. 按上面的规则建标签和 Release,把 `verified-` 制品里的 `.ko`、`SHA256SUMS.txt` 和 `.env` 挂成附件,再把同一组大小和 SHA-256 填进 ModAVDManager 的 KernelSU 清单。 +4. 合并以后等整包发版,不单独发。**钉值不是 `null`、并且已经合进 `main` 的目标,才算验证过、可以发**;钉值还是 `null` 的目标不发,整包沿用上一个标签。 + +发版由 ModAVD 的发版脚本在整包发版时做,不手动建 Release: + +1. 脚本在 `main` 的提交上打 `v0.N.P` 标签。 +2. 标签触发 [`release.yml`](.github/workflows/release.yml):确认标签是 `v0.N.P`、提交在 `main` 上;跳过钉值是 `null` 的目标(全是 `null` 就失败);调用上面同一个构建工作流编出模块,和 `targets.json` 的大小、SHA-256 比对;生成 `SHA256SUMS.txt`,建**草稿** Release。同一个标签已经有 Release(草稿或正式)就失败,不覆盖。 +3. 维护者对整包回「发」以后,脚本把草稿转成正式,再发整包。 + +要单独拿一份正式制品(比如上机复查),仍可以在 `main` 上手动触发构建(Actions → Build KernelSU LKM → Run workflow),得到 `verified-ksu-lkm-<目标 ID>` 制品,保留 14 天。 ## 许可证和来源 diff --git a/changelog.d/309-ksu-shutdown-unmount.fix.md b/changelog.d/309-ksu-shutdown-unmount.fix.md new file mode 100644 index 0000000..31cfe84 --- /dev/null +++ b/changelog.d/309-ksu-shutdown-unmount.fix.md @@ -0,0 +1,2 @@ +启用 KernelSU 后关机不再等卸载超时,下次开机也不再检查数据分区 (ModAVD/ModAVD#309) +With KernelSU on, shutdown no longer stalls unmounting /data and the next boot skips the disk check (ModAVD/ModAVD#309) diff --git a/changelog.d/README.md b/changelog.d/README.md new file mode 100644 index 0000000..60155e3 --- /dev/null +++ b/changelog.d/README.md @@ -0,0 +1,45 @@ +# 更新说明 / Release note lines + +用户看得见的改动,在同一个 PR 里往这个文件夹加一个文件,写两行给用户看的话:第一行中文,第二行英文。ModAVD 发版时,工具把这个仓库上一版以后新加的文件汇总进 ModAVD 的发版公告:中文进分隔行以上的「更新内容」(同步到 Mirror 酱、在 AUTO-MAS 里显示),英文进分隔行以下、只在 GitHub 上显示的「What's new」,并在行尾补上这个 PR 的编号。不加文件的 PR 不会出现在公告里。 + +- **文件名**:`<名字>.<类型>.md`。名字用小写字母、数字、`-`、`_`,起一个不会和别的改动重复的(比如 issue 号加几个词:`210-resize-crash.fix.md`)。 +- **类型**:`feat` 新增,`fix` 修复,`change` 变更,`remove` 移除。 +- **内容**:正好两行,中间不空行,都不能有 `--`。写用户会看到的结果,不写原因和实现。 + - 第一行中文,不超过 60 字,比如「调高分辨率后开机不再卡死退出」。 + - 第二行英文,说同一件事,不超过 120 个字符,不能有中文字符,比如 `Starting no longer hangs after raising the resolution`。用词照[术语对照表](https://github.com/ModAVD/ModAVDManager/blob/main/internal/i18n/README.md#terms)。 + - 不会写中文的,第一行可以用机器翻译,在 PR 里说一声,由维护者在合并前改好。 +- 想让公告指向 issue 而不是 PR,就自己在第一行行尾写上,issue 都在 ModAVD 仓库,要写全称:`……不再卡死退出 (ModAVD/ModAVD#210)`;这样工具不再补 PR 编号。英文那一行没写编号的,跟着用第一行的。 +- 只和开发、测试、CI、文档有关的 PR 不用加。 +- 已经发过版的文件不要改中文那一行、也不要重复用它的名字;以后的改动另起一个文件。只有英文那一行可以补或者改。 + +例子 `210-resize-crash.fix.md`: + +``` +调高分辨率后开机不再卡死退出 (ModAVD/ModAVD#210) +Starting no longer hangs after raising the resolution +``` + +这个仓库的 CI 不查这个文件夹,发版汇总时才查;格式不对会在那时一次全报出来。汇总的工具和完整的说明在 ModAVD 仓库:[changelog.d/README.md](https://github.com/ModAVD/ModAVD/blob/main/changelog.d/README.md)、[tools/pubrel/README.md](https://github.com/ModAVD/ModAVD/blob/main/tools/pubrel/README.md)。 + +--- + +A change that users can see adds one file here, in the same pull request, with two lines written for users: Chinese first, then English. When ModAVD is released, its tools collect the files this repository gained since the previous release into the ModAVD release notes: the Chinese lines go into 更新内容 above the separator line (synced to MirrorChyan and shown in AUTO-MAS), the English lines into "What's new" below it, which only GitHub shows; the pull request number is appended to each. A pull request without a file is not announced. + +- **Name**: `..md`, the name in lowercase letters, digits, `-`, `_`, and unique (for example the issue number and a few words: `210-resize-crash.fix.md`). +- **Type**: `feat` (新增), `fix` (修复), `change` (变更), `remove` (移除). +- **Content**: exactly two lines, no blank line between them, neither with `--`. Say what users will notice, not the cause or the implementation. + - Line 1 in Chinese, at most 60 characters, for example 「调高分辨率后开机不再卡死退出」. + - Line 2 in English, saying the same thing, at most 120 characters and without Chinese characters, for example `Starting no longer hangs after raising the resolution`. Use the words of the [table of terms](https://github.com/ModAVD/ModAVDManager/blob/main/internal/i18n/README.md#terms). + - If you do not write Chinese, a machine translation is fine for line 1; say so in the pull request, and the maintainer will correct it before merging. +- To point at an issue instead of the pull request, end line 1 with it yourself, in full, since the issues are in the ModAVD repository: `…… (ModAVD/ModAVD#210)`. An English line without a number takes the one of line 1. +- Pull requests that only touch development, tests, CI or documentation need no file. +- Do not change the Chinese line of a file that has already been released, and do not reuse its name; a later change takes a new file. Only its English line may be added or changed. + +Example `210-resize-crash.fix.md`: + +``` +调高分辨率后开机不再卡死退出 (ModAVD/ModAVD#210) +Starting no longer hangs after raising the resolution +``` + +The CI of this repository does not check this folder; the files are checked when they are collected at release time, and every problem is reported then. The collecting tools and the full description are in the ModAVD repository: [changelog.d/README.md](https://github.com/ModAVD/ModAVD/blob/main/changelog.d/README.md), [tools/pubrel/README.en.md](https://github.com/ModAVD/ModAVD/blob/main/tools/pubrel/README.en.md). From cf5c844c2b26684c0a7296d1fe88041be80302f3 Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Mon, 30 Nov 2026 12:07:37 +0100 Subject: [PATCH 2/3] =?UTF-8?q?README=EF=BC=9A=E9=92=89=E5=80=BC=E4=BB=8D?= =?UTF-8?q?=E5=86=99=E5=9C=A8=E7=AE=A1=E7=90=86=E5=99=A8=20profile.go?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E7=89=88=E6=97=B6=E5=9C=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=99=A8=E5=8F=91=E7=89=88=E5=88=86=E6=94=AF=E4=B8=8A=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs ModAVD/ModAVD#341 --- README.en.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index b57ad09..461336c 100644 --- a/README.en.md +++ b/README.en.md @@ -23,7 +23,7 @@ The module is released together with the ModAVD package, and its tag follows the - File name, unchanged: `_kernelsu-_kernelsu.ko`, the same name as the file in the `verified-` artifact, for example `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`. The upstream KernelSU version stays in the file name. Each target also has `.env` (its build inputs), and one `SHA256SUMS.txt` covers all `.ko` files. - The existing `v3.3.1-a14-6.1` was released under the old rule (`-a-`) and stays as it is. The old rule gives the same tag when only the patches change and the KernelSU version does not, and Release assets cannot be replaced, so the rule was changed. -The tag, file name, size, and SHA-256 that ModAVDManager downloads follow the package: a new tag means the package switches to the new set (to be recorded in the package's `components\kernelsu.json`, with the manager's built-in set as the fallback). +The tag, file name, size, and SHA-256 that ModAVDManager downloads are pinned in the manager's `internal/kernelsu/profile.go`: a new tag means changing them on the manager's release branch for that version (in the same step as its version number), and they ship with the package. ## How maintainers publish a new version diff --git a/README.md b/README.md index 4bbcd52..0d8452b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ PR 构建用于验证。`targets.json` 里还没钉模块的 `lkm_sha256` 和 `l - 文件名不变:`<目标 ID>_kernelsu-_kernelsu.ko`,和 `verified-` 制品里的文件同名,比如 `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`。KernelSU 上游版本留在文件名里。每个目标另附 `<目标 ID>.env`(构建输入),再加一份覆盖全部 `.ko` 的 `SHA256SUMS.txt`。 - 已发的 `v3.3.1-a14-6.1` 是旧规则(`-a-<内核主次版本>`)下发的,保留不动。旧规则在 KernelSU 版本不变、只改补丁时会算出同一个标签,而 Release 的附件不能替换,所以改成了现在的规则。 -ModAVDManager 下载模块用的标签、文件名、大小和 SHA-256 跟着整包走:出了新标签,整包要同步换成新的一组(以后由整包里的 `components\kernelsu.json` 记录,管理器读不到时用内置的那份)。 +ModAVDManager 下载模块用的标签、文件名、大小和 SHA-256 写在管理器的 `internal/kernelsu/profile.go` 里:出了新标签,就在管理器这一版的发版分支上改这几个值(和改管理器版本号同一步),随整包一起发。 ## 维护者怎么出一个新版本 From 06d25e18bf5fbaff747f6cf0aa8711f0bd98f3bb Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Mon, 30 Nov 2026 12:34:27 +0100 Subject: [PATCH 3/3] =?UTF-8?q?README=EF=BC=9A=E4=BB=80=E4=B9=88=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=89=93=E6=96=B0=E6=A0=87=E7=AD=BE=EF=BC=8C=E7=85=A7?= =?UTF-8?q?=E6=95=B4=E5=8C=85=E5=86=BB=E7=BB=93=E6=97=B6=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs ModAVD/ModAVD#341 --- README.en.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index 461336c..42fe769 100644 --- a/README.en.md +++ b/README.en.md @@ -19,7 +19,7 @@ PR builds validate changes. While `lkm_sha256` and `lkm_size` are not pinned in The module is released together with the ModAVD package, and its tag follows the package. -- Tag: `v0.N.P`, the version of the ModAVD package that ships this module. A tag is made only in a release where the module changed (`targets.json`, patches, or build scripts); otherwise the package keeps the previous tag and nothing is released again. +- Tag: `v0.N.P`, the version of the ModAVD package that ships this module. A tag is made only in a release where `main` has new commits since the last release and `targets.json` on `main` pins the module (`tools/pubrel/chain-components.ps1` in ModAVD decides this at freeze); otherwise the package keeps the previous tag and nothing is released again. - File name, unchanged: `_kernelsu-_kernelsu.ko`, the same name as the file in the `verified-` artifact, for example `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`. The upstream KernelSU version stays in the file name. Each target also has `.env` (its build inputs), and one `SHA256SUMS.txt` covers all `.ko` files. - The existing `v3.3.1-a14-6.1` was released under the old rule (`-a-`) and stays as it is. The old rule gives the same tag when only the patches change and the KernelSU version does not, and Release assets cannot be replaced, so the rule was changed. diff --git a/README.md b/README.md index 0d8452b..e687837 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ PR 构建用于验证。`targets.json` 里还没钉模块的 `lkm_sha256` 和 `l 模块随 ModAVD 整包一起发版,标签跟整包走。 -- 标签:`v0.N.P`,就是带上这份模块的 ModAVD 整包版本。只在模块有变化(`targets.json`、补丁、构建脚本改了)的那一版才打;没变的版本沿用上一个标签,不重发。 +- 标签:`v0.N.P`,就是带上这份模块的 ModAVD 整包版本。上次发布以后 `main` 有新提交、并且 `targets.json` 在 `main` 上钉着模块的那一版才打(ModAVD 的 `tools/pubrel/chain-components.ps1` 在冻结时判断);其余的整包沿用上一个标签,不重发。 - 文件名不变:`<目标 ID>_kernelsu-_kernelsu.ko`,和 `verified-` 制品里的文件同名,比如 `a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko`。KernelSU 上游版本留在文件名里。每个目标另附 `<目标 ID>.env`(构建输入),再加一份覆盖全部 `.ko` 的 `SHA256SUMS.txt`。 - 已发的 `v3.3.1-a14-6.1` 是旧规则(`-a-<内核主次版本>`)下发的,保留不动。旧规则在 KernelSU 版本不变、只改补丁时会算出同一个标签,而 Release 的附件不能替换,所以改成了现在的规则。