|
このページは「24環境」の情報です 第11回 nfsルートで大規模UNIX環境 †海老原祐太郎
2003/6/16
Apache Webサーバ等の大規模なソフトウェアをコンパイルするときにはフル機能のDebian for SH
がインストールされた環境があると便利です。 今回のターゲット機はCAT709を想定します。 準 備 †開発機をnfsマシンとしますので、開発機にnfsサーバをインストールしておいてください。 開発機で # apt-get install nfs-user-server portmap CAT709のカーネル †CAT709のカーネルにネットワークのデバイスドライバと 開発機にて $ cd CAT709-LINUX-KERNEL-DIRECTORY $ make menuconfig Network device support ---> Ethernet (10 or 100Mbit) ---> [*] Other ISA cards <*> NE2000/NE1000 support File systems ---> Network File Systems ---> <*> NFS file system support [*] Provide NFSv3 client support [*] Root file system on NFS $ make dep zImage これでmake すると arch/sh/boot/zImage ファイルが出来上がりますので XMODEM プロトコルで サーバー上に CAT709用のルートディレクトリを準備する †debian-for-sh のベースアーカイブを取得します。CDROMあるいは以下のURLから取得してください。 CDROM debian-for-sh/2002-07-21/disks-sh3/base-sh3-020721.tar.gz 開発機上にディレクトリを作り、ベースアーカイブを展開します。 $ mkdir cat709-root-dir $ cd cat709-root-dir $ su - Passwd: # tar xzfv /SOMEWHERE-DOWNLOAD/base-sh3-020721.tar.gz debian-for-sh3 のベースアーカイブが展開されましたら、このTIPSの第1回の『設定ファイルを書く』 nfs exports の設定 †サーバでnfs exprots の設定をします。以下のようにサーバの/etc/exports を編集します。 # vi /etc/ exports ------------ ファイルの中身 ---------- /SOMEWHERE/cat709-root-dir 192.168.7.0/255.255.255.0(sync,rw,no_root_squash) ------------ ここまで ------------- # /etc/init.d/nfs-user-server restart 実 行 †Linux機から端末プログラムを動かし、CAT701の電源を入れます。 >c console=ttySC0,115200 root=/dev/nfs nfsroot=192.168.7.123:/SOMEWHERE/cat709-root-dir (実際には改行入れずに1行) ip=192.168.7.100:192.168.7.123:192.168.7.1:255.255.255.0:supercat 各設定の引数の詳細は以下のとおり(カーネルソースのDocumentation/nfsroot.txtより) root=/dev/nfs This is necessary to enable the pseudo-NFS-device. Note that it's not a real device but just a synonym to tell the kernel to use NFS instead of a real device. nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> 続いて s キーをタイプしてカーネルを起動するとNFS-ROOTによりサーバ上に展開したファイルをマウントして起動します。 トラブルシュート †
初期状態であれば root ユーザーパスワードなしでログインできるはずです。
deb http://debian.dodes.org/debian sid main non-free contrib deb-src http://ftp.jp.debian.org/debian/ sid main non-free contrib deb-src http://non-us.debian.org/debian-non-US sid/non-US main contrib non-free |