カーネルの再構築
無線USB と lm-sensors を導入するためのカーネル再構築.
・コンパイル環境の設定
# apt-get install autoconf automake binutils gcc gettext kernel-package libncurses5-dev libtool linux-kernel-headers make
・ソースのダウンロードと展開
# cd /usr/src
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-xxx
# tar zvxf linux-*
・カーネルコンパイルのための設定
# ln -s linux-xxx linux
# cd linux
# make mrproper
# make include/linux/version.h
# cd include
# ln -s asm-i386 asm
# touch autoconf.h
・カーネルのコンパイル
# cd /boot
# cp config-xxx /usr/src/linux/.config
# cd /usr/src/linux
# make oldconfig
# make menuconfig
以下の項目を追加.
(無線USB)
Networking --->
Networking options --->
[*] IP: advanced router
[*] IP: policy routing
Device Drivers --->
Network device support --->
Wireless LAN (non-hamradio) --->
[*] Wireless LAN drivers (non-hamradio) & Wireless Extensions
iptablesでフィルタとかを使う場合は追加する。便利なのであったほうが良い。
Networking --->
Networking options --->
[*] Network packet filtering (replaces ipchains) --->
[*] Bridged IP/ARP packets filtering
Core Netfilter Configuration ---> 以下選べるの全部チェック
IP: Netfilter Configuration ---> 以下選べるの全部チェック
Bridge: Netfilter Configuration ---> 以下選べるの全部チェック
ブリッジ使う場合は追加する.なくてもいい.
Networking --->
Networking options --->
Device Drivers --->
Network device support --->
(lm-sensors)
Device Drivers ->
I2C support ->
I2C Hardware Bus Support -> 該当するチップセットをチェック.
設定が終わったらコンパイル.時間がかかるので気長に待つ.
# make clean
# make
# make bzImage
# make modules
# make modules_install
# make install
・grub の設定
コンパイルしたカーネルに応じて grub.conf の書き換え.
OSによっては menu.lst の場合もある.
自分の環境に合わせて書く.
# cd /boot
# vim grub/grub.conf
以下を追加
title Debian GNU/Linux, kernel 2.6.xxx
root (hd0,0)
kernel /boot/vmlinux-2.6.xxx root=/dev/sda1 ro
initrd /boot/initrd.img-2.6.xxx
savedefault
・起動確認
再起動後,新しいカーネルを選択して起動する.