LinuxでRouterを作る - Kernelの再構築

Last Modified: 2004.02.18

4. Kernelの再構築

1. 全体の流れ

CFに書き込むことの出来るマシンに、2種類のLinuxをインストールする。
  1. Kernel再構築、rp-ppoeインストールに利用するための、コンパイル作業が可能なLinux
  2. Routerに使うための最小構成のLinux
この2種類のLinuxを利用して、CFにRouter環境を構築する。
今回は、CFをSCSIドライブとして認識可能なデスクトップで作業した。
コンパイル可能なLinux /dev/sdb2
Router用最小構成Linux /dev/sdb3
CF /dev/sdc1

2. kernelソースの入手

コンパイル可能なLinux(/dev/sdb2)を起動し、以下を/usr/srcに保存する。
kernel 2.4.20のソースファイル http://www.kernel.org/pub/linux/kernel/v2.4/ linux-2.4.20.tar.gz

3. カーネルの設定


 [root@router root]# cd /usr/src
 [root@router src]# tar zxvf linux-2.4.20.tar.gz          <--- ディレクトリlinux-2.4.20の下に展開される。
 [root@router src]# mv linux-2.4.20 linux-2.4.20-R        <--- Routerという意味で R を付ける。
 [root@router src]# rm linux                              <--- linuxは、シンボリックリンク。
 [root@router src]# ln -s linux-2.4.20-R linux            <--- linux-2.4.20へのシンボリックリンクをlinuxとして作成。
 [root@router src]# cd linux
 [root@router linux]# make mrproper                       <--- 設定を初期化
 [root@router linux]# make menuconfig                     <--- カーネルの設定

以下は標準から変えた設定。
Code maturity level options Prompt for development and/or incomplete code/drivers * これを有効にしないと、Kernel Mode PPPoEのオプションを指定できない。
Loadable module support Enable loadable module support   モジュール機能は利用しない。
Processor type and features Processor family Pentium-MMX Geode GX1はMediaGXなのでこれか?
Symmetric multi-processing support    
General setup Support for hot-pluggable devices    
Power Management support    
Block devices Loopback device support * mkinitrdで利用。
Networking options Network packet filtering (replaces ipchains) * iptablesを利用するため。
Socket Filtering * DHCPを利用するため。
IP: TCP syncookie suppport (disabled per default) * SYN-Flood対策。
IP: Netfilter Configuration   この下は、iptables利用のため EXPERIMENTAL 以外は全部 *
ATA/IDE/MFM/RLL support IDE, ATA and ATAPI Block devices Include IDE/ATAPI CDROM support    
CMD640 chipset bgfix/support    
RZ1000 chipset bugfix/support    
Cyrix CS5530 MediaGX chipset support * Geode GX1はこれを使っている。
Intel PIIXn chipsets support    
SCSI support SCSI support    
Network device support EtherExpressPro/100 support    
RealTek RTL-8139 PCI Fast Ethernet Adapter support * MicroPCで利用しているのはこれ。
PPP (point-to-point protocol) support * PPPoEのため。
PPP (point-to-point protocol) support PPP support for async serial ports *
PPP support for sync tty ports *
PPP Deflate compression *
PPP BSD-Compress compression *
PPP over Ethernet (EXPERIMENTAL) *
Character devices Standard/generic serial support    
Non-standard serial ports support * PPPoEのため。
Non-standard serial ports support HDLC Line discipline support *
Mice Mouse Support    
/dev/nvram support *  
Enhanced Real Time clock Support *  
/dev/agppart (AGP Support)    
Direct Rendering Manager (XFree86 DRI support)    
File systems Kernel automounter version 4 support    
ISO 9660 CDROM file system support    
Network File Systems NFS file system support    
NFS server support    
Sound Sound card support    
USB support Support for USB    

4. Makefileの修正


 EXTRAVERSION = -R                                        <--- カーネルのバージョン番号を2.4.20-Rに設定。

5. カーネルのコンパイル


 [root@router linux]# make dep ; make clean               <--- 依存関係チェックと初期化。
 [root@router linux]# make bzImage                        <--- カーネルの作成のみ行う。
make bzImage を使い、実際のインストールはここでは行わない。

<Prev Top Next>
Copyright(C) 2001-2003 Katsuyuki Kobayashi.
このサイトへのリンクや引用時はメール頂戴
webmaster@kkoba.com