2006-03-23

X32にcentos-ウィンドウマネージャ

ウィンドウマネージャはtwm。
ごてごてしたのは嫌い。複数画面切り替え機能もいらないのでtwmで十分。

$ switchdesk twm
で、変更。

.Xclients-defaultに起動されるアプリが書かれているので、順次書き換え。
今の、.Xclients-defaultは以下のとおり。

-------
#!/bin/bash
# (c) 2000 Red Hat, Inc.

#twm &
xmodmap -e "keycode 22 = Delete Terminate_Server"
emiclock -geometry +892+-2 &
xterm -geometry 80x24+0+0 -iconic -name login &
rxvt -geometry 80x45+0+0 &
rxvt -sl 1500 -geometry 80x30+110+314 &
exec /usr/X11R6/bin/twm
-------

今の、.twmは以下のとおり。
-------
#
# $XConsortium: system.twmrc,v 1.8 91/04/23 21:10:58 gildea Exp $
#
# Default twm configuration file; needs to be kept small to conserve string
# space in systems whose compilers don't handle medium-sized strings.
#
# Sites should tailor this file, providing any extra title buttons, menus, etc.
# that may be appropriate for their environment. For example, if most of the
# users were accustomed to uwm, the defaults could be set up not to decorate
# any windows and to use meta-keys.
#
#AutoRaise { "rxvt" }

NoGrabServer
RestartPreviousState
DecorateTransients
IconRegion "600x200+0+0" NORTH WEST 0 0

TitleFont "-misc-fixed-bold-r-normal--14-*-*-*-*-*-iso8859-1"
ResizeFont "-misc-fixed-bold-r-normal--14-*-*-*-*-*-iso8859-1"
MenuFont "-misc-fixed-bold-r-normal--14-*-*-*-*-*-iso8859-1"
IconFont "-misc-fixed-bold-r-normal--14-*-*-*-*-*-iso8859-1"

TitleButtonBorderWidth 1
FramePadding 1
TitlePadding 8
#ClientBorderWidth
ButtonIndent 1

Color
{
BorderColor "slategrey"
DefaultBackground "maroon"
DefaultForeground "gray85"
TitleBackground "maroon"
TitleForeground "gray85"
MenuBackground "maroon"
MenuForeground "gray85"
MenuTitleBackground "gray70"
MenuTitleForeground "maroon"
IconBackground "maroon"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "maroon"
IconManagerForeground "gray85"
}

#
# Define some useful functions for motion-based actions.
#
MoveDelta 3
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }

#
# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish
#
Button1 = : root : f.menu "defops"

Button1 = m : window|icon : f.function "move-or-lower"
Button2 = m : window|icon : f.iconify
Button3 = m : window|icon : f.function "move-or-raise"

Button1 = : title : f.function "move-or-raise"
Button2 = : title : f.raiselower

Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify

Button1 = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify

#
# And a menus with the usual things
#
menu "defops"
{
"Twm" f.title
"Rxvt" !"rxvt -sl 1500&"
"XTerm" !"xterm&"
"Raise" f.raise
"Lower" f.lower
"" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"" f.nop
"Kill" f.destroy
"Delete" f.delete
"" f.nop
"Restart" f.restart
"Exit" f.quit
}

NoTitle
{
"EmiClock"
}

X32にcentos-まずはインストール-

インストールはなんも考えずに入れるだけ。

サウンドがうまくならなかったり、無線LANが認識しなかったりしたんだけど、
まあ使わないからよし。

2006-03-20

x206にcentosインストール

結局適切なドライバディスクを作れば良いだけだったのですが、試行錯誤しながらで
時間がかかりました。

http://fedora.jp/pipermail/users/2005-March/009710.html
http://www.gemx.co.jp/modules/tinycontent4/rewrite/tc_2.html
とかを見て作業しました。以下作業の流れです。

0. centOS4.2をインストールしたマシンの準備
x206でなくって、別のマシンにとりあえずインストールしました。
モジュールコンパイルに時間がかかるので速いマシンのほうが幸せかも。

1. カーネルソースの準備
CentOS4.2では、kernel-2.6.9-22.EL.src.rpmでした。
これを、ルートでインストールしたら、/usr/src/redhat以下に入ります。
で、/usr/src/redhat/SPECSにて、
# rpmbuild -bp --target=i586 kernel-2.6.spec
すると、/usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9以下に
展開されます。
私はこれを、
# mv linux-2.6.9 /usr/src/linux-2.6.9-i586
と移動して、作業しました。

さらに、
# rpmbuild -bp --target=i686 kernel-2.6.spec
して、i686用を作成して、こちらは、/usr/src/linux-2.6.9-i686
に移動しました。

2. aacraid用のソースを展開
IBMのServerRAID supportCDからソースを展開しました。
linux/sata/driver/aacraid-1.1.5-2387.rpmをインストールすると、
/opt/Adaptec/aacraid/以下にファイルが出来たので、この中の
/opt/Adaptec/aacraid/aacraid_source.tgzを、
/usr/src/linux-2.6.9-i586/drivers/scsi/aacraid

