by yzddmr6
把主线 Linux 移植到安卓手机、平板的 Agent Skill:流程、决策规则与踩坑经验 · Agent skill for porting mainline Linux to Android phones and tablets
# Add to your Claude Code skills
git clone https://github.com/yzddmr6/android-mainline-portGuides for using ai agents skills like android-mainline-port.
See how android-mainline-port compares with popular alternatives.
android-mainline-port is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by yzddmr6. 把主线 Linux 移植到安卓手机、平板的 Agent Skill:流程、决策规则与踩坑经验 · Agent skill for porting mainline Linux to Android phones and tablets. It has 52 GitHub stars.
android-mainline-port's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/yzddmr6/android-mainline-port" and add it to your Claude Code skills directory (see the Installation section above). android-mainline-port ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh android-mainline-port against similar tools.
No comments yet. Be the first to share your thoughts!
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
references/):先做什么、后做什么,工作纪律,技术选型,怎么判断通过。相对稳定。experience/):按领域写的推荐路线、完成标准和具体的坑(现象、原因、怎么确认、怎么解决、怎么预防)。随项目不断追加。经验来自高通平板移植到 Ubuntu 26.04 + GNOME 的过程。硬件和内核部分基本通用;Ubuntu 相关部分换发行版时按 references/ubuntu.md 最后一节调整。版本号和接口名有时效性,使用前核对上游现状;上游已经解决的问题,直接用更简单的办法。
references/process.md 对应小节,再读相关的 experience/ 文件。references/decisions.md 对应一节的默认做法和规则。experience/patterns.md 判断问题属于哪一类、按通用步骤排查;再用日志里的错误码、函数名、配置项在 experience/ 里 grep 找具体案例。| 步 | 做什么 | 完成标准 | 主要参考 |
|---|---|---|---|
| 0 立项 | 建工作区;资料池(上游、同 SoC 社区、厂商源码、同类项目);复用调研;硬件清单;选型;估算;和用户确认决策 | 用户确认决策清单;确认前不碰设备 | references/process.md、references/decisions.md、references/discipline.md |
| 1 构建环境 | 工具链、ccache、长期 OUT、根文件系统构建方式;原样构建一次社区参考内核 | 参考内核可复现,增量构建几分钟 | references/build-environment.md |
| 2 取证与备份 | root;按确认的范围备份并校验;取出运行时设备树、固件、PMIC 电压、显示参数、原厂命令序列;准备恢复 | 备份两侧哈希一致;恢复镜像在手 | references/process.md、experience/usb-and-storage.md |
| 3 首次启动 | 离线搞清 bootloader;最小设备树;时标探针;只读 initramfs + USB 网络 + 超时回退 | 主机能连 shell,超时自动回原系统 | experience/bootloader-and-boot.md、experience/kernel-and-resources.md |
| 4 点亮与内存桌面 | 选显示路线,同时启动原生接管;触控;GPU;RAM 根;GNOME;桌面自动化和验收脚本 | 人眼看到画面、手指能操作,硬件指标通过 | experience/display.md、experience/touch-and-input.md、experience/gpu.md |
| 5 安装到存储 | 维护镜像;分区;tar + 设备上格式化;启动镜像集与活动槽轮换;切换工具;调试通道默认关可打开 | 冷启动预算通过;Linux 与 Android 来回切换真机通过 | experience/usb-and-storage.md、references/ubuntu.md |
| 6 外设 | 按优先级一次一个:查复用 → 对照原厂 → 独立测试镜像 → 真机 → 合并 → 冷启动回归 | 每项有真实结果证据 | experience/ 各领域 |
| 7 发布 | 功能冻结;分层打包;按公开文档从零安装验收;第一小时审计;对外文档审核 | 别人按文档能构建、安装、使用 | references/ubuntu.md、experience/build-and-release.md |
| 8 维护 | 上游合入就删本地实现;按影响还技术债;每次更新冷启动验证 | — | references/discipline.md |
下面这些顺序错误代价最大,通常一次就是数天:
细节见 references/discipline.md。
references/verification.md。references/build-environment.md。每个重要选择用同一组问题判断,并记录理由和重新评估的条件。约 40 个关键选型点的默认做法和"遇到什么情况怎么做"的规则,见 references/decisions.md。
评估完成后一次性列出,每项给选项、代价和建议,用提问工具确认,确认后写进 AGENTS.md,不再重复问:
| 文件 | 内容 |
|---|---|
references/process.md |
每一步的详细动作、产出、完成标准 |
references/discipline.md |
文档要记什么、技术债、目录结构、署名、估算、子 agent |
references/build-environment.md |
主机、工具链、ccache、OUT、根文件系统构建、缓存、可以省掉的开销 |
references/decisions.md |
约 40 个关键技术决策:默认做法、条件与做法、为什么、不适用的情况 |
references/verification.md |
状态词、证据、冷启动和对照、测试自动化、性能预算 |
references/ubuntu.md |
Ubuntu 分层与解耦、包拆分建议、内核包、启动钩子、dracut、snap、GNOME 默认值、换发行版 |
experience/patterns.md |
九类问题模式:怎么认出来、通用处理、常见表现 |
experience/README.md |
经验库的文件列表、条目格式、维护规则 |
experience/*.md |
13 个领域的推荐路线、完成标准和坑 |
完成一个项目或解决一个新问题后,把经验写回 experience/ 对应文件(格式见 experience/README.md)。流程或纪律有变化时才改外层。不写设备型号、序列号、个人信息和项目内部代号。
把主线 Linux 内核和桌面发行版移植到 Android 手机、平板的操作手册与经验库,以 Agent Skill 的形式组织,Claude Code、Codex、Cursor、Gemini CLI 等 AI 编程助手都能直接使用,人也可以直接阅读。English
经验来自三台高通平板从零到公开发布的完整移植(主线内核 6.17 到 7.2,Ubuntu 26.04 + GNOME)。目标只有一个:从头再移植一台设备时,效率最高、少走弯路。
| 设备 | SoC | 项目 |
|---|---|---|
| 小米平板 6 Pro | 骁龙 8+ Gen 1(SM8475) | yzddmr6/xiaomipad-6pro-mainline |
| 一加平板 2 Pro | 骁龙 8 至尊版(SM8750) | yzddmr6/onepluspad-2pro-mainline |
| 小米平板 8 Pro | 骁龙 8 至尊版(SM8750) | yzddmr6/xiaomipad-8pro-mainline |
三个项目都在 Android 设备上原生运行 Ubuntu GNOME 桌面,与 Android 双系统共存,不是容器,也不是远程桌面。这份 skill 把三个项目里共同出现、反复出现、花很久才查清的问题,整理成了通用的流程、决策规则和经验条目。
技术长文、经验分享和进展动态在公众号;交流群在小红书,扫码进群交流。
几条最省时间的经验:
fastboot boot 返回 OKAY 却一直停在 Fastboot,先查设备树的 msm-id/board-id 是否和 bootloader 期望一致,而不是镜像大小。base_dir。一条命令装给你在用的所有 AI 编程助手(Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等),需要 Node.js 22 或更高版本:
npx skills add yzddmr6/android-mainline-port -g
-g 装到用户目录,所有项目都能用;不加则只装到当前项目。-a claude-code -a codex。npx skills update android-mainline-port -g;卸载:npx skills remove android-mainline-port -g。在 Claude Code 会话里输入:
/plugin marketplace add yzddmr6/android-mainline-port
/plugin install android-mainline-port@android-mainline-port
或者在终端里:
claude plugin marketplace add yzddmr6/android-mainline-port
claude plugin install android-mainline-port@android-mainline-port
更新:在 /plugin 的 Marketplaces 页打开自动更新,或手动执行 claude plugin marketplace update android-mainline-port 后再 claude plugin update android-mainline-port@android-mainline-port。
gemini skills install https://github.com/yzddmr6/android-mainline-port.git
把仓库克隆到助手的 skill 目录,目录名必须是 android-mainline-port:
| 助手 | 用户级目录 | 项目级目录 |
|---|---|---|
| Claude Code | ~/.claude/skills/ |
.claude/skills/ |
| Codex | ~/.agents/skills/ |
.agents/skills/ |
| Gemini CLI | ~/.gemini/skills/ 或 ~/.agents/skills/ |
.gemini/skills/ |
| Cursor | ~/.cursor/skills/ 或 ~/.agents/skills/ |
.cursor/skills/ |
| GitHub Copilot | ~/.copilot/skills/ 或 ~/.agents/skills/ |
.github/skills/ |
| OpenCode | ~/.config/opencode/skills/ 或 ~/.agents/skills/ |
.opencode/skills/ |
以 Claude Code 为例:
git clone --depth 1 https://github.com/yzddmr6/android-mainline-port ~/.claude/skills/android-mainline-port
更新时在该目录里执行 git pull。不要用 GitHub 的 "Download ZIP",解压出来的目录名带 -main,和 skill 名不一致,部分助手会不识别。
android-mainline-port.zip。把下面这段话发给你的 AI 编程助手:
请帮我安装这个 Agent Skill:https://github.com/yzddmr6/android-mainline-port
1. 先判断你自己的用户级 skill 目录:Claude Code 是 ~/.claude/skills,Codex、Gemini CLI、Cursor、GitHub Copilot、OpenCode 可用 ~/.agents/skills,或以你自己文档里写的目录为准。
2. 执行 git clone --depth 1 https://github.com/yzddmr6/android-mainline-port <skill目录>/android-mainline-port;如果目录已存在,改为在里面执行 git pull --ff-only。
3. 目录名必须是 android-mainline-port,和 SKILL.md 里的 name 一致。
4. 确认目录里有 SKILL.md、references/、experience/,且 SKILL.md 开头写着 name: android-mainline-port。
5. 不要改动其他 skill 和设置。最后告诉我装在哪里,是否需要重启或重新加载。
/android-mainline-port(插件方式是 /android-mainline-port:android-mainline-port),能看到这个 skill 即可。装好之后不需要特别的命令,像平常一样描述你的情况即可:
fastboot boot 返回 OKAY,但屏幕一直停在 Fastboot 界面,pstore 也是空的,帮我排查。"SKILL.md 和 references/。先做什么后做什么、工作纪律、技术选型、构建环境、怎么判断通过、Ubuntu 集成与解耦。相对稳定。experience/。按领域记录推荐路线、完成标准和具体的坑(现象、原因、怎么确认、怎么解决、怎么预防),随项目持续追加。SKILL.md 流程总览、顺序要点、工作纪律、选型原则、用户决策
references/
process.md 每一步的详细动作、产出、完成标准
discipline.md 文档要记什么、技术债、目录结构、署名、估算、子 agent
build-environment.md 主机、工具链、ccache、OUT、根文件系统构建、缓存
decisions.md 关键技术决策:默认做法、条件与做法、机制、边界
verification.md 状态词、证据、冷启动、测试自动化、性能预算
ubuntu.md Ubuntu 分层与解耦、包拆分建议、启动钩子、换发行版
experience/
README.md 条目格式和维护规则
patterns.md 九类问题模式与通用处理
bootloader-and-boot.md ABL、启动格式、首次启动、调试通道、恢复
kernel-and-resources.md 内建与模块、资源回收、PMIC 电压、设备树数值
display.md simpledrm 与原生接管、DSC、熄屏亮屏、背光
gpu.md Adreno、固件、自编 Mesa、新 GPU 的 Mesa 缺陷
touch-and-input.md 触控(TDDI)、按键、键盘配件、指纹
audio.md AudioReach、功放、麦克风、UCM、音量
wireless.md Wi-Fi、蓝牙
power-and-time.md 电量、充电、休眠、系统时间
sensors-camera-media.md 传感器与旋转、相机、视频硬解
usb-and-storage.md USB、外接显示、分区、双系统、刷写、安装
ubuntu-userspace.md Ubuntu 打包、dracut、snap、GNOME 默认值
build-and-release.md 构建流水线、缓存、可复现性、发布
testing-and-process.md 判断标准、自动化测试、协作、子 agent
移植流程分九步:
| 步 | 做什么 |
|---|---|
| 0 立项 | 资料池、复用调研、硬件清单、选型、估算,和用户确认决策 |
| 1 构建环境 | 工具链、ccache、长期 OUT,原样构建一次社区参考内核 |
| 2 取证与备份 | root,备份并校验,取出运行时设备树、固件、电压、显示参数 |
| 3 首次启动 | 搞清 bootloader,最小设备树,USB 网络 shell,超时自动回原系统 |
| 4 点亮与内存桌面 | 显示、触控、GPU,内存里跑起 GNOME,搭好桌面自动化测试 |
| 5 安装到存储 | 分区、双系统、启动切换、调试通道,冷启动验证 |
| 6 外设 | 一次一个:查复用、对照原厂、单独测试、真机、合并、回归 |
| 7 发布 | 功能冻结、分层打包、按公开文档从零安装验收 |
| 8 维护 | 上游合入就删本地实现,还技术债,每次更新冷启动验证 |
references/ubuntu.md 最后一节调整。欢迎通过 Issue 和 Pull Request 补充经验:
experience/ 对应文件里按 experience/README.md 的格式追加条目。