translated

This commit is contained in:
kylepeng93 2016-01-05 02:04:32 +08:00
parent eb3eb38421
commit 353355ea35
2 changed files with 14 additions and 42 deletions

View File

@ -1,42 +0,0 @@
kylepeng93正在翻译
Running a mainline kernel on a cellphone
================================================================================
One of the biggest freedoms associated with free software is the ability to replace a program with an updated or modified version. Even so, of the many millions of people using Linux-powered phones, few are able to run a mainline kernel on those phones, even if they have the technical skills to do the replacement. The sad fact is that no mainstream phone available runs mainline kernels. A session at the 2015 Kernel Summit, led by Rob Herring, explored this problem and what might be done to address it.
When asked, most of the developers in the room indicated that they would prefer to be able to run mainline kernels on their phones — though a handful did say that they would rather not do so. Rob has been working on this problem for the last year and a half in support of Project Ara (mentioned in this article). But the news is not good.
There is, he said, too much out-of-tree code running on a typical handset; mainline kernels simply lack the drivers needed to make that handset work. A typical phone is running 1-3 million lines of out-of-tree code. Almost all of those phones are stuck on the 3.10 kernel — or something even older. There are all kinds of reasons for this, but the simple fact is that things seem to move too quickly in the handset world for the kernel community to keep up. Is that, he asked, something that we care about?
Tim Bird noted that the Nexus 1, one of the original Android phones, never ran a mainline kernel and never will. It broke the promise of open source, making it impossible for users to put a new kernel onto their devices. At this point, no phone supports that ability. Peter Zijlstra wondered about how much of that out-of-tree code was duplicated functionality from one handset to the next; Rob noted that he has run into three independently developed hotplug governors so far.
Dirk Hohndel suggested that few people care. Of the billion phones out there, he said, approximately 27 of them have owners who care about running mainline kernels. The rest just want to get the phone to work. Perhaps developers who are concerned about running mainline kernels are trying to solve the wrong problem.
Chris Mason said that handset vendors are currently facing the same sorts of problems that distributors dealt with many years ago. They are coping with a lot of inefficient, repeated, duplicated work. Once the distributors [Rob Herring] decided to put their work into the mainline instead of carrying it themselves, things got a lot better. The key is to help the phone manufacturers to realize that they can benefit in the same way; that, rather than pressure from users, is how the problem will be solved.
Grant Likely raised concerns about security in a world where phones cannot be upgraded. What we need is a real distribution market for phones. But, as long as the vendors are in charge of the operating software, phones will not be upgradeable. We have a big security mess coming, he said. Peter added that, with Stagefright, that mess is already upon us.
Ted Ts'o said that running mainline kernels is not his biggest concern. He would be happy if the phones on sale this holiday season would be running a 3.18 or 4.1 kernel, rather than being stuck on 3.10. That, he suggested, is a more solvable problem. Steve Rostedt said that would not solve the security problem, but Ted remarked that a newer kernel would at least make it easier to backport fixes. Grant replied that, one year from now, it would all just happen again; shipping newer kernels is just an incremental fix. Kees Cook added that there is not much to be gained from backporting fixes; the real problem is that there are no defenses from bugs (he would expand on this theme in a separate session later in the day).
Rob said that any kind of solution would require getting the vendors on board. That, though, will likely run into trouble with the sort of lockdown that vendors like to apply to their devices. Paolo Bonzini asked whether it would be possible to sue vendors over unfixed security vulnerabilities, especially when the devices are still under warranty. Grant said that upgradeability had to become a market requirement or it simply wasn't going to happen. It might be a nasty security issue that causes this to happen, or carriers might start requiring it. Meanwhile, kernel developers need to keep pushing in that direction. Rob noted that, beyond the advantages noted thus far, the ability to run mainline kernels would help developers to test and validate new features on Android devices.
Josh Triplett asked whether the community would be prepared to do what it would take if the industry were to come around to the idea of mainline kernel support. There would be lots of testing and validation of kernels on handsets required; Android Compatibility Test Suite failures would have to be treated as regressions. Rob suggested that this could be discussed next year, after the basic functionality is in place, but Josh insisted that, if the demand were to show up, we would have to be able to give a good answer.
Tim said that there is currently a big disconnect with the vendor world; vendors are not reporting or contributing anything back to the community at all. They are completely disconnected, so there is no forward progress ever. Josh noted that when vendors do report bugs with the old kernels they are using, the reception tends to be less than friendly. Arnd Bergmann said that what was needed was to get one of the big silicon vendors to commit to the idea and get its hardware to a point where running mainline kernels was possible; that would put pressure on the others. But, he added, that would require the existence of one free GPU driver that got shipped with the hardware — something that does not exist currently.
Rob put up a list of problem areas, but there was not much time for discussion of the particulars. WiFi drivers continue to be an issue, especially with the new features being added in the Android world. Johannes Berg agreed that the new features are an issue; the Android developers do not even talk about them until they ship with the hardware. Support for most of those features does eventually land in the mainline kernel, though.
As things wound down, Ben Herrenschmidt reiterated that the key was to get vendors to realize that working with the mainline kernel is in their own best interest; it saves work in the long run. Mark Brown said that, in past years when the kernel version shipped with Android moved forward more reliably, the benefits of working upstream were more apparent to vendors. Now that things seem to be stuck on 3.10, that pressure is not there in the same way. The session ended with developers determined to improve the situation, but without any clear plan for getting there.
--------------------------------------------------------------------------------
via: https://lwn.net/Articles/662147/
作者:[Jonathan Corbet][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://lwn.net/Articles/KernelSummit2015/

View File

@ -0,0 +1,14 @@
在手机上面运行主线内核
对于自由软件来说其最大的自由之一就是能够用一个更新或修改的版本来替换原始版本的程序。尽管如此数千万使用linux内核作为支持的手机用户却很少能够在他们的手机上运行主线内核即使他们拥有替换内核代码的专业技能。可悲的是我们必须承认目前仍然无法使用到运行主线内核的主流手机。在由Rob Herring主持的2015届内核峰会上与会人员共同探讨了这个问题并进一步谈论了他们应该怎么做才能解决这个问题。
当主持人提问的时候在座的大多数开发人员都表示他们更喜欢在他们的手机上面运行主线内核然而也有少数人持相反的看法。在Project Ara的支持下Rob在这个问题上已经研究了近一年半的时间。但是最新的研究成果并不理想。
Rob表示有太多的树(out-of-tree)代码运行在手机上主线内核只是缺少能使手机正常运行所必须的驱动。每台合格的手机都在运行着100万到300万的树(out-of-tree)代码。几乎所有的这些手机的内核版本都不超过3.1,有一些甚至更加古老。造成这种情况的原因有很多,但是有一点是很清楚的,在手机的世界里,一切都变化的太快以至于内核社区无法跟上它们的步伐。如果真是那样,他问到,我们还担心什么呢?
Tim Bird指出第一台Android手机Nexus1从来没有运行过任何一个主线内核并且以后也不会。它打破了开源的承诺也使得用户不可能做到将一个新的内核放到手机中。从这一点上来说没有任何一款手机支持这种能力。Peter Zijlstra想知道从一台手机到另一台手机到底有多少正发挥作用的被复制的代码。Rob表示迄今为止他已经见到了三个独立开发的热插拔调速器。
Dirk Hohndel提出了很少有人注意到的建议。他说对于世界上的成千上亿万台手机其中大约有百分之27的手机用户关心他们的手机是否运行着主线内核。剩下的用户仅仅只是想让他们的手机正常工作。或许那些关注手机是否在运行主线内核的开发者正在努力去解决这个令人不解的问题。
Chris Mason说那些手机卖家当前正面临着相同类型的问题而这些问题也是那些linux发行版过去所面临过的问题。他们疲于应付大量的无效且重复和能被复制的工作。一旦这些发行版决定将他们的工作重心转入到主线内核而不是让它顺其自然的发展那么问题将会变得好解决的多。解决问题的关键就是去帮助手机制造商们认识到他们可以通过同样的方式获利形成这种认识的关键并不是通过来自用户的压力。这样一来问题就可以解决了。
Grant Likely提出了对于安全问题的担忧这种担忧来自于那些不能升级他们的手机系统的android设备。他说我们需要的是一个真正专为手机设立的发行市场。但是只要手机卖家仍然掌控着手机中的应用软件那么手机的同步更新将无法实现。我们接下来将面临一个很大的安全难题。Peter补充说随着Stagefright漏洞的出现难题已经出现在我们面前了。
Ted Ts'o说运行主线内核并不是他的主要关注点。他很乐于见到这个假期中所售卖的手机能够运行3.18或者4.1的内核而不是继续停留在3.10。他认为这是一个更可能被解决的问题。Steve Rostedt认为按照Ted Ts'o所说的那样去做并不能解决手机的安全问题但是Ted认为使用一个更新的内核至少可以让漏洞修复变得更加容易。Grant对此回应说接下来的一年里这一切都将再次发生。过渡到更新的内核也是一个渐进式的对系统的完善。Kees Cook补充说我们无法从修复旧版本的内核漏洞的过程中得到太多的益处真正的问题是我们没有对bug的应对措施。
Rob说任何一种解决方案都需要得到当前的手机供应商的支持。否则由于厂商对应用到他们生产的手机上的操作系统的封锁运行主线内核的策略将会陷入麻烦。Paolo Bonzini提问说是否可以因为那些没有修复的安全漏洞而控告手机厂商尤其当手机仍然处于保修期内。Grant认为对于手机的可更新能力的保证必须来源于市场需求否则是无法实现的。而促使它实现的原因可能会是一个严重的安全问题然后用户开始对手机的可更新能力提出要求。同时内核开发人员必须不断朝着这个方向努力。Rob表示除了到目前为止指出的所有优点之外运行主线内核也能帮助开发者对安卓设备上的新特性进行测试和验证。
Josh Triplett提问说如果手机产商提出对主线内核提供支持的想法那么内核社区又将采取什么措施呢那样将会针对手机各方面的特性要求对内核进行大量的测试和验证Android的兼容性测试套件中出现的失败将不得不被再次回归。Rob提议这个问题将会在明年被讨论即先将最基本的功能做好。但是Josh强调说如果这个需求出现了我们就应该能够给出一个好的答案。
Tim认为当前我们和厂商之间存在很大的脱节。厂商根本不会主动报告或者贡献任何反馈给社区。他们之间完全脱节了这样的话永远不会有进步。Josh表示当厂商们报告他们正在使用的旧内核的相关bug时双方之间的接受度将变得更加友好。Arnd Bergmann认为我们需要的是得到一个大芯片厂商对使用主线内核的认可并且将该厂商的硬件提升到能够支持主线内核的运行的这样一个水平而这样将会在其他方面增加负担。但是他补充说实现这个目标要求存在一个跟随硬件一起分发的自由GPU驱动程序——然而这种程序当前并不存在。
Rob给存在问题的领域列了一个清单但是现在已经没有太多的时间去讨论其中的细节了。WIFI驱动仍然是一个问题尤其是当新特性被添加到Android设备上的时候。Johannes Berg对新特性仍然存在问题表示赞同android的开发人员甚至在这些新特性被应用到Android设备上之前都不会去谈论它们是否存在问题。然而对这些特性中的大多数的技术支持最终都会落实在主线内核中。
随着会议逐渐接近尾声Ben Herrenschmidt再次重申:实现在andoroid手机上运行主线内核的关键还是在于让厂商认识到使用主线内核是它们获得最大利润的最好选择。从长远看使用主线内核能节省大量的工作。Mark Brown认为以前当搭载在Android设备上的内核版本以更稳定的方式向前推进的时候上游工作的好处对运营商来说更加明显。以现在的情况来看手机上的内核版本似乎停留在了3.10,那种压力是不一样的。这次会话以开发者决定进一步改善当前的状况而结束,但是却并没有对如何改善提出一个明确的计划。