/usr/src/linux-2.6.9-i686/drivers/scsi/aacraid
に展開しました。

3. モジュールの準備
インストール時のカーネルがi586だったので、i586版のモジュールも
必要みたいです。
なので、2.6.9-22.EL i586, 2.6.9-22.ELsmp i586, 2.6.9-22.EL i686,
2.6.9-22.ELsmp i686 の4種類のモジュールを作成しました。

3.1 2.6.9-22.EL i586 用のモジュール作成

# cd /usr/src/linux-2.6.9-i586

初期化します
# make mrproper

i586用コンフィグファイルコピー
# cp configs/kernel-2.6.9-i586.config .config

Makefileの4行めぐらいのEXTRAVERSIONを以下のように編集
EXTRAVERSION = -22.EL

.configを再作成
# make oldconfig

モジュールコンパイル
# make modules

出来たモジュールのstripと確認
# cd drivers/scsi/aacraid
# strip --strip-debug aacraid.ko
# strings aacraid.ko | grep vermagic
vermagic=2.6.9-22.EL 586 REGPARM 4KSTACKS gcc-3.4
ってなっていたらば完成なので、
# mv aacraid.ko aacraid.ko-2.6.9-22.EL-586
と退避しておく

3.2 2.6.9-22.ELsmp i586 用のモジュール作成

コピーするコンフィグファイルが、kernel-2.6.9-i586-smp.config
になって、
MakefileのEXTRAVERSIONが以下のようになる以外の手順は3.1と同じ
EXTRAVERSION = -22.ELsmp

で、最後の確認の所で、
# strings aacraid.ko | grep vermagic
vermagic=2.6.9-22.ELsmp SMP 586 REGPARM 4KSTACKS gcc-3.4
で完成なので、
# mv aacraid.ko aacraid.ko-2.6.9-22.ELsmp-586
と退避しておく


3.3 2.6.9-22.ELsmp i686 用のモジュール作成

最初に作っておいた、/usr/src/linux-2.6.9-i686で作業します。

コピーするコンフィグファイルが、kernel-2.6.9-i686.config
になる以外は、3.1と同じ手順で作業して、最後の確認の所で、
# strings aacraid.ko | grep vermagic
vermagic=2.6.9-22.EL 686 REGPARM 4KSTACKS gcc-3.4
ってなっていたらば完成なので、
# mv aacraid.ko aacraid.ko-2.6.9-22.EL-686
と退避しておく


3.4 2.6.9-22.ELsmp i686 用のモジュール作成

コピーするコンフィグファイルが、kernel-2.6.9-i686-smp.config
になる以外は、3.2と同じ手順で作業して、最後の確認の所で、
# strings aacraid.ko | grep vermagic
vermagic=2.6.9-22.ELsmp SMP 686 REGPARM 4KSTACKS gcc-3.4
で完成なので、
# mv aacraid.ko aacraid.ko-2.6.9-22.ELsmp-686
と退避しておく。


4 ドライバディスク作成

4.1 ベースを作成
適当なディスクをベースに作成します。
私は、IBMのServerRaidのCD内の、aac-linux-i686-rhel4.imgを
使いました。

4.2 モジュールファイルの作成
フロッピをマウントすると、modules.cgzというファイルがあります。
これを差し替えればOKなのです。
このファイルは、モジュールをcpioでまとめて、gzipしたものだそうです。

上書きするので、展開は必要ないですけれど、展開は、
# gzip -dc modules.cgz | cpio -id
で出来ます。

作成には、まず適当なディレクトリを作って移動してから、
# mkdir 2.6.9-22.EL 2.6.9-22.ELsmp
# mkdir 2.6.9-22.EL/i586 2.6.9-22.EL/i686
# mkdir 2.6.9-22.ELsmp/i586 2.6.9-22.ELsmp/i686
とディレクトリを作ります。

それから、3で用意した4つの*.koをそれぞれのディレクトリに、
aacraid.koという名前に戻してコピーします。
この時点で、このディレクトリには、以下のファイルがあります。
# find -name *.ko
./2.6.9-22.ELsmp/i686/aacraid.ko
./2.6.9-22.ELsmp/i586/aacraid.ko
./2.6.9-22.EL/i686/aacraid.ko
./2.6.9-22.EL/i586/aacraid.ko

これを、modules.cgzにまとめるために、以下のコマンドでまとめます。
# find -name *.ko | cpio -oH crc | gzip -9 > modules.cgz

これを、フロッピに書き戻せばドライバディスクの完成です。

CentOSのインストーラ起動時に、
linux ddで、ドライバディスクがある事を指定して、今作ったディスクを
読み込ませれば、無事にServerRAID 7tを認識させる事が出来ました。