Fedora 内核是由什么构成的？
内核 Fedora
![](/data/attachment/album/201607/29/144036jyzsz1j1uu1g8auz.png)


每个 Fedora 系统都运行着一个内核。许多代码片段组合在一起使之成为现实。


每个 Fedora 内核都起始于一个来自于[上游社区](http://www.kernel.org/)的基线版本——通常称之为 vanilla 内核。上游内核就是标准。（Fedora 的）目标是包含尽可能多的上游代码，这样使得 bug 修复和 API 更新更加容易，同时也会有更多的人审查代码。理想情况下，Fedora 能够直接获取 kernel.org 的内核，然后发送给所有用户。


现实情况是，使用 vanilla 内核并不能完全满足 Fedora。Vanilla 内核可能并不支持一些 Fedora 用户希望拥有的功能。用户接收的 [Fedora 内核] 是在 vanilla 内核之上打了很多补丁的内核。这些补丁被认为“<ruby> 不在树上 <rp>  （ </rp> <rt>  out of tree </rt> <rp>  ） </rp></ruby>”。许多这些位于补丁树之外的补丁都不会存在太久。如果某补丁能够修复一个问题，那么该补丁可能会被合并到 Fedora 树，以便用户能够更快地收到修复。当内核变基到一个新版本时，在新版本中的补丁都将被清除。


一些补丁会在 Fedora 内核树上存在很长时间。一个很好的例子是，安全启动补丁就是这类补丁。这些补丁提供了 Fedora 希望支持的功能，即使上游社区还没有接受它们。保持这些补丁更新是需要付出很多努力的，所以 Fedora 尝试减少不被上游内核维护者接受的补丁数量。


通常来说，想要在 Fedora 内核中获得一个补丁的最佳方法是先给 [Linux 内核邮件列表（LKML）](http://www.labbott.name/blog/2015/10/02/the-art-of-communicating-with-lkml/) 发送补丁，然后请求将该补丁包含到 Fedora 中。如果某个维护者接受了补丁，就意味着 Fedora 内核树中将来很有可能会包含该补丁。一些来自于 GitHub 等地方的还没有提交给 LKML 的补丁是不可能进入内核树的。首先向 LKML 发送补丁是非常重要的，它能确保 Fedora 内核树中携带的补丁是功能正常的。如果没有社区审查，Fedora 最终携带的补丁将会充满 bug 并会导致问题。


Fedora 内核中包含的代码来自许多地方。一切都需要提供最佳的体验。




---


via: <https://fedoramagazine.org/makes-fedora-kernel/>


作者：[Laura Abbott](https://fedoramagazine.org/makes-fedora-kernel/) 译者：[ChrisLeeGit](https://github.com/chrisleegit) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Every Fedora system runs a kernel. Many pieces of code come together to make this a reality.

Each release of the Fedora kernel starts with a baseline release from the [upstream community](http://www.kernel.org). This is often called a ‘vanilla’ kernel. The upstream kernel is the standard. The goal is to have as much code upstream as possible. This makes it easier for bug fixes and API updates to happen as well as having more people review the code. In an ideal world, Fedora would be able to to take the kernel straight from kernel.org and send that out to all users.

Realistically, using the vanilla kernel isn’t complete enough for Fedora. Some features Fedora users want may not be available. The [Fedora kernel](http://pkgs.fedoraproject.org/cgit/rpms/kernel.git/) that users actually receive contains a number of patches on top of the vanilla kernel. These patches are considered “out of tree.” Many of these patches will not exist out of tree patches very long. If patches are available to fix an issue, the patches may be pulled in to the Fedora tree so the fix can go out to users faster. When the kernel is rebased to a new version, the patches will be removed if they are in the new version.

Some patches remain in the Fedora kernel tree for an extended period of time. A good example of patches that fall into this category are the secure boot patches. These patches provide a feature Fedora wants to support even though the upstream community has not yet accepted them. It takes effort to keep these patches up to date so Fedora tries to minimize the number of patches that are carried without being accepted by an upstream kernel maintainer.

Generally, the best way to get a patch included in the Fedora kernel is to [send it to the Linux Kernel Mailing List (LKML)](http://www.labbott.name/blog/2015/10/02/the-art-of-communicating-with-lkml/) first and then ask for it to be included in Fedora. If a patch has been accepted by a maintainer it stands a very high chance of being included in the Fedora kernel tree. Patches that come from places like github which have not been submitted to LKML are unlikely to be taken into the tree. It’s important to send the patches to LKML first to ensure Fedora is carrying the correct patches in its tree. Without the community review, Fedora could end up carrying patches which are buggy and cause problems.

The Fedora kernel contains code from many places. All of it is necessary to give the best experience possible.

## Lukes®

Is it True that Kernel race is true master race.

## Gary

A good view of what Fedora kernel is all about. Also, this just goes to show how great the open source community is. Fedora finds a bug fix on their version of the kernel, and submit it upstream. If it’s accepted the kernel includes the bug fix and all the other distros benefit, and indeed everyone using the kernel. Same goes if someone else contributes, the Fedora team benefits, with less bugs, and less maintenance work on the kernel itself.

## Leslie Satenstein

Hi Laura,

A well written summary but your article was too short. What is “rebaseing ” and what about multilanguage support? French/English/Russian/Spanish etc. I am interested in what a rebase means versus an update.

## David

Read something about how git works 😉

## Onyeibo Oku

Something to do with version control management– think CVS/Surbversion/Git/Mercurial etc.

This might help –> https://dotdev.co/git-rebase-for-reasonable-developers-26dc8776dc25#.da3gofmpo

https://git-scm.com/book/en/v2/Git-Branching-Rebasing

https://www.sbf5.com/~cduan/technical/git/git-5.shtml

## Slartibartfas

It’s part of git.

For extensive information type “man git” or “man git-rebase” in a Terminal or look at git’s Wikipedia page.

## Ryan Lerch

As a concept, rebasing is close to what people do think when you say “update”, however the term is slighty more nuanced than that.

Typically, when doing a rebase, you are pulling down the newest version from upstream, and then checking if the patches you are holding in your version still work or are still needed.

For example, say we have Fedora kernel version 4.4.13, and it has 3 patches that are not in the upstream (vanilla) kernel. Rebasing is typically referred to the process of pulling down a newer version of the Kernel from upstream, say 4.6.1, then checking to see if the 3 patches we had applied to 4.4.13 still function as expected on the newer 4.6.1 kernel. Additionally, some of these 3 patches might also not be needed anymore if they were merged upstream, so they would be removed.

## Onyeibo Oku

I like this explanation. Really simple and illustrative

## Robin

A rebase is simply that the kernel version jumps from lets say 4.5 to 4.7 or in directly to 6.** version.

Someone please correct me if im wrong

## Curtis nelson

Timely update for new F24 users. Link to the cgit pkgs site is pure gold. Thanks!

## Wilman Zen

Is latest kernel in F24 already support my Bumblebee card? because before, F24 got hang after install Bumblebee driver.

## Andrew Jamison

Coming from a Linux Ethusiast but someone still very much stuck in Windows for 90% of my tasks can someone explain how the Linux Kernel works differently then the Windows Kernel without going to much into Windows Vs Linux wars? I am just currious on a code level what is really different about the two and how they handle resources/hardware requests.

## Wally Kramer

You are not stuck in Windows. You can leave it behind at any time, though there will be a learning curve.

Many of the differences you can rejoice about. For example, you don’t actually like the complexity of Outlook, right? And how about all those useless system notification messages?

There is a Fedora alternative to every Windows application. In many cases, you can run proprietary Windows applications directly on Fedora! Just type “wine my_windows_app.exe”. Wine is a Windows environment emulator which works well on properly written (follows Microsofts rules for application design) Windows applications. Amusingly, wine does not work well on Microsoft’s flagship applications like Word, Powerpoint, Excel, Outlook, IE, etc., because they did not follow the rules they require of non-MS developers. For some Windows applications, there is no need for a Fedora replacement: Linux is naturally virus resistant. Its security model and open source philosophy do not provide a thriving virus laboratory. Who really wanted to hassle with virus protection in the first place?

LibreOffice is more than a match for Microsoft’s Office suite. For example, LibreOffice Writer is more compatible with Word files than Word is! Writer can easily open and edit ancient Word files which Office 2013 chokes on. And LibreOffice Calc does not (by default) provide all the “corrections” that Excel does when entering data and formulas.

As for the system differences, it largely has to do with clear delineation between privileged and non-privileged operations. Windows is a muddle of patches upon patches. Linux derives from a clear system vs. application functionality derived from Unix’s 1975 architecture.