Linux kernel分支管理与维护

mainline分支维护

Linux kernel的主线分支只有一个master分支,该分支由Linus Torvalds维护,对于不同的版本的内核是采用打tag的方式进行发布的,一般在发布一个正式版本之前,都会先发布一系列的候选版本,比如linux-5.6最终版发布之前先发布了linux-5.6.rc1到linux-5.6.rc7,rc值越大越接近最终版本linux-5.6。

从linux-3.0之后的版本,mainline中的内核版本号只涉及主版本号和次版本号两个:linux-x.y,对于我们在网上搜索到的linux-x.y.z版本的内核一般都是指stable版本,stable版本会在主版本和次版本之后再多一个版本号,用来记录稳定版的更新。

stable分支维护

以linux stable仓库为例,针对不同的大版本内核做了不同的分支:

比如 linux-5.6.y 分支,表示的实际上就是linux-5.6版本stable内核,它的提交历史:

1.当Linus Torvalds维护的mainline分支中发布了linux5.6之后(commit节点被Linus Torvalds标记tag为linux5.6),从mainline分支中checkout出来一个分支linux-5.6.y,此时linux-5.6.y分支的状态也就是linux-5.6的最终版本。

2.后续linux-5.6.y分支的维护将由stable分支维护者进行维护,内核版本号变为linux-5.6.y,这里的y从1开始以此递增。

3.自此之后linux-5.6.y stable分支将和Linus Torvalds维护的mainline分支分道扬镳,mainline继续新特性的开发,stable则只会合入特定的一些patch以保证稳定性,并且定期打上tag:linux-5.6.y。

linux-next

下一个周期补丁合并的主要树是linux-next,由Stephen Rothwell 维护。根据设计 linux-next 提前包含了下一个合并窗口要合并的patch,理论上应该是下一个合并窗口关闭之后主线应该要成为的样子。可从以下位置下载:


http://www.kernel.org/pub/linux/kernel/next/

Linux-next 已经成为内核开发过程中不可或缺的一部分;在一个给定的合并窗口中合并 的所有补丁都应该在合并窗口打开之前的一段时间内找到进入Linux-next 的方法。当Linus发布一个Mainline主线内核时,一个为期2周的主线合并窗口就会打开,在此期间,mainline分支会从linux-next以及各个子模块的维护者处接收合并patch,当合入一些patch后,就会形成下一个版本的rc候选版本,一般会经历多个rc版本,等待时机成熟,就会发布下一个版本的Mainline内核。


The primary tree for next-cycle patch merging is linux-next, maintained by

Stephen Rothwell.  The linux-next tree is, by design, a snapshot of what

the mainline is expected to look like after the next merge window closes.

Linux-next trees are announced on the linux-kernel and linux-next mailing

lists when they are assembled; they can be downloaded from:



    http://www.kernel.org/pub/linux/kernel/next/



Linux-next has become an integral part of the kernel development process;

all patches merged during a given merge window should really have found

their way into linux-next some time before the merge window opens.

你可能感兴趣的:(Linux笔记)