最終更新:2022-11-09 (水) 21:42:34 (534d)
Ubuntu/Linuxカーネル
種類
GA (General Availability)
- LTSリリース時に採用されたバージョン
- Ubuntu Serverでは常にGAスタックがデフォルト
HWE
- 以降にリリースされたUbuntuで採用されているカーネルとXスタック
- Ubuntu 20.04では、デフォルトでHWEスタックがインストールされる
OEM
- Ubuntu認定ハードウェアでは、HWEカーネルの代わりに必要に応じてOEMカーネルがインストールされる
Ubuntu/Linuxカーネル/ソースコード
メモ
- 「半年ごと」というUbuntuのリリーススケジュールの関係で,Ubuntuの最新版で使われるカーネルのバージョンは「リリースの2ヵ月前ぐらいの最新版」
ドキュメント
- https://wiki.ubuntu.com/KernelCustomBuild (Moved)
- https://help.ubuntu.com/community/Kernel/Compile (ちょっと古い)
- https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel - a cleaner and more up-to-date guide to (simple) kernel building
- https://wiki.ubuntu.com/Kernel/SourceCode
サイト
Ubuntu/パッケージ
ソースコードの取得
- apt-get source linux-image-`uname -r`
- linux-image-`uname -r` - Linux kernel image for version 4.8.0 on 64 bit x86 SMP
uname -r Ubuntu 16.04.2 linux-image-4.8.0-36-generic Ubuntu 16.04.1 linux-image-4.4.0-31-generic Ubuntu 16.04 linux-image-4.4.0-21-generic?
ヘッダファイル
- linux-headers-`uname -r`
Ubuntu 16.04.2 linux-headers-4.8.0-36-generic? Ubuntu 16.04.1 linux-headers-4.4.0-31-generic? Ubuntu 16.04 linux-headers-4.4.0-21-generic
Ubuntu/Linuxカーネル/ソースコード
apt-get source
- apt-get source linux-image-$(uname -r)
- この方法がおすすめ
git clone
- git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release codename>.git
メインライン
現在のカーネルが,どの安定版のリリースまでの変更を取り込んでいるか
バージョンのみかた
$ dpkg -l | grep linux-image ii linux-image-3.8.0-19-generic 3.8.0-19.30 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP ii linux-image-3.8.0-23-generic 3.8.0-23.34 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP ii linux-image-3.8.0-25-generic 3.8.0-25.37 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
- linux-image-3.8.0-25-generic
- パッケージ自体のバージョンは「3.8.0-25.37」
- 25.37のうち,最初の数字は3.8ベースのカーネルパッケージをリリースしてから,「ABI(Application Binary Interface)が変更された回数」をあらわします。また,後ろの数字は「アップロード回数」
インストール
Ubuntu/Linuxカーネル/メインライン
- https://wiki.ubuntu.com/Kernel/MainlineBuilds
- ダウンロードしてきてdpkgすると起動時のメニューに表示されるはず
落とすもの
- linux-headers_<arch>.deb
- linux-headers_all.deb
- linux-image_<arch>.deb
古いのも同じ
- http://www.howopensource.com/2012/07/how-to-install-linux-kernel-3-5-quantal-in-ubuntu-12-04-11-10-11-04-10-10-and-10-04/
- download the previous stable kernel 3.0 / 3.1 / 3.2 / 3.3 / 3.4.6 / 3.5 / 3.7 from kernel.ubuntu.com and follow the same steps to install it.
- http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.1.10-precise/
- Use “dpkg -i *"
GRUBで選択できない場合
- PCの電源を入れたら「Shift」キーを押しっぱなしにする
ソースコード
メインライン
- Where can I get the source for these builds?
- In each directory there is a COMMIT file which defines the base commit in Linus' master tree from which they were built. The patches in the same directory ????-* are applied on top of this commit to make the build tree. A mirror of Linus' tree is available from git://kernel.ubuntu.com/virgin/linux.git.
- First download the COMMIT and patch files ????-* from the mainline build in question to a temporary directory:
git clone git://kernel.ubuntu.com/virgin/linux.git mainline cd mainline git checkout -b `cat ${MAINLINE}/COMMIT` git am ${MAINLINE}/????-*
独自
- https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
apt-get source linux-image-$(uname -r)
- or
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-precise.git
現在のカーネルが,どの安定版のリリースまでの変更を取り込んでいるかの確認
- Linux/proc/version_signature
user@ubuntu:~$ cat /proc/version_signature Ubuntu 3.2.0-29.46-generic-pae 3.2.24
Ubuntu/カーネルフレーバー
- http://gihyo.jp/admin/clip/01/ubuntu-topics/201210/26
- Ubuntu 12.10では,PAEに対応していないハードウェア用のカーネルは提供されません。