Siburlog

SiblogだとSI BlogっぽいのでSiburlogとする

SRPMからのカーネル構築についてメモ

下準備:http://wiki.centos.org/HowTos/I_need_the_Kernel_Source#head-a8dae925eec15786df9f6f8c918eff16bf67be0d

手順:http://wiki.centos.org/HowTos/Custom_Kernel

 

  1. SRPMを取得(「下準備」に場所が書いてある)
  2. % rpm -ivh <kernel SRPM>
  3. % cd ~/rpmbuild/SPECS
  4. % rpmbuild -bp --target=$(uname -m) kernel.spec
  5. % cd ~/rpmbuild/BUILD/kernel-****/linux-****
  6. .configを適宜いじる。configs/以下にあるやつをベースにするか、/boot以下にあるやつをベースにしても、どこかから持ってきてもなんでも良い。
  7. % cp .config configs/kernel-***.config
  8. configs/kernel-***.configの先頭に「# x86_64」もしくは「# i386」を追記。
  9. % cp configs/* ~/rpmbuild/SOURCES
  10. 「手順」4章にしたがってspecファイルを書き換え。パッチ周りはパッチ追加しないなら無視で。
  11. % 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は切ると時間短縮になる。

しかしまだイマイチ分かってない部分も多い。