まとめindex
最新のトピック
KEYWORDS
CentOSでホームサーバー カーネル構築編
2012/05/12
カーネルの構築です。特に古いものを使う必要性も無いので、最新の3.3.3を選択しました。
#wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.3.tar.bz2
#tar jxvf linux-3.3.3.tar.bz2
#cd linux-3.3.3
#export LANG=C
#make menuconfig
カーネルの構築なんてものは、最初から綺麗にうまくいくと考えずにトライ&エラーでやるぐらいの気持ちで取り組まないとやってられません。元のカーネルを残しておけば、起動しなくても戻してやり直すことは出来ます。
#tar jxvf linux-3.3.3.tar.bz2
#cd linux-3.3.3
#export LANG=C
#make menuconfig
さて、今回のマシン構成で設定すべきはCPUのターボブーストを有効にすること。
Processor type and features
→ Symmetric multi-processing support →有効
→ Processor family →「Core2/newer Xeon」
→ SMT (Hyperthreading) scheduler support →有効
→ Multi-core scheduler support →有効
Power management and ACPI options
→ ACPI (Advanced Configuration and Power Interface) Support →有効
Power management and ACPI options
→ CPU Frequency scaling
→ CPU Frequency scaling →有効
→ CPU Frequency translation statistics →有効
→ CPU Frequency translation statistics details →有効
→ Default CPUFreq governor →performance
このあたりを気をつけてチェックしていけば、大丈夫。
あとは大体初期状態のままでも動くカーネルは出来上がります。自分はここから明らかにイラナイと思われるものを外していきますが、メモリ多く積んで居ればそのままでもまぁ、問題無いでしょう。
→ Processor family →「Core2/newer Xeon」
→ SMT (Hyperthreading) scheduler support →有効
→ Multi-core scheduler support →有効
Power management and ACPI options
→ ACPI (Advanced Configuration and Power Interface) Support →有効
Power management and ACPI options
→ CPU Frequency scaling
→ CPU Frequency scaling →有効
→ CPU Frequency translation statistics →有効
→ CPU Frequency translation statistics details →有効
→ Default CPUFreq governor →performance
exitして設定を保存したら構築です。数時間かかります。
#make
#make modules_install
#installkernel 3.3.3 arch/x86_64/boot/bzImage System.map
この後、/etc/grub.conf を編集します。新しく構築したカーネルでの起動オプションは既に設定してあるはずですが、「hiddenmenu」が有効になっていて、起動時にメニューを出さずに初期設定のまま起動するようにしてあります。そこでhiddenmenuを削除(またはコメントアウト)して起動時にメニューでカーネルを選択できるようにしてあげます。
#make modules_install
#installkernel 3.3.3 arch/x86_64/boot/bzImage System.map
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
#hiddenmenu
title CentOS (3.3.3)
root (hd0,0)
kernel /boot/vmlinuz-3.3.3 ro root=UUID=01d1c956-ee64-46d2-a4f1-297af3556c67 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /boot/initramfs-3.3.3.img
title CentOS (2.6.32-220.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=01d1c956-ee64-46d2-a4f1-297af3556c67 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /boot/initramfs-2.6.32-220.el6.x86_64.img
ツイート