diff --git a/.github/workflows/test-upstream-resolution-pass.yml b/.github/workflows/test-upstream-resolution-pass.yml new file mode 100644 index 000000000000..210105155b84 --- /dev/null +++ b/.github/workflows/test-upstream-resolution-pass.yml @@ -0,0 +1,153 @@ +name: Test OnePlus 13 Upstream Resolution Pass + +on: + pull_request: + branches: ["6.6-final"] + paths: + - "sync/resolutions/16.0.9.401/**" + - "scripts/resolve_merge_markers.py" + - ".github/workflows/test-upstream-resolution-pass.yml" + +permissions: + contents: read + +concurrency: + group: oneplus13-test-upstream-resolution-pass + cancel-in-progress: true + +env: + LOCAL_BRANCH: 6.6-final + OFFICIAL_REPO: https://github.com/OnePlusOSS/android_kernel_common_oneplus_sm8750.git + OFFICIAL_SHA: e1b346b6b4f4096eb342ae3684838a942fd6f6c4 + EXPECTED_INITIAL_CONFLICTS: "116" + EXPECTED_REMAINING_CONFLICTS: "85" + +jobs: + test-pass-1: + if: github.repository == 'Zhanfg/android_kernel_common_oneplus_sm8750' + runs-on: ubuntu-24.04 + timeout-minutes: 30 + + steps: + - name: Fetch base, resolution inputs and official history + env: + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + shell: bash + run: | + set -euo pipefail + + git init . + git config gc.auto 0 + git config advice.detachedHead false + git remote add local "https://github.com/${GITHUB_REPOSITORY}.git" + git remote add official "${OFFICIAL_REPO}" + + git fetch --filter=blob:none --no-tags --no-recurse-submodules local \ + "+refs/heads/${LOCAL_BRANCH}:refs/remotes/local/${LOCAL_BRANCH}" \ + "+${PR_HEAD_SHA}:refs/remotes/local/resolution-head" + git fetch --filter=blob:none --no-tags --no-recurse-submodules official \ + "+${OFFICIAL_SHA}:refs/remotes/official/pinned" + + git checkout --detach "refs/remotes/local/${LOCAL_BRANCH}" + git show "refs/remotes/local/resolution-head:scripts/resolve_merge_markers.py" \ + > /tmp/resolve_merge_markers.py + git show "refs/remotes/local/resolution-head:sync/resolutions/16.0.9.401/pass1-ours.txt" \ + > /tmp/pass1-ours.txt + chmod +x /tmp/resolve_merge_markers.py + + - name: Apply and verify pass 1 + id: resolve + shell: bash + run: | + set -euo pipefail + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + set +e + git merge --no-commit --no-ff "${OFFICIAL_SHA}" + MERGE_STATUS=$? + set -e + + git diff --name-only --diff-filter=U | LC_ALL=C sort -u > /tmp/conflicts-before.txt + BEFORE="$(awk 'END {print NR + 0}' /tmp/conflicts-before.txt)" + if [ "${MERGE_STATUS}" -eq 0 ] || [ "${BEFORE}" -eq 0 ]; then + echo "Expected a conflicted merge, but no conflicts were produced." >&2 + exit 1 + fi + if [ "${BEFORE}" != "${EXPECTED_INITIAL_CONFLICTS}" ]; then + echo "Conflict baseline drifted: expected ${EXPECTED_INITIAL_CONFLICTS}, got ${BEFORE}." >&2 + exit 1 + fi + + python3 /tmp/resolve_merge_markers.py \ + --root . \ + --paths-file /tmp/pass1-ours.txt \ + --choice ours | tee /tmp/pass1-resolver.log + + while IFS= read -r path; do + [ -n "${path}" ] || continue + git add -- "${path}" + done < /tmp/pass1-ours.txt + + git diff --name-only --diff-filter=U | LC_ALL=C sort -u > /tmp/conflicts-after.txt + AFTER="$(awk 'END {print NR + 0}' /tmp/conflicts-after.txt)" + + while IFS= read -r path; do + [ -n "${path}" ] || continue + if grep -Fxq -- "${path}" /tmp/conflicts-after.txt; then + echo "Pass-1 path remains unmerged: ${path}" >&2 + exit 1 + fi + if grep -n -E '^(<<<<<<<|=======|>>>>>>>)' -- "${path}"; then + echo "Pass-1 path still contains conflict markers: ${path}" >&2 + exit 1 + fi + done < /tmp/pass1-ours.txt + + if [ "${AFTER}" != "${EXPECTED_REMAINING_CONFLICTS}" ]; then + echo "Unexpected pass-1 result: expected ${EXPECTED_REMAINING_CONFLICTS}, got ${AFTER}." >&2 + exit 1 + fi + + : > /tmp/pass1-resolved-files.patch + while IFS= read -r path; do + [ -n "${path}" ] || continue + git diff --cached --binary HEAD -- "${path}" >> /tmp/pass1-resolved-files.patch + done < /tmp/pass1-ours.txt + + { + echo "# OnePlus 13 16.0.9.401 resolution pass 1" + echo + echo "- Local SHA: \`$(git rev-parse HEAD)\`" + echo "- Official SHA: \`${OFFICIAL_SHA}\`" + echo "- Initial conflict paths: ${BEFORE}" + echo "- Resolved paths: $((BEFORE - AFTER))" + echo "- Remaining conflict paths: ${AFTER}" + echo + echo "Pass 1 replaced only marked conflict blocks in 31 verified paths." + echo "Clean official hunks outside those blocks remain applied." + } > /tmp/pass1-report.md + + cat /tmp/pass1-report.md >> "${GITHUB_STEP_SUMMARY}" + echo "remaining=${AFTER}" >> "${GITHUB_OUTPUT}" + git merge --abort 2>/dev/null || true + + - name: Upload pass-1 evidence + uses: actions/upload-artifact@v4 + with: + name: oneplus13-common-resolution-pass1-${{ github.run_id }} + path: | + /tmp/pass1-report.md + /tmp/pass1-resolver.log + /tmp/pass1-resolved-files.patch + /tmp/conflicts-before.txt + /tmp/conflicts-after.txt + if-no-files-found: error + retention-days: 30 + + - name: Keep integration blocked while conflicts remain + if: steps.resolve.outputs.remaining != '0' + run: | + echo "Pass 1 is reproducible, but unresolved conflicts remain. No merge branch was pushed." + exit 1 diff --git a/README.md b/README.md index fea0cc313d24..36528ee66a53 100644 --- a/README.md +++ b/README.md @@ -9,92 +9,134 @@ | 角色 | 仓库 / 分支 | 说明 | |---|---|---| | 项目控制仓库 | [`Zhanfg/OnePlus13-kernel`](https://github.com/Zhanfg/OnePlus13-kernel) / `main` | 构建、补丁、AK3、测试、发布与文档 | -| 本仓库 | `Zhanfg/android_kernel_common_oneplus_sm8750` / `6.6-final` | common 层自定义补丁和开发历史 | -| 官方 manifest | [`OnePlusOSS/kernel_manifest`](https://github.com/OnePlusOSS/kernel_manifest) / `oneplus/sm8750` | 完整 OKI 工程入口,使用 `oneplus_13_b.xml` | -| 官方 common | [`OnePlusOSS/android_kernel_common_oneplus_sm8750`](https://github.com/OnePlusOSS/android_kernel_common_oneplus_sm8750) / `oneplus/sm8750_b_16.0.0_oneplus_13` | common 官方上游 | -| 官方 msm-kernel | [`OnePlusOSS/android_kernel_oneplus_sm8750`](https://github.com/OnePlusOSS/android_kernel_oneplus_sm8750) | 平台内核与 OnePlus/OPlus 代码 | +| 本仓库 | `Zhanfg/android_kernel_common_oneplus_sm8750` / `6.6-final` | common 层自定义补丁与开发历史 | +| 官方 manifest | [`OnePlusOSS/kernel_manifest`](https://github.com/OnePlusOSS/kernel_manifest) / `oneplus/sm8750` | 完整 OKI 入口,使用 `oneplus_13_b.xml` | +| 官方 common | [`OnePlusOSS/android_kernel_common_oneplus_sm8750`](https://github.com/OnePlusOSS/android_kernel_common_oneplus_sm8750) | common 官方上游 | +| 官方 msm-kernel | [`OnePlusOSS/android_kernel_oneplus_sm8750`](https://github.com/OnePlusOSS/android_kernel_oneplus_sm8750) | Qualcomm / OnePlus 平台代码 | | 官方 modules / DT | [`OnePlusOSS/android_kernel_modules_and_devicetree_oneplus_sm8750`](https://github.com/OnePlusOSS/android_kernel_modules_and_devicetree_oneplus_sm8750) | vendor modules 与设备树 | -完整工程还需要 manifest 固定的 CodeLinaro、Kleaf/Bazel、工具链和其他依赖。 - -## 当前基线与差异 +## 当前官方基线 最后核对:**2026-07-29**。 | 项目 | 当前值 | |---|---| -| 设备系统 | `PJZ110_16.0.9.401(CN01)` | -| Manifest | `OnePlusOSS/kernel_manifest:oneplus/sm8750` | -| Manifest 文件 | `oneplus_13_b.xml` | -| 官方 common 提交 | `e1b346b6b4f4096eb342ae3684838a942fd6f6c4` | +| 设备版本 | `PJZ110_16.0.9.401(CN01)` | +| Manifest | `oneplus/sm8750` + `oneplus_13_b.xml` | +| 官方 common | `e1b346b6b4f4096eb342ae3684838a942fd6f6c4` | | 官方 common 版本 | Linux `6.6.118` / `android15-6.6-2026-01_r22` | -| 官方 msm-kernel 提交 | `6028f47faddaa27700f8dd3a1d83906ea8f27170` | -| 官方 modules / DT 提交 | `d50b305f7da9e14715a25120a4ac7b1a4b8b97c3` | -| 本地开发分支 | `6.6-final` | -| 本地 common 版本 | Linux `6.6.126` | -| 共同祖先 | `5a0ffb447c1dbd82e8e3af7a98c4a629f4b6d143` | -| 本地相对官方 | 领先 8,947 commits,落后 5 official commits | - -这里存在两套不同含义的版本: - -- **官方设备基线**:OnePlus 13 `16.0.9.401`,common Makefile 为 Linux 6.6.118。 -- **本地 common 开发基线**:`6.6-final`,Makefile 已推进到 Linux 6.6.126,并包含大量自定义补丁。 +| 官方 msm-kernel | `6028f47faddaa27700f8dd3a1d83906ea8f27170` | +| 官方 modules / DT | `d50b305f7da9e14715a25120a4ac7b1a4b8b97c3` | +| 本地分支 | `6.6-final` / Linux `6.6.126` | -因此不能通过整树覆盖把官方 6.6.118 直接写入本地 6.6.126,也不能把本次同步描述为普通内核版本升级。正确工作是把官方设备、安全、ABI 和 Android common 更新移植到当前自定义基线上。 +本地版本号高于官方 common,并不表示已经包含 OnePlus 16.0.9.401 的全部设备、ABI 和厂商改动。本轮工作是把官方变更移植到较新的自定义 common 基线上,不能以官方 6.6.118 整树覆盖本地 6.6.126。 -## 当前上游同步状态 +## 官方同步状态 -官方跟踪分支: +官方镜像分支: ```text upstream/oneplus-sm8750-b-16.0.0-oneplus-13 +e1b346b6b4f4096eb342ae3684838a942fd6f6c4 ``` -该分支已精确镜像官方提交 `e1b346b6b4f4096eb342ae3684838a942fd6f6c4`。 - 同步候选: ```text -PR #6: chore: 同步 OnePlus 13 官方 common 16.0.9.401 +PR #6 branch: sync/official-16.0.9.401-e1b346b6b -status: Draft / conflicts +status: Draft / conflicts / not merged +``` + +已确认关系: + +| 项目 | 结果 | +|---|---| +| 共同祖先 | `5a0ffb447c1dbd82e8e3af7a98c4a629f4b6d143` | +| 本地领先 | 8,947 commits | +| 本地落后 | 5 official commits | +| 直接 Git merge | 116 个 unresolved index paths | + +早期 80 个数字来自截断的 merge-tree 报告。使用真实 merge 并检查 index stage 后,权威结果为 **116**。 + +冲突分布: + +| 类别 | 数量 | +|---|---:| +| 驱动 | 29 | +| 文件系统 | 17 | +| 内核核心 | 15 | +| 头文件与 hooks | 13 | +| 网络 | 12 | +| ABI/KMI/AFDO | 10 | +| 架构与配置 | 8 | +| 音频 | 6 | +| 根目录与其他 | 6 | + +完整路径和处理顺序见 [`docs/UPSTREAM_SYNC_16.0.9.401.md`](docs/UPSTREAM_SYNC_16.0.9.401.md)。 + +## 调度架构阻塞 + +官方 16.0.9.401 使用: + +```text +CONFIG_SLIM_SCHED=y +CONFIG_SCHED_CLASS_EXT=y +SCHED_EXT=7 ``` -实际 `merge-tree` 核验发现 **80 个冲突路径**。主要分布: +本地分支使用: -- `drivers/`:29 -- `fs/`:17 -- `include/`:13 -- `android/` ABI/KMI/AFDO:10 -- `arch/`:8 -- 根目录与文档:3 +```text +CONFIG_HMBIRD_SCHED=y +SCHED_HMBIRD=7 +``` -完整冲突清单和处理顺序见 [`docs/UPSTREAM_SYNC_16.0.9.401.md`](docs/UPSTREAM_SYNC_16.0.9.401.md)。在冲突、完整 OKI 构建和真机验收完成前,PR #6 必须保持 Draft。 +HMBIRD 与官方 SCX 占用同一个策略编号,并改写同一批 fork、tick、pick-next、setscheduler、cgroup 和 idle 接口,因此当前不能直接共存。 -## 自动上游核验 +在解决以下问题前,不得把 README 中的“SCX 与 HMBIRD 可并存”当作已验证事实: -工作流: +- 调度策略编号 +- `kernel/sched/core.c` 的 28 个冲突块 +- fork / cancel / post-fork 接口 +- tick、idle、class iteration 与 cgroup 接口 +- `gki_defconfig` 中 HMBIRD、SLIM 和 SCX 的配置关系 + +## 第一轮解决进度 + +第一轮已建立可审计规则: ```text -.github/workflows/sync-upstream.yml -.github/workflows/verify-upstream-pr.yml +sync/resolutions/16.0.9.401/pass1-ours.txt +scripts/resolve_merge_markers.py +.github/workflows/test-upstream-resolution-pass.yml ``` -行为: +该轮处理 31 个路径。规则不是整文件选择 ours,而是: + +1. 先让 Git 合入所有无冲突的官方 hunk。 +2. 仅替换指定文件中的冲突标记块为本地段。 +3. 保留冲突块之外的官方改动。 +4. 检查文件不再含 marker,且不再处于 unmerged index。 +5. 预期把冲突路径从 116 降至 85。 +6. 仍不创建最终 merge commit,不推送可合并源码分支。 -1. 使用 blobless 历史获取和稀疏工作树,避免完整检出大型 common 仓库。 -2. 获取官方 common 最新提交。 -3. 更新独立官方跟踪分支。 -4. 检查共同祖先和提交差异。 -5. 使用非破坏性的 `git merge-tree` 检查文本冲突。 -6. 只有无冲突时才允许建立普通合并候选。 -7. 永不自动覆盖或合并 `6.6-final`。 +调度、ABI/KMI、AFDO、F2FS 核心和设备接口等高风险项不在第一轮机械处理范围内。 + +## 自动化 + +| 工作流 | 用途 | +|---|---| +| `sync-upstream.yml` | 官方 common 镜像和候选检查 | +| `verify-upstream-pr.yml` | PR 可见的共同祖先与 merge-tree 核验 | +| `export-upstream-conflicts.yml` | 导出 base / ours / theirs / conflict-marker 四方文件 | +| `test-upstream-resolution-pass.yml` | 重放并验证分阶段解决规则 | -详细规则见 [`UPSTREAM.md`](UPSTREAM.md)。 +自动化只拉取必要 ref,使用 blobless Git 获取。它不会自动覆盖或合并 `6.6-final`。 -## 正确的完整构建方式 +## 正确构建方式 -本仓库不提供独立正式构建入口。完整构建应在 OnePlusOSS OKI 工作区中进行: +完整构建必须从 OnePlusOSS manifest 开始: ```bash repo init \ @@ -108,19 +150,21 @@ repo manifest -r -o manifest-pinned.xml ./kernel_platform/oplus/build/oplus_build_kernel.sh sun perf ``` -测试本仓库改动时,应在固定 manifest 的完整工作区内,将 `kernel_platform/common` 指向经过审核的本仓库提交,再执行 clean build。 +测试本仓库改动时,应在固定 manifest 的完整 OKI 工作区中,将 `kernel_platform/common` 指向经过审核的提交,再执行 clean build。 -## 合并前检查 +## 合并前要求 -- [ ] 80 个冲突逐文件解决并记录理由 -- [ ] 保存完整 `manifest-pinned.xml` +- [ ] 116 个冲突全部逐文件解决并记录理由 +- [ ] HMBIRD / SCX / SLIM 调度架构确定并完成移植 +- [ ] 固定 `manifest-pinned.xml` - [ ] common、msm-kernel、modules / DT revision 匹配 -- [ ] ABI/KMI、OPlus symbol list 和 AFDO 检查通过 +- [ ] ABI/KMI、OPlus symbol list、AFDO 通过 - [ ] `oplus_build_kernel.sh sun perf` clean build 成功 - [ ] Image、vendor_boot、vendor modules 与 vermagic 匹配 -- [ ] OnePlus 13 / 对应 ColorOS 可重复启动和回退 -- [ ] 蜂窝、Wi-Fi、蓝牙、相机、指纹、充电、温控和休眠通过测试 -- [ ] Root、SuSFS、KPM、wait/HMBIRD/SCX 和网络功能通过测试 +- [ ] OnePlus 13 可重复启动、重启和回退 +- [ ] 蜂窝、Wi-Fi、蓝牙、相机、指纹正常 +- [ ] 充电、电池状态、温控、灭屏和深度休眠正常 +- [ ] Root、SuSFS、KPM、wait/HMBIRD/SCX 与网络栈完成验证 ## 分支策略 @@ -128,23 +172,25 @@ repo manifest -r -o manifest-pinned.xml |---|---| | `6.6-final` | 当前自定义 common 开发基线 | | `upstream/oneplus-sm8750-b-16.0.0-oneplus-13` | 官方 common 只读镜像 | -| `sync/official-*` / `sync/upstream-*` | 固定官方提交的同步候选 | +| `sync/official-*` | 固定官方 SHA 的同步候选 | +| `sync/resolution-*` | 分阶段冲突解决规则与验证 | | `fix/*` | 单一问题修复 | | `feature/*` | 独立功能开发 | ## 禁止事项 - 不把本仓库当作完整 OKI 工程。 -- 不直接把单独编译的 Image 标记为可刷写稳定包。 -- 不使用 `ours`、整树覆盖或删除冲突代码伪造同步成功。 +- 不直接把单独编译的 Image 标记为稳定刷写包。 +- 不使用 `ours` merge strategy、整树覆盖或批量选择一侧。 +- 不通过删除 ABI、symbol list、vendor hooks 或配置消除冲突。 - 不把空 Kconfig / Makefile stub 构建当作正式产物。 - 不在未核对 vendor_boot、vendor modules 和 ABI 时刷入。 - 不提交 Token、Cookie、密钥、账号、设备序列号、未脱敏日志或本机绝对路径。 ## 验证等级 -- **Experimental**:源码可合并或可编译,但未完成真机启动。 -- **Boot Verified**:指定 PJZ110 / ColorOS 版本可以重复启动并可回退。 +- **Experimental**:源码可合并、可静态检查或可打包,但未完成真机启动。 +- **Boot Verified**:指定 PJZ110 / ColorOS 可以重复启动并可回退。 - **Runtime Verified**:关键硬件与内核功能通过测试。 - **Stable**:完成重复刷写、重启、待机和基础回归。 diff --git a/UPSTREAM.md b/UPSTREAM.md index b559117546fb..40cd8b980fd8 100644 --- a/UPSTREAM.md +++ b/UPSTREAM.md @@ -2,7 +2,7 @@ 更新时间:2026-07-29 -## 1. 主要官方上游 +## 1. 官方上游 ```text Repository: OnePlusOSS/android_kernel_common_oneplus_sm8750 @@ -10,25 +10,21 @@ Branch: oneplus/sm8750_b_16.0.0_oneplus_13 Tracking branch: upstream/oneplus-sm8750-b-16.0.0-oneplus-13 ``` -2026-07-29 核对到的官方发布: +当前核对发布: -```text -Device release: PJZ110_16.0.9.401(CN01) -Android common tag: android15-6.6-2026-01_r22 -``` - -完整 OnePlusOSS 核心组件: - -| 组件 | 分支 | 核对提交 | -|---|---|---| -| common | `oneplus/sm8750_b_16.0.0_oneplus_13` | `e1b346b6b4f4096eb342ae3684838a942fd6f6c4` | -| msm-kernel | `oneplus/sm8750_b_16.0.0_oneplus_13` | `6028f47faddaa27700f8dd3a1d83906ea8f27170` | -| modules / devicetree | `oneplus/sm8750_b_16.0.0_oneplus_13` | `d50b305f7da9e14715a25120a4ac7b1a4b8b97c3` | -| manifest | `oneplus/sm8750` / `oneplus_13_b.xml` | 正式构建以 `repo manifest -r` 固定结果为准 | +| 项目 | 当前值 | +|---|---| +| 设备版本 | `PJZ110_16.0.9.401(CN01)` | +| common SHA | `e1b346b6b4f4096eb342ae3684838a942fd6f6c4` | +| common 版本 | Linux `6.6.118` | +| Android common tag | `android15-6.6-2026-01_r22` | +| msm-kernel SHA | `6028f47faddaa27700f8dd3a1d83906ea8f27170` | +| modules / DT SHA | `d50b305f7da9e14715a25120a4ac7b1a4b8b97c3` | +| Manifest | `OnePlusOSS/kernel_manifest:oneplus/sm8750` / `oneplus_13_b.xml` | -这些 SHA 只表示核对时各官方分支的 tip。正式构建必须保存 `OnePlusOSS/kernel_manifest:oneplus/sm8750` 下 `oneplus_13_b.xml` 对应的固定 revision manifest。 +正式构建必须保存 `repo manifest -r` 生成的固定 revision manifest。浮动分支 tip 不能代替可复现版本记录。 -## 2. 当前同步状态 +## 2. 本地与官方关系 | 项目 | 当前结果 | |---|---| @@ -38,105 +34,133 @@ Android common tag: android15-6.6-2026-01_r22 | 共同祖先 | `5a0ffb447c1dbd82e8e3af7a98c4a629f4b6d143` | | 本地领先 | 8,947 commits | | 本地落后 | 5 official commits | -| 官方镜像分支 | 已更新到 `e1b346b6b4f4096eb342ae3684838a942fd6f6c4` | -| 同步候选 | PR `#6` / Draft | -| 文本冲突 | 80 个路径 | +| 固定同步候选 | `sync/official-16.0.9.401-e1b346b6b` | +| 同步 PR | `#6` / Draft | +| 权威冲突路径 | **116 个** | -官方 16.0.9.401 与本地 `6.6-final` 存在共同祖先,但不是普通快进。本地 common 已经推进到 6.6.126,而官方设备树仍以 6.6.118 为版本号。本次工作是将官方设备、安全、ABI 和 Android common 更新移植到本地较新内核基线上,不得通过整树覆盖完成。 +116 个数字来自真实 `git merge --no-commit --no-ff` 后对 unmerged index 的检查。早期 80 个数字来自截断的 merge-tree 输出,已经废止。 -完整冲突清单、风险分类和处理顺序见: +本次同步不是普通版本升级。必须把 OnePlus/OPlus 设备、安全、ABI 和 Android common 更新移植到本地较新的 6.6.126 common 基线上,不能用官方 6.6.118 整树覆盖。 + +完整冲突清单: ```text docs/UPSTREAM_SYNC_16.0.9.401.md ``` -在 80 个冲突、完整 OKI clean build、ABI/KMI 和真机验收完成前,PR `#6` 必须保持 Draft。 - -## 3. 完整工程依赖 +## 3. 完整 OKI 依赖 -本仓库只对应 `kernel_platform/common`。上游审核时还必须同步检查: +本仓库只对应 `kernel_platform/common`。任何同步和发布还必须检查: - `OnePlusOSS/android_kernel_oneplus_sm8750` - `OnePlusOSS/android_kernel_modules_and_devicetree_oneplus_sm8750` - `OnePlusOSS/kernel_manifest` -- manifest 固定的 CodeLinaro、Kleaf/Bazel、工具链与模块依赖 - -不能只更新 common 后直接发布。 - -## 4. 自动工作流行为 - -`.github/workflows/sync-upstream.yml` 与 `.github/workflows/verify-upstream-pr.yml` 会: - -1. 使用 blobless 历史获取和稀疏工作树,避免完整检出大型 common 仓库。 -2. 获取官方 common 分支。 -3. 将官方 tip 强制同步到独立跟踪分支。 -4. 记录本地 SHA、官方 SHA、内核版本和共同祖先。 -5. 使用非破坏性的 `git merge-tree` 检查冲突。 -6. 只有不存在文本冲突时才允许建立普通合并候选。 -7. 无共同祖先或出现冲突时停止,不创建误导性自动合并结果。 -8. 上传 Markdown 报告并写入 Actions Summary。 -9. 永不直接修改或自动合并 `6.6-final`。 - -跟踪分支的强制更新是预期行为,因为它只镜像官方浮动分支;本地开发提交不得放入该分支。正式同步应使用固定 SHA 的 `sync/official-*` 分支。 - -## 5. 合并原则 - -1. 上游同步必须使用独立 Draft PR。 -2. 不使用 `git merge -s ours`、整树覆盖或删除冲突文件。 -3. 设备、ABI、安全和构建修复应先理解官方意图,再移植本地功能。 -4. 本地补丁按功能组保留清晰提交边界。 -5. 每次合并记录: - - 官方 common SHA - - 完整固定 manifest - - 本地基线 SHA - - 本地与官方内核版本 - - 冲突文件和处理方式 - - 工具链与构建结果 - - 真机验证结果 -6. 未完成 Boot Verified 前不得进入 Stable 发布。 - -## 6. 冲突处理顺序 - -1. `Makefile`、版本号与 Android common tag -2. ABI / KMI / symbol list / AFDO -3. common 与 msm-kernel 接口 -4. vendor modules / device tree 依赖 -5. `gki_defconfig`、Kleaf / Bazel 和工具链 -6. Root / ReSukiSU / SuSFS / KPM -7. 调度器、task / scheduler 与 vendor hooks -8. ZRAM、内存、I/O、F2FS 和 EXT4 -9. USB / Type-C / IOMMU / 电源与设备驱动 -10. 网络、BBR、Netfilter、WireGuard -11. Baseband Guard、省电和其他功能 -12. 非必要编译优化 - -调度器、`task_struct`、RCU、内存生命周期、文件系统、ABI 和网络栈冲突必须逐项审查,不能以“编译通过”替代运行时正确性。 - -## 7. 完整验证 +- manifest 固定的 CodeLinaro、Kleaf/Bazel、工具链和模块依赖 +- Image、vendor_boot、vendor modules、DT/DTBO、ABI/KMI 与 vermagic + +只更新 common 后直接发布属于不完整构建。 + +## 4. 调度架构要求 + +官方 16.0.9.401 启用 `CONFIG_SCHED_CLASS_EXT` / SCX 和 `CONFIG_SLIM_SCHED`,使用 `SCHED_EXT=7`。 + +本地 HMBIRD 使用 `CONFIG_HMBIRD_SCHED` 和 `SCHED_HMBIRD=7`,并改写同一组调度公共接口。 + +因此: + +1. HMBIRD 与官方 SCX 当前不能简单同时启用。 +2. `kernel/sched/core.c` 的 28 个冲突块不能批量选择一侧。 +3. 必须明确采用 HMBIRD 保留、官方 SCX 恢复或双实现重构方案。 +4. 在代码和真机验证完成前,不得声明 HMBIRD/SCX 已可共存。 +5. wait 与风驰的运行时策略关系必须与 SCX 架构问题分开说明。 + +## 5. 自动化 + +| 工作流 | 职责 | +|---|---| +| `.github/workflows/sync-upstream.yml` | 镜像官方 tip,检查普通合并候选 | +| `.github/workflows/verify-upstream-pr.yml` | PR 可见的共同祖先和 merge-tree 核验 | +| `.github/workflows/export-upstream-conflicts.yml` | 导出 base / ours / theirs / conflict-marker 四方文件 | +| `.github/workflows/test-upstream-resolution-pass.yml` | 重放并验证分阶段解决规则 | + +自动化要求: + +- 只拉取必要 ref,使用 blobless Git 获取。 +- 官方镜像分支可以强制更新,但不得承载本地开发提交。 +- 固定同步候选必须使用不可变官方 SHA。 +- 不自动修改或合并 `6.6-final`。 +- 有冲突时上传报告并保持 PR Draft。 + +## 6. 分阶段解决 + +### Pass 1 + +```text +sync/resolutions/16.0.9.401/pass1-ours.txt +scripts/resolve_merge_markers.py +``` + +第一轮包含 31 个已核验路径。处理方式不是整文件 checkout ours,而是仅将冲突标记块替换为本地段,同时保留 Git 已自动合入的官方无冲突 hunk。 + +预期结果: + +```text +116 initial conflicts +31 resolved paths +85 remaining conflicts +``` + +该轮不处理调度架构、核心 ABI/KMI、AFDO 和其他需要语义设计的高风险冲突。 + +### 后续 Pass + +建议按以下顺序建立独立解决清单: + +1. Makefile / version / tag +2. ABI/KMI、OPlus symbols、protected exports、AFDO +3. HMBIRD / SCX / SLIM 调度架构 +4. `gki_defconfig`、Kleaf/Bazel 与工具链 +5. task/fork/tick、内存和 vendor hooks +6. F2FS、EXT4、ZRAM 与文件系统 hooks +7. USB、Type-C、IOMMU、电源与设备驱动 +8. 网络与音频 + +每个 Pass 必须可重复运行,输出解决前后冲突计数,并在仍有冲突时禁止生成最终 merge commit。 + +## 7. 合并原则 + +1. 上游同步只通过独立 Draft PR。 +2. 不使用 `git merge -s ours`。 +3. 不整树或批量选择 ours/theirs。 +4. 不通过删除 ABI、symbol list、vendor hooks 或配置项消除冲突。 +5. 所有解决必须保留来源、理由和可回退提交边界。 +6. 非冲突官方 hunk 应保留,除非有明确回退理由。 +7. 未完成完整 OKI clean build 和 Boot Verified 前不得进入 Stable。 + +## 8. 完整验证 ### 源码与构建 -- [ ] 80 个冲突逐文件解决并记录理由 +- [ ] 116 个冲突逐文件解决并记录理由 +- [ ] 调度架构和策略编号冲突解决 - [ ] `repo manifest -r` 已保存 - [ ] common / msm-kernel / modules / DT revision 匹配 - [ ] 无空 stub 或缺失组件绕过 - [ ] `oplus_build_kernel.sh sun perf` clean build 成功 -- [ ] Image、vendor_boot、vendor modules 版本匹配 -- [ ] ABI / KMI、OPlus symbol list 和 AFDO 检查通过 +- [ ] ABI/KMI、OPlus symbol list、AFDO 检查通过 +- [ ] Image、vendor_boot、vendor modules 与 vermagic 匹配 ### 真机 -- [ ] 可重复启动和重启 -- [ ] Fastboot / Recovery 回退可用 -- [ ] 蜂窝、移动数据、VoLTE / IMS 基础功能 -- [ ] Wi-Fi、蓝牙 -- [ ] 相机、指纹 +- [ ] 可重复启动、重启和回退 +- [ ] 蜂窝、移动数据、VoLTE / IMS +- [ ] Wi-Fi、蓝牙、相机、指纹 - [ ] 充电、电池状态、温控 - [ ] 灭屏、深度休眠、唤醒 - [ ] Root、SuSFS、KPM -- [ ] 默认 wait 与可选 HMBIRD / SCX 路径 -- [ ] 网络栈、VPN / TUN、WireGuard +- [ ] wait、HMBIRD/风驰、SCX 的实际启用路径 +- [ ] 网络栈、VPN/TUN、WireGuard -## 8. 回退 +## 9. 回退 -上游同步必须保持单独 PR 和提交边界。真机失败时优先整体回退同步 PR,再按功能组拆分定位;不要在 `6.6-final` 上连续追加无法追踪的临时修补。 +上游同步必须保持独立 PR 和分阶段提交。若构建或真机验证失败,优先回退对应 Pass 或整个同步 PR,不在 `6.6-final` 上连续追加无法追踪的临时修补。 diff --git a/docs/UPSTREAM_SYNC_16.0.9.401.md b/docs/UPSTREAM_SYNC_16.0.9.401.md index 7e334a81a415..0be4d7e58c8e 100644 --- a/docs/UPSTREAM_SYNC_16.0.9.401.md +++ b/docs/UPSTREAM_SYNC_16.0.9.401.md @@ -7,41 +7,112 @@ | 项目 | 结果 | |---|---| | 本地分支 | `6.6-final` | -| 本地提交 | `83026e393bfba415d829516dcb6886d5070a12ed` | -| 本地 Makefile 版本 | Linux `6.6.126` | +| 权威导出基线 | `8c8a5eede0ae990b1672ea3d28ce4058e3cd8dc2` | +| 本地内核代码基线 | Linux `6.6.126` | | 官方版本 | `PJZ110_16.0.9.401(CN01)` | | 官方 common 提交 | `e1b346b6b4f4096eb342ae3684838a942fd6f6c4` | -| 官方 Makefile 版本 | Linux `6.6.118` | +| 官方 common 版本 | Linux `6.6.118` | | Android common tag | `android15-6.6-2026-01_r22` | | 共同祖先 | `5a0ffb447c1dbd82e8e3af7a98c4a629f4b6d143` | | 本地领先 | 8,947 commits | | 本地落后 | 5 official commits | -| 文本合并 | 有冲突 | -| 冲突路径 | 80 个 | -| 同步候选 PR | `#6`,保持 Draft | +| 直接 Git merge | 有冲突 | +| 权威冲突路径 | **116 个** | +| 同步候选 | PR `#6`,保持 Draft | -本地分支与官方分支存在共同祖先,但二者不是简单快进关系。本地 common 已经推进到 Linux 6.6.126,并包含大量自定义改动;官方 OnePlus 16.0.9.401 common 仍以 Linux 6.6.118 为版本号。因此本次工作不能描述为普通的“升级内核版本”,而是将 OnePlus/OPlus 官方设备与 Android common 更新移植到较新的自定义 common 基线上。 +之前记录的 80 个冲突来自截断的 `merge-tree` 文本报告,漏掉了 `kernel/`、`net/`、`sound/`、`init/`、`lib/` 和 `mm/` 下的路径。2026-07-29 使用真实: + +```bash +git merge --no-commit --no-ff e1b346b6b4f4096eb342ae3684838a942fd6f6c4 +git diff --name-only --diff-filter=U +``` + +并导出 Git index stage 1/2/3 后,确认权威结果为 **116 个 unresolved index paths**。后续所有文档和验收均以 116 为准。 + +本地分支与官方分支存在共同祖先,但不是简单快进。本地 common 已推进到 Linux 6.6.126 并包含大量自定义改动;官方 OnePlus 16.0.9.401 common 仍以 Linux 6.6.118 为版本号。本次工作是将官方设备、安全、ABI 与 Android common 更新移植到较新的自定义 common 基线上,不能整树覆盖。 ## 2. 冲突统计 | 类别 | 数量 | 主要风险 | |---|---:|---| -| `drivers/` | 29 | USB、Type-C、IOMMU、蓝牙、NVMe、网络与电源驱动 | -| `fs/` | 17 | F2FS、EXT4、BTRFS、NTFS3、SMB/NFSD | +| `drivers/` | 29 | USB、Type-C、IOMMU、蓝牙、NVMe、网络、电源与平台驱动 | +| `fs/` | 17 | F2FS、EXT4、BTRFS、NTFS3、SMB、NFSD | +| `kernel/` | 15 | 调度、fork、tick、events、power、printk | | `include/` | 13 | 调度、内存、vendor hooks、ABI 接口 | -| `android/` | 10 | ABI/KMI、AFDO、protected exports | -| `arch/` | 8 | ARM64 BPF、x86/mips/loongarch 修复与配置 | -| 其他 | 3 | `Makefile`、`.gitignore`、F2FS ABI 文档 | +| `net/` | 12 | MPTCP、Open vSwitch、CAKE/ETS、ESP、vsock、wireless | +| `android/` | 10 | ABI/KMI、OPlus symbol list、AFDO、protected exports | +| `arch/` | 8 | ARM64 配置/BPF、x86、MIPS、LoongArch | +| `sound/` | 6 | PCM、USB audio、HDA、AMD SoC audio | +| 根目录 | 2 | `.gitignore`、`Makefile` | +| 其他 | 4 | Documentation、init、lib、mm | +| **合计** | **116** | — | + +5 个官方同步提交覆盖约 3,830 个文件,不能按“只差 5 个提交”低估风险。 + +## 3. 调度架构阻塞 + +官方 16.0.9.401 引入并启用: + +```text +CONFIG_SLIM_SCHED=y +CONFIG_SCHED_CLASS_EXT=y +SCHED_EXT=7 +``` + +本地分支使用: + +```text +CONFIG_HMBIRD_SCHED=y +SCHED_HMBIRD=7 +``` + +两者占用同一个用户态调度策略编号 `7`,并同时改写: + +- fork / cancel / post-fork +- scheduler tick +- pick-next / active class iteration +- setscheduler / policy validation +- cgroup 属性 +- idle 通知 +- debugfs 与调度状态输出 +- `kernel/sched/core.c`、`sched.h`、`build_policy.c` 等公共接口 + +因此 HMBIRD/风驰与官方 SCX 不能通过简单同时打开配置实现共存。`kernel/sched/core.c` 单文件包含 28 个冲突块,是本轮最高风险项。 + +在继续前必须选择并实现一种明确架构: + +1. **HMBIRD 保留方案**:保留本地 HMBIRD,官方 SCX 代码存在但禁用;逐项移植官方非 SCX 修复。 +2. **官方 SCX 方案**:恢复官方 `SCHED_CLASS_EXT`,重新移植 HMBIRD/风驰为独立可选层,解决 policy ID 与接口冲突。 +3. **双实现方案**:重新分配策略编号并重构公共 fork/tick/class 接口。风险最高,不应在同一个大提交中完成。 -冲突数量不能用“只落后 5 个提交”来低估。这 5 个官方同步提交本身覆盖约 3,830 个文件。 +当前不允许把 README 中“SCX 与 HMBIRD 已可共存”视为已验证事实。 -## 3. 完整冲突路径 +## 4. 第一轮可审计解决 + +`sync/resolutions/16.0.9.401/pass1-ours.txt` 列出 31 个路径。核验表明这些文件的官方 base-to-16.0.9.401 变化已经存在于本地 6.6.126 文件中,或已由更新实现替代。 + +第一轮不是执行整文件 `git checkout --ours`,而是: + +- 保留 Git 已自动合入的所有官方非冲突 hunk; +- 仅把标记冲突块替换为本地段; +- 对每个路径执行 conflict-marker 和 unmerged-index 检查; +- 预期将冲突路径从 116 降至 85; +- 不生成最终 merge commit,不推送源码集成分支。 + +对应脚本: + +```text +scripts/resolve_merge_markers.py +.github/workflows/test-upstream-resolution-pass.yml +``` + +## 5. 完整冲突路径 ### 根目录与文档 - `.gitignore` -- `Makefile` - `Documentation/ABI/testing/sysfs-fs-f2fs` +- `Makefile` ### ABI / KMI / AFDO @@ -135,36 +206,85 @@ - `include/trace/hooks/vmscan.h` - `include/uapi/linux/sched.h` -## 4. 处理优先级 +### 内核核心 + +- `init/Kconfig` +- `kernel/Kconfig.preempt` +- `kernel/events/callchain.c` +- `kernel/events/core.c` +- `kernel/fork.c` +- `kernel/power/process.c` +- `kernel/printk/printk.c` +- `kernel/sched/build_policy.c` +- `kernel/sched/core.c` +- `kernel/sched/cpufreq_schedutil.c` +- `kernel/sched/debug.c` +- `kernel/sched/fair.c` +- `kernel/sched/idle.c` +- `kernel/sched/sched.h` +- `kernel/sched/vendor_hooks.c` +- `kernel/time/tick-sched.c` +- `lib/zstd/zstd_compress_module.c` +- `mm/migrate.c` + +### 网络 + +- `net/core/dst.c` +- `net/ipv4/esp4_offload.c` +- `net/ipv6/esp6_offload.c` +- `net/mptcp/protocol.c` +- `net/mptcp/subflow.c` +- `net/openvswitch/flow_netlink.c` +- `net/sched/act_ife.c` +- `net/sched/sch_cake.c` +- `net/sched/sch_ets.c` +- `net/unix/garbage.c` +- `net/vmw_vsock/virtio_transport_common.c` +- `net/wireless/sme.c` + +### 音频 + +- `sound/core/oss/pcm_oss.c` +- `sound/core/pcm_native.c` +- `sound/pci/hda/patch_realtek.c` +- `sound/soc/amd/yc/acp6x-mach.c` +- `sound/usb/endpoint.c` +- `sound/usb/quirks.c` + +## 6. 处理优先级 -1. `Makefile`、版本号与 Android common tag:明确最终版本语义,禁止把 6.6.118 官方树直接覆盖到 6.6.126 本地树。 -2. ABI/KMI:先处理 `.stg`、OPlus symbol list、protected exports、AFDO,再运行 ABI 检查。 -3. `gki_defconfig`:逐项保留官方安全配置和项目必需功能,禁止整文件选择 ours/theirs。 -4. 调度与内存:`sched.h`、`sched/task.h`、`mm.h`、`mm_types.h`、vendor hooks 必须结合 BORE、wait/HMBIRD、ReSukiSU/SuSFS 等本地改动审核。 -5. F2FS/EXT4:先理解官方修复,再移植本地 ZRAM、压缩、文件系统和隐藏相关 hook。 -6. USB/Type-C/IOMMU/电源:这些路径可能直接影响启动、充电、外设和稳定性,必须保留独立提交边界。 -7. 其他非 OnePlus 设备驱动:按上游修复优先处理,但仍需保证 GKI/allmodconfig 不回归。 +1. 调度架构决策:HMBIRD / SCX / SLIM 与 policy ID。 +2. `Makefile`、版本号和 Android common tag。 +3. ABI/KMI、OPlus symbol list、protected exports、AFDO。 +4. `gki_defconfig`、Kleaf/Bazel 和工具链。 +5. common 与 msm-kernel / vendor modules 接口。 +6. task/fork/tick、调度、内存和 vendor hooks。 +7. F2FS、EXT4、ZRAM 和文件系统 hooks。 +8. USB、Type-C、IOMMU、电源和设备驱动。 +9. 网络与音频。 +10. 完整 OKI clean build、ABI/KMI 和真机验证。 -## 5. 禁止的解决方式 +## 7. 禁止的解决方式 - 不使用 `git merge -s ours`。 -- 不整树选择 ours 或 theirs。 -- 不通过删除 ABI、symbol list、vendor hook 或配置项来消除冲突。 -- 不将“编译通过”视为 ABI、启动和运行时验证完成。 -- 不在未固定完整 `oneplus_13_b.xml` manifest 的情况下发布。 +- 不整树或批量选择 ours/theirs。 +- 不通过删除 ABI、symbol list、vendor hook 或配置项消除冲突。 +- 不把“编译通过”视为 ABI、启动和运行时验证完成。 +- 不在未固定完整 `oneplus_13_b.xml` manifest 时发布。 - 不只更新 common 而忽略 msm-kernel、modules/devicetree、vendor_boot 和 vendor modules。 -## 6. 合并前验证 +## 8. 合并前验证 -- [ ] 80 个冲突全部逐文件解决并记录理由 +- [ ] 116 个冲突全部逐文件解决并记录理由 +- [ ] 调度架构和策略编号冲突解决 - [ ] `repo manifest -r` 固定完整 OKI revision - [ ] `oplus_build_kernel.sh sun perf` clean build 成功 -- [ ] ABI/KMI 与 OPlus symbol list 检查通过 +- [ ] ABI/KMI、OPlus symbol list、AFDO 检查通过 - [ ] Image、vendor_boot、vendor modules 和 vermagic 匹配 -- [ ] AK3 打包与回退包完成 -- [ ] OnePlus 13 可重复启动和重启 -- [ ] 蜂窝、移动数据、Wi-Fi、蓝牙、相机、指纹正常 +- [ ] AK3 与回退包完成 +- [ ] OnePlus 13 可重复启动、重启和回退 +- [ ] 蜂窝、Wi-Fi、蓝牙、相机、指纹正常 - [ ] 充电、电池状态、温控、灭屏和深度休眠正常 -- [ ] Root、SuSFS、KPM、wait/HMBIRD/SCX、网络栈逐项验证 +- [ ] Root、SuSFS、KPM、wait/HMBIRD/SCX 与网络栈逐项验证 在这些检查完成前,同步 PR `#6` 必须保持 Draft。 diff --git a/scripts/resolve_merge_markers.py b/scripts/resolve_merge_markers.py new file mode 100644 index 000000000000..e9c408e0264d --- /dev/null +++ b/scripts/resolve_merge_markers.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +"""Resolve selected Git conflict blocks without discarding non-conflicting changes. + +The script operates on an already conflicted worktree. For each listed path it +replaces every standard conflict block with either the local (ours) or incoming +(theirs) section. Text outside conflict markers is left unchanged, so clean +upstream hunks already applied by Git are preserved. +""" + +from __future__ import annotations + +import argparse +import os +import re +import sys +from pathlib import Path + +MARKER_RE = re.compile(br"^(<<<<<<<|=======|>>>>>>>)", re.MULTILINE) + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser() + parser.add_argument("--root", type=Path, default=Path.cwd()) + parser.add_argument("--paths-file", type=Path, required=True) + parser.add_argument("--choice", choices=("ours", "theirs"), required=True) + return parser.parse_args() + + +def read_paths(path: Path) -> list[str]: + entries: list[str] = [] + for raw in path.read_text(encoding="utf-8").splitlines(): + item = raw.strip() + if not item or item.startswith("#"): + continue + if item.startswith("/") or ".." in Path(item).parts: + raise ValueError(f"unsafe repository path: {item}") + entries.append(item) + if len(entries) != len(set(entries)): + raise ValueError("paths file contains duplicate entries") + return entries + + +def resolve_bytes(data: bytes, choice: str, repo_path: str) -> tuple[bytes, int]: + lines = data.splitlines(keepends=True) + output: list[bytes] = [] + index = 0 + blocks = 0 + + while index < len(lines): + line = lines[index] + if not line.startswith(b"<<<<<<<"): + output.append(line) + index += 1 + continue + + blocks += 1 + index += 1 + ours: list[bytes] = [] + while index < len(lines) and not lines[index].startswith(b"======="): + if lines[index].startswith((b"<<<<<<<", b">>>>>>>")): + raise ValueError(f"nested or malformed conflict in {repo_path}") + ours.append(lines[index]) + index += 1 + + if index >= len(lines): + raise ValueError(f"missing ======= marker in {repo_path}") + index += 1 + + theirs: list[bytes] = [] + while index < len(lines) and not lines[index].startswith(b">>>>>>>"): + if lines[index].startswith((b"<<<<<<<", b"=======")): + raise ValueError(f"nested or malformed conflict in {repo_path}") + theirs.append(lines[index]) + index += 1 + + if index >= len(lines): + raise ValueError(f"missing >>>>>>> marker in {repo_path}") + index += 1 + output.extend(ours if choice == "ours" else theirs) + + resolved = b"".join(output) + if MARKER_RE.search(resolved): + raise ValueError(f"unresolved conflict marker remains in {repo_path}") + return resolved, blocks + + +def atomic_write(path: Path, data: bytes) -> None: + temporary = path.with_name(f".{path.name}.resolve-tmp") + temporary.write_bytes(data) + os.chmod(temporary, path.stat().st_mode) + temporary.replace(path) + + +def main() -> int: + args = parse_args() + root = args.root.resolve() + paths = read_paths(args.paths_file) + total_blocks = 0 + + for repo_path in paths: + target = (root / repo_path).resolve() + try: + target.relative_to(root) + except ValueError as exc: + raise ValueError(f"path escapes repository root: {repo_path}") from exc + if not target.is_file(): + raise FileNotFoundError(f"conflicted file not found: {repo_path}") + + resolved, blocks = resolve_bytes(target.read_bytes(), args.choice, repo_path) + if blocks == 0: + raise ValueError(f"listed path has no conflict markers: {repo_path}") + atomic_write(target, resolved) + total_blocks += blocks + print(f"resolved {blocks:2d} block(s): {repo_path}") + + print(f"resolved {total_blocks} conflict block(s) across {len(paths)} path(s)") + return 0 + + +if __name__ == "__main__": + try: + raise SystemExit(main()) + except Exception as exc: # noqa: BLE001 - command-line diagnostics + print(f"error: {exc}", file=sys.stderr) + raise SystemExit(1) diff --git a/sync/resolutions/16.0.9.401/README.md b/sync/resolutions/16.0.9.401/README.md new file mode 100644 index 000000000000..0b62dc8844d1 --- /dev/null +++ b/sync/resolutions/16.0.9.401/README.md @@ -0,0 +1,59 @@ +# OnePlus 13 common 16.0.9.401 conflict resolution + +This directory contains auditable resolution inputs for merging official common +commit `e1b346b6b4f4096eb342ae3684838a942fd6f6c4` into custom branch +`6.6-final`. + +## Authoritative conflict count + +A direct `git merge --no-commit --no-ff` reports **116 unresolved index paths**. +The earlier count of 80 came from a truncated merge-tree report and omitted +conflicts under `kernel/`, `net/`, `sound/`, `init/`, `lib/` and `mm/`. + +## Pass 1 + +`pass1-ours.txt` lists 31 paths whose official base-to-16.0.9.401 delta is +already present in the Linux 6.6.126 custom version, or has been superseded by a +newer equivalent implementation. + +The pass does **not** run `git checkout --ours` on whole files. The resolver only +replaces the marked conflict blocks with their local section. Every clean +official hunk that Git merged outside those blocks remains in the worktree. + +Evidence used for this pass: + +1. The official additions are present in the custom file and official removals + are already absent or replaced. +2. The conflict-marker version was inspected to confirm the overlap is caused + by version skew, relocation or a newer local equivalent. +3. `Makefile` keeps Linux 6.6.126 and `KCFLAGS += -D__ANDROID_COMMON_KERNEL__`; + the official linker and tools changes are already present in the custom file. +4. Scheduler architecture conflicts are deliberately excluded from pass 1. +5. ABI/KMI files are excluded unless their official delta is fully represented + and the conflict is limited to ordering or a newer local symbol entry. + +## Unresolved architecture blocker + +Official 16.0.9.401 enables `CONFIG_SCHED_CLASS_EXT` / SCX and +`CONFIG_SLIM_SCHED`. The custom HMBIRD implementation uses the same scheduler +policy number (`7`) and replaces many of the same fork, tick, class-selection +and cgroup paths. These implementations cannot be combined by choosing one side +of the conflict. + +A separate design decision and code port are required before resolving: + +- `arch/arm64/configs/gki_defconfig` +- `include/uapi/linux/sched.h` +- `include/linux/sched/task.h` +- `kernel/Kconfig.preempt` +- `kernel/sched/*` +- related task, fork, tick and vendor-hook paths + +## Safety rules + +- Do not merge the official 6.6.118 tree over the custom 6.6.126 tree. +- Do not batch-select ours/theirs for remaining conflicts. +- Keep each resolution pass reproducible in GitHub Actions. +- Do not create a final merge commit until no unmerged index entries remain. +- After resolution, require full pinned-manifest OKI build, ABI/KMI checks and + OnePlus 13 device validation. diff --git a/sync/resolutions/16.0.9.401/pass1-ours.txt b/sync/resolutions/16.0.9.401/pass1-ours.txt new file mode 100644 index 000000000000..a51f451153cd --- /dev/null +++ b/sync/resolutions/16.0.9.401/pass1-ours.txt @@ -0,0 +1,31 @@ +Documentation/ABI/testing/sysfs-fs-f2fs +Makefile +android/abi_gki_aarch64_transsion +arch/x86/configs/microdroid_defconfig +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +drivers/hid/hid-ids.h +drivers/hid/hid-quirks.c +drivers/input/serio/i8042-acpipnpio.h +drivers/misc/mei/hw-me-regs.h +drivers/misc/mei/pci-me.c +drivers/net/phy/mscc/mscc_main.c +drivers/nvme/host/pci.c +drivers/platform/x86/amd/pmc/pmc-quirks.c +drivers/usb/dwc3/dwc3-pci.c +drivers/usb/storage/unusual_devs.h +fs/ext4/xattr.c +fs/f2fs/compress.c +fs/nfsd/blocklayout.c +fs/nfsd/vfs.c +fs/ntfs3/inode.c +fs/smb/client/smb2file.c +include/linux/mm_types.h +include/linux/zstd.h +kernel/power/process.c +kernel/printk/printk.c +kernel/sched/cpufreq_schedutil.c +lib/zstd/zstd_compress_module.c +net/core/dst.c +net/wireless/sme.c +sound/soc/amd/yc/acp6x-mach.c +sound/usb/quirks.c