小议Linux staging tree
2.6.28版本起,內(nèi)核代碼的drivers下增加了一個(gè)staging目錄,這個(gè)目錄也是用來存放驅(qū)動(dòng)程序,只是這里的驅(qū)動(dòng)和上層目錄的不同,加載的時(shí)候內(nèi)核log會(huì)打印如下的語句:
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內(nèi)核郵件列表里發(fā)出一封信,宣布建立了另外一棵kernel tree,這就是Linux staging tree。Greg解釋到,staging tree建立之目的是用來放置一些未充分測試或者因?yàn)橐恍┢渌蛭茨苓M(jìn)入內(nèi)核的新增驅(qū)動(dòng)程序和新增文件系統(tǒng)。在信中,Greg羅列了開發(fā)者把代碼提交到staging tree應(yīng)該遵循哪些規(guī)則,以及哪些行為是在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建立的必要性有些疑問的,畢竟,在此之前我們已經(jīng)有了linux-next tree。Greg對這些疑問解釋到,staging tree只是收留新增的驅(qū)動(dòng)程序和文件系統(tǒng),并不接收對已有代碼的修改補(bǔ)丁。因此可以說,Greg的staging tree在很大程度上分擔(dān)了Stephen Rothwell身上的壓力,但并不意味著linux-next tree的角色定位發(fā)生了變化。
到這里,我們似乎應(yīng)該比較了然了,對于新增的驅(qū)動(dòng)我們提交的對象就是staging tree。但Greg在2009年3月18號發(fā)表的一篇博文帶來了一些變故。
在文章中,Greg提到在數(shù)月前的Linux內(nèi)核開發(fā)者的會(huì)議上,經(jīng)過討論Linux-staging tree的定位發(fā)生了變化,但還是很多人對staging tree究竟是什么有些疑惑。因此,Greg在這篇文章里重申了staging tree究竟是什么和不是什么(大概意思和上面引用的那封信里的內(nèi)容類似)。并且,staging tree里的代碼也已經(jīng)被合并到了Linux內(nèi)核代碼里,位置正是本文開始提到的drivers/staging。也就是說,自2.6.28內(nèi)核開始,我們?nèi)绻獪y試staging tree里的驅(qū)動(dòng)程序或者文件系統(tǒng),并不需要clone一個(gè)staging tree再合并到mainline內(nèi)核里,mainline本身就已經(jīng)包含了staging tree的代碼了。對于Linux驅(qū)動(dòng)開發(fā)者來說,我們也可以clone linux-next tree并以它為基礎(chǔ)來提交驅(qū)動(dòng)程序。
那這樣是不是意味著Greg的linux staging tree已經(jīng)沒用了呢?我在提交驅(qū)動(dòng)的時(shí)候也有這樣的疑問,因此特意寫信向Greg求證。Greg的回復(fù)說,如果我們要把新增的driver提交給他本人處理,還是可以繼續(xù)基于linux staging tree來做patch;如果我們的工作不止是開發(fā)staging driver,比如還在為其他內(nèi)核代碼開發(fā)補(bǔ)丁,那么基于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協(xié)議的端口號是9418,因?yàn)楹芏喙镜姆阑饓χ粫?huì)開放80端口,所以clone代碼倉庫時(shí)如果git協(xié)議超時(shí),不妨試試http協(xié)議。
轉(zhuǎn)載于:https://www.cnblogs.com/wwang/archive/2011/03/08/1970432.html
總結(jié)
以上是生活随笔為你收集整理的小议Linux staging tree的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 存储过程和SQL语句比较【转】
- 下一篇: poj 3576
