在 Ubuntu 上面安裝 mainline kernels - Linux

By Erin
at 2014-07-15T14:25
at 2014-07-15T14:25
Table of Contents
所謂的 mainline kernels 就是在 The Linux Kernel Archives [1] 上面由 Linus
Torvalds 本人釋出的版本, 而 Ubuntu 本來有一個 Ubuntu Kernel PPA 專門用來編譯
這些 mainline kernels, 只是後來不曉得為何就不再使用 PPA 改用手動編譯的方式,
可能是因為 Linux kernel 的釋出方式有了許多變化,除了原本的 stable 跟 mainline
還另加入了 longterm 的支援, 而 Ubuntu 的 Kernel team 本來就有準備一個
http://kernel.ubuntu.com/~kernel-ppa/mainline/ 上面備份了所有的 mainline
kernels, 所以就繼續沿用這樣的名稱,但其實這上面還包括了 stable 跟 longterm 後
來所有的版本。
總之 http://kernel.ubuntu.com/~kernel-ppa/mainline/ 上面放的是沒有 Ubuntu 額外
加料的原始 kernel 版本,只是都編譯成了 Debian package, 所以想要使用的人可以直
接下載來安裝就可以使用了,而這些 kernel 如果在安裝上會是使用上有什麼問題,當然
也不會在 Ubuntu 的支援之中,這些 kernel 的存在只是用來測試的,藉由安裝不同的版
本來找出問題是在哪兩個版本之間發生的,或是在哪兩個版本之間解決的,進而幫助開發
者縮小問題發生的地方,來找出相關合適的修補檔。
但是這樣不斷地手動下載安裝,也是很麻煩的,所以我寫了一個小工具來幫忙,它就叫做
mainline-kernels.sh [2],下載後像下面這樣執行就可以看到使用說明:
$ ./mainline-kernels.sh --help
Usage ./mainline-kernels.sh:
-h|--help The manual of this script
-f|--from NUM Lower bound of kernel version
-t|--to NUM Upper bound of kernel version
-l|--list List available kernel versions
-r|--remove Remove mainline kernels
可以先使用 ./mainline-kernels.sh --list 來找出現在有哪些 kernel 可以使用。
$ ./mainline-kernels.sh --list
...
3.15~rc3-utopic 3.15~rc4-utopic 3.15~rc5-utopic
3.15~rc6-utopic 3.15~rc7-utopic 3.15~rc8-utopic
3.15-utopic 3.15.1-utopic 3.15.2-utopic
3.15.3-utopic 3.15.4-utopic 3.15.5-utopic
3.16~rc1-utopic 3.16~rc2-utopic 3.16~rc3-utopic
然後直接安裝想要的 Linux kernel
$ ./mainline-kernels.sh 3.16~rc4-utopic 3.16~rc5-utopic
或是指定一個範圍來安裝
$ ./mainline-kernels.sh --from 3.15~ --to 3.16
或是什麼都不指定直接執行,之後再慢慢從選單上面挑選。
$ ./mainline-kernels.sh
最後再將安裝的 Linux kernel 移除掉。
$ ./mainline-kernels.sh --remove
要提醒的一點是,這邊的版本號碼是遵循 Debian version 的規則,所以波浪符號有特別
的意義,可以參考我以前的文章[3]。
最後分享一下 Ubuntu to Mainline kernel version mapping [4],結束這一回合。
[1]: https://www.kernel.org/
[2]: https://bit.ly/mainline_kernels
[3]: http://fourdollars.blogspot.com/2010/06/debian-package-5.html
[4]: http://people.canonical.com/~kernel/info/kernel-version-map.html
--
http://about.me/fourdollars
--
Torvalds 本人釋出的版本, 而 Ubuntu 本來有一個 Ubuntu Kernel PPA 專門用來編譯
這些 mainline kernels, 只是後來不曉得為何就不再使用 PPA 改用手動編譯的方式,
可能是因為 Linux kernel 的釋出方式有了許多變化,除了原本的 stable 跟 mainline
還另加入了 longterm 的支援, 而 Ubuntu 的 Kernel team 本來就有準備一個
http://kernel.ubuntu.com/~kernel-ppa/mainline/ 上面備份了所有的 mainline
kernels, 所以就繼續沿用這樣的名稱,但其實這上面還包括了 stable 跟 longterm 後
來所有的版本。
總之 http://kernel.ubuntu.com/~kernel-ppa/mainline/ 上面放的是沒有 Ubuntu 額外
加料的原始 kernel 版本,只是都編譯成了 Debian package, 所以想要使用的人可以直
接下載來安裝就可以使用了,而這些 kernel 如果在安裝上會是使用上有什麼問題,當然
也不會在 Ubuntu 的支援之中,這些 kernel 的存在只是用來測試的,藉由安裝不同的版
本來找出問題是在哪兩個版本之間發生的,或是在哪兩個版本之間解決的,進而幫助開發
者縮小問題發生的地方,來找出相關合適的修補檔。
但是這樣不斷地手動下載安裝,也是很麻煩的,所以我寫了一個小工具來幫忙,它就叫做
mainline-kernels.sh [2],下載後像下面這樣執行就可以看到使用說明:
$ ./mainline-kernels.sh --help
Usage ./mainline-kernels.sh:
-h|--help The manual of this script
-f|--from NUM Lower bound of kernel version
-t|--to NUM Upper bound of kernel version
-l|--list List available kernel versions
-r|--remove Remove mainline kernels
可以先使用 ./mainline-kernels.sh --list 來找出現在有哪些 kernel 可以使用。
$ ./mainline-kernels.sh --list
...
3.15~rc3-utopic 3.15~rc4-utopic 3.15~rc5-utopic
3.15~rc6-utopic 3.15~rc7-utopic 3.15~rc8-utopic
3.15-utopic 3.15.1-utopic 3.15.2-utopic
3.15.3-utopic 3.15.4-utopic 3.15.5-utopic
3.16~rc1-utopic 3.16~rc2-utopic 3.16~rc3-utopic
然後直接安裝想要的 Linux kernel
$ ./mainline-kernels.sh 3.16~rc4-utopic 3.16~rc5-utopic
或是指定一個範圍來安裝
$ ./mainline-kernels.sh --from 3.15~ --to 3.16
或是什麼都不指定直接執行,之後再慢慢從選單上面挑選。
$ ./mainline-kernels.sh
最後再將安裝的 Linux kernel 移除掉。
$ ./mainline-kernels.sh --remove
要提醒的一點是,這邊的版本號碼是遵循 Debian version 的規則,所以波浪符號有特別
的意義,可以參考我以前的文章[3]。
最後分享一下 Ubuntu to Mainline kernel version mapping [4],結束這一回合。
[1]: https://www.kernel.org/
[2]: https://bit.ly/mainline_kernels
[3]: http://fourdollars.blogspot.com/2010/06/debian-package-5.html
[4]: http://people.canonical.com/~kernel/info/kernel-version-map.html
--
http://about.me/fourdollars
--
Tags:
Linux
All Comments

By Caitlin
at 2014-07-18T12:48
at 2014-07-18T12:48

By Necoo
at 2014-07-19T17:32
at 2014-07-19T17:32

By Tracy
at 2014-07-23T03:03
at 2014-07-23T03:03

By Puput
at 2014-07-26T06:24
at 2014-07-26T06:24

By Frederica
at 2014-07-29T23:44
at 2014-07-29T23:44

By Rachel
at 2014-08-01T08:18
at 2014-08-01T08:18

By Margaret
at 2014-08-04T00:28
at 2014-08-04T00:28
Related Posts
Slax 7.0.8

By Dorothy
at 2014-07-15T01:08
at 2014-07-15T01:08
Slax 7.0.8

By Odelette
at 2014-07-14T23:21
at 2014-07-14T23:21
灌完NetworkManager之後,xfce的權限問題

By Ingrid
at 2014-07-14T20:57
at 2014-07-14T20:57
fsck died with exit status 8

By Callum
at 2014-07-14T20:51
at 2014-07-14T20:51
Win 8.1 -> Linux Mint 17 LIVE 黑屏

By Yedda
at 2014-07-14T18:09
at 2014-07-14T18:09