Nura (postmarketOS): The road to daily-drivable mainline phones
Nura (postmarketOS): The road to daily-drivable mainline phones
Nura (postmarketOS):通往日常主力手机的“主线化”之路
We have shown that running mainline Linux on your phone is a real possibility for highly invested Linux enthusiasts. Now how do we get from there to making it usable for everybody else who just wants a working phone? 我们已经证明,对于投入大量精力的 Linux 爱好者来说,在手机上运行主线 Linux 是完全可行的。那么,我们该如何从这一步跨越到让普通用户也能将其作为日常主力手机使用呢?
Two important segments of the road towards this destination are Duranium and Hardware CI. This blog post is about the third one: reference devices! 通往这一目标的道路上有两个重要环节:Duranium 和硬件持续集成(Hardware CI)。本篇博文将介绍第三个环节:参考设备!
Members of the Nura team have joined forces to build maintainer teams for three of the many devices Nura runs on to push them across the finishing line and make them suitable for everyday use with Nura. More on the actual workflow comes further below, let’s start with defining the goal in detail. Nura 团队的成员们已联手为 Nura 支持的众多设备中的三款组建了维护团队,旨在推动它们跨越终点线,使其能够满足 Nura 的日常使用需求。关于具体工作流程的更多信息将在下文介绍,让我们先详细定义一下目标。
New “main” category
新的“主(main)”类别
We categorize devices into “main”, “community”, “testing”, “downstream” and “archived”. The “main” category was emptied with the v24.12 release. With PMCR-0009 we have re-evaluated what we want to have in the “main” device category. Here is the summary: 我们将设备分为“主(main)”、“社区(community)”、“测试(testing)”、“下游(downstream)”和“归档(archived)”类别。在 v24.12 版本发布时,“主”类别已被清空。通过 PMCR-0009,我们重新评估了“主”设备类别应包含的内容。总结如下:
- Set new requirements for the “main” device category to highlight selected device ports which are well-tested in hardware CI and set up to stay in “main” for a long time through strong maintainership. 为“主”设备类别设定新要求,以突出那些在硬件 CI 中经过充分测试,并能通过强大的维护团队长期保持在“主”类别的设备移植版本。
- Change the meaning of the “main” category to not only indicate that more features are working than in the “community” category, but also that the Nura team is highly invested in keeping the device in the “main” category and takes on responsibilities to make this likely. 改变“主”类别的定义:它不仅意味着比“社区”类别有更多的功能可用,还代表 Nura 团队将投入大量精力确保该设备留在“主”类别中,并承担相应的责任以实现这一目标。
- Maintainers of devices in other categories are welcome to use some of these new requirements for “main” as blueprint for their devices as well, in order to get similar reliability and maintainership improvements for their devices. 欢迎其他类别的设备维护者将这些“主”类别的新要求作为蓝图,以便为自己的设备带来类似的可靠性和维护性提升。
Fully mainline
完全主线化
After many discussions (the PMCR merge request had 151 comments), we have arrived at high quality requirements for ports in this category. Among others: 经过多次讨论(PMCR 合并请求共有 151 条评论),我们为该类别的移植版本制定了高质量要求。其中包括:
- Boot via UEFI (e.g. through a second-stage bootloader on phones). 通过 UEFI 引导(例如通过手机上的二级引导加载程序)。
- Must use upstream kernels with a strict and minimal policy for patches. 必须使用上游内核,并对补丁执行严格且最小化的策略。
- Must not depend on forked device-specific packages, such as alsa-ucm-conf. 不得依赖分叉的设备特定软件包,例如 alsa-ucm-conf。
- Must use a generic device package for the target architecture. 必须为目标架构使用通用的设备软件包。
This means that the resulting ports are essentially fully mainlined and can not only be used with Nura, but also relatively easily with any other Linux distribution. There will be one UI-specific aarch64 image that can be flashed on all “main” aarch64 devices. Getting Linux kernel security patches will be trivial, as we only need to update our generic kernel packages and then get them for all devices in the “main” category at once. 这意味着最终的移植版本本质上是完全主线化的,不仅可以与 Nura 一起使用,还可以相对容易地用于任何其他 Linux 发行版。未来将提供一个特定于 UI 的 aarch64 镜像,可刷入所有“主”类别的 aarch64 设备。获取 Linux 内核安全补丁将变得非常简单,因为我们只需更新通用内核软件包,即可同时为“主”类别中的所有设备应用更新。
Device features
设备功能
Regarding device features, “main” category requirements now have: 关于设备功能,“主”类别的要求现在包括:
The working features should allow to use the device in most common use cases. A phone for example would typically have calls, SMS, mobile data, Wi-Fi, audio, battery charging, Bluetooth and camera. Exceptions can be made by the device maintainer team, together with reasoning why they are necessary (e.g. fingerprint reader is not working because the driver is missing). The Nura team decides if the port is complete enough for the main category based on that list. 正常运行的功能应能满足设备在大多数常见场景下的使用。例如,手机通常应具备通话、短信、移动数据、Wi-Fi、音频、电池充电、蓝牙和摄像头功能。设备维护团队可以提出例外情况,并说明其必要性(例如,由于缺少驱动程序导致指纹识别无法工作)。Nura 团队将根据该列表决定移植版本是否足够完善,从而进入“主”类别。
Device maintainer team
设备维护团队
In order to pull this off, each device must have a team of maintainers that consists of at least 5 people, of which the majority are part of the Nura team. Between these people, a list of responsibilities must be covered. As with the other requirements listed above, this is an ideal the team would be working towards for eventually getting the device into main. The team can consist of fewer people and have a smaller scope initially. 为了实现这一目标,每台设备必须拥有一个至少由 5 人组成的维护团队,其中大多数人必须是 Nura 团队成员。团队成员之间必须覆盖一系列职责。与上述其他要求一样,这是团队为最终将设备纳入“主”类别而努力的目标。团队初期可以由较少的人员组成,职责范围也可以较小。
From the list of responsibilities, most importantly: 在职责列表中,最重要的是:
- Organize regular meetings. 组织定期会议。
- Long-term commitment for the device. 对设备的长期承诺。
- Kernel maintenance (fixing regressions on the kernel side, new kernel developments). 内核维护(修复内核侧的回归问题,进行新的内核开发)。
- Triage issues found by the community and HW CI regressions. 分类处理社区发现的问题和硬件 CI 回归问题。
- Documentation for this device. 该设备的文档编写。
- Making sure Hardware CI works (wires are connected, preparing CI). 确保硬件 CI 正常工作(连接线路、准备 CI 环境)。
- Manual testing where necessary. 必要时的手动测试。
Workflow
工作流程
So how can your favorite device get into the main category? We have thought hard about this and came up with the following workflow: 那么,你心仪的设备如何才能进入“主”类别呢?我们对此进行了深入思考,并提出了以下工作流程:
- Become part of a team of device maintainers through issues in the new-device-teams project. You can either apply to join an existing team by commenting in an existing issue or create a new one.
通过
new-device-teams项目中的 issue 加入设备维护团队。你可以通过在现有 issue 下评论申请加入,或者创建一个新的 issue。 - When creating a new issue, the Nura infrastructure team will create bridged Matrix and IRC channels for you, and a pmaports label for this new device will be created. (This is a manual process, if we don’t do this within a week then please kindly ask in the devel chat.)
创建新 issue 后,Nura 基础设施团队将为你创建桥接的 Matrix 和 IRC 频道,并为该新设备创建一个
pmaports标签。(这是一个手动过程,如果一周内未处理,请在开发聊天室中友好提醒。) - Wait until you have at least two people in the potential new team, then find a meeting time that works for everyone and start doing regular meetings. Use the meetings to figure out how to implement the requirements for the main category. 等待潜在的新团队至少有两人,然后找到大家都能参加的会议时间,开始定期开会。利用会议讨论如何实现“主”类别的各项要求。
- Once all requirements for main are fulfilled (this will take quite some time, but the device port will already improve significantly in this process!), make a merge request to move the device to the “main” category. 一旦满足了“主”类别的所有要求(这需要相当长的时间,但在此过程中设备移植质量将得到显著提升!),提交合并请求将设备移至“主”类别。
Financing
资金支持
Most of the work done in Nura is volunteer-based. Therefore, we cannot really promise ETAs for this project. Still, donations make it possible to finance development and HW-CI hardware. In some specific cases we might even be able to directly fund development work (e.g. q6voice(d)) too. We are also working on applying for grants to potentially support part of this project. Nura 的大部分工作都是基于志愿者的。因此,我们无法承诺该项目的具体完成时间。不过,捐款使我们能够资助开发工作和硬件 CI 设备。在某些特定情况下,我们甚至可以直接资助开发工作(例如 q6voice(d))。我们也在努力申请补助金,以期为该项目的部分工作提供支持。
If you are interested in supporting this project, you can make sure that some of your donations will go specifically to this project! If you want to get in touch for some bigger-targeted donations to directly support development, we would also be happy to hear from you at board at postmarketos dot org (emails are not migrated to nura.eco yet). 如果你有兴趣支持本项目,可以确保你的部分捐款专门用于此!如果你想进行更大规模的定向捐赠以直接支持开发,欢迎通过 board at postmarketos dot org 与我们联系(邮件尚未迁移至 nura.eco)。
Initial candidates
首批候选设备
Together with this blog post, we have created three initial issues in the new-device-teams project:
伴随这篇博文,我们在 new-device-teams 项目中创建了三个初始 issue:
- Fairphone 5
- Motorola Edge 30
- Radxa Dragon Q6A
All of these are based on the SM7325 SoC for which significant mainline support exists already, to the point that we believe there is a good chance to eventually fulfill… 这些设备均基于 SM7325 SoC,该芯片目前已拥有相当完善的主线支持,我们相信它们很有希望最终满足……