小议Linux staging tree
2.6.28版本起,內核代碼的drivers下增加了一個staging目錄,這個目錄也是用來存放驅動程序,只是這里的驅動和上層目錄的不同,加載的時候內核log會打印如下的語句:
MODULE_NAME: module is from the staging directory, the quality is unknown, you have been warned.
drivers/staging究竟所謂何物,需要從Linux staging tree說起。
Greg KH于2008年6月10號在Linux內核郵件列表里發出一封信,宣布建立了另外一棵kernel tree,這就是Linux staging tree。Greg解釋到,staging tree建立之目的是用來放置一些未充分測試或者因為一些其他原因未能進入內核的新增驅動程序和新增文件系統。在信中,Greg羅列了開發者把代碼提交到staging tree應該遵循哪些規則,以及哪些行為是在staging tree不受歡迎的:
The rules of what can be included here is as follows:- the code must be released under a Linux kernel-compatiblelicense- the goal of the developers must be to merge this code into themain kernel tree in the near future, but not for the nextkernel release.- the code must build properly on the x86 platform- this is not a tree for bugfixes or rewrites of existing kernelcode, this should be for new features, drivers, andfilesystems.- the patches included must detail exactly what is needed to becompleted in order for them to be included into the mainkernel tree.- there must be some email address associated with the patchthat can be used for bug reporting and questions aboutcleanups and testing the code.What this tree is not:- it is not a place to dump features that are being activelydeveloped by a community of people (reiserfs4 for example.)- it is not a place to dump code and then run away, hoping thatsomeone else will do the cleanup work for you. While thereare developers available to do this kind of work, you need toget someone to agree to "babysit" the code.但是,也有人對staging tree建立的必要性有些疑問的,畢竟,在此之前我們已經有了linux-next tree。Greg對這些疑問解釋到,staging tree只是收留新增的驅動程序和文件系統,并不接收對已有代碼的修改補丁。因此可以說,Greg的staging tree在很大程度上分擔了Stephen Rothwell身上的壓力,但并不意味著linux-next tree的角色定位發生了變化。
到這里,我們似乎應該比較了然了,對于新增的驅動我們提交的對象就是staging tree。但Greg在2009年3月18號發表的一篇博文帶來了一些變故。
在文章中,Greg提到在數月前的Linux內核開發者的會議上,經過討論Linux-staging tree的定位發生了變化,但還是很多人對staging tree究竟是什么有些疑惑。因此,Greg在這篇文章里重申了staging tree究竟是什么和不是什么(大概意思和上面引用的那封信里的內容類似)。并且,staging tree里的代碼也已經被合并到了Linux內核代碼里,位置正是本文開始提到的drivers/staging。也就是說,自2.6.28內核開始,我們如果要測試staging tree里的驅動程序或者文件系統,并不需要clone一個staging tree再合并到mainline內核里,mainline本身就已經包含了staging tree的代碼了。對于Linux驅動開發者來說,我們也可以clone linux-next tree并以它為基礎來提交驅動程序。
那這樣是不是意味著Greg的linux staging tree已經沒用了呢?我在提交驅動的時候也有這樣的疑問,因此特意寫信向Greg求證。Greg的回復說,如果我們要把新增的driver提交給他本人處理,還是可以繼續基于linux staging tree來做patch;如果我們的工作不止是開發staging driver,比如還在為其他內核代碼開發補丁,那么基于linux-next tree來制作patch也是可以的。
附:
Linux-next tree:?
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
http://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Linux-staging tree:
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
這里需要注意的是,git協議的端口號是9418,因為很多公司的防火墻只會開放80端口,所以clone代碼倉庫時如果git協議超時,不妨試試http協議。
轉載于:https://www.cnblogs.com/wwang/archive/2011/03/08/1970432.html
總結
以上是生活随笔為你收集整理的小议Linux staging tree的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 存储过程和SQL语句比较【转】
- 下一篇: Linux下进程的建立