SRPMからのカーネル構築についてメモ
下準備:http://wiki.centos.org/HowTos/I_need_the_Kernel_Source#head-a8dae925eec15786df9f6f8c918eff16bf67be0d
手順:http://wiki.centos.org/HowTos/Custom_Kernel
- SRPMを取得(「下準備」に場所が書いてある)
- % rpm -ivh <kernel SRPM>
- % cd ~/rpmbuild/SPECS
- % rpmbuild -bp --target=$(uname -m) kernel.spec
- % cd ~/rpmbuild/BUILD/kernel-****/linux-****
- .configを適宜いじる。configs/以下にあるやつをベースにするか、/boot以下にあるやつをベースにしても、どこかから持ってきてもなんでも良い。
- % cp .config configs/kernel-***.config
- configs/kernel-***.configの先頭に「# x86_64」もしくは「# i386」を追記。
- % cp configs/* ~/rpmbuild/SOURCES
- 「手順」4章にしたがってspecファイルを書き換え。パッチ周りはパッチ追加しないなら無視で。
- % rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log
最後のrpmbuildに--with ***とか--without ***とか付けて、必要十分なパッケージだけビルドするようにしたい。
少なくともxenは要らんだろう、というのは分かる。
実はx86だとupとsmpの区別が無く、--without upするとカーネル自体ビルドされないっぽい。
kabichkとかfipsは切ると時間短縮になる。
しかしまだイマイチ分かってない部分も多い。