カーネルの再構築

無線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
     Hermes chipset 802.11b support (Orinoco/Prism2/Symbol) (NEW)
     USB ZD1201 based Wireless device support
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 --->
    802.1d Ethernet Bridging
  Device Drivers --->
   Network device support --->
    Universal TUN/TAP device driver support

(lm-sensors)
Device Drivers ->
 I2C support ->
   I2C device interface
     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

・起動確認
再起動後,新しいカーネルを選択して起動する.

http://wiki.steadfast.co.jp/index.php?Debian%A4%CE%A5%AB%A1%BC%A5%CD%A5%EB%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%BA%EE%C0%AE%CA%FD%CB%A1

http://now.ohah.net/ja/%E3%83%87%E3%83%93%E3%82%A2%E3%83%B3(Debian)/%E3%82%AB%E3%83%BC%E3%83%8D%E3%83%AB%E5%86%8D%E6%A7%8B%E7%AF%89