This page linked from [ X31 に Debian ]

X22 に Debian

IBM ThinkPad? X22 (2662-9DJ) に Debian をインストール。
とりあえずは純 woody 環境であがいてみる。

ポイント

リンク

http://www.jp.debian.org/releases/stable/i386/install.ja.html
http://debian.fam.cx/
http://www-6.ibm.com/jp/domino01/linux/hardware/loperate.nsf/hardinfo/89DFC19742BEE60F49256B5200250EFD?OpenDocument
http://www-6.ibm.com/jp/domino04/pc/support/Sylphd03.nsf/jtechinfo/SYJ0-0120AAA
http://nira.s25.xrea.com/temp/ThinkPad.html

http://myweb.tiscali.co.uk/burtonini/computing/debian-on-x22.html Debian
http://www.burtonini.com/computing/debian-on-x22.html Debian
http://www.tamaru.kuee.kyoto-u.ac.jp/~kobayasi/linux/x22/ Plamo
http://wistaria.ap.t.u-tokyo.ac.jp/linux/tpx22.html RH8
http://wunmr.wustl.edu/~gelb/x22.html RH7.3
http://www.bath.ac.uk/~masrjb/x22.html RH7.2
http://csperkins.org/linux-on-thinkpad-x22.html RH7.2
http://www.e-gineer.com/instructions/install-ibm-thinkpad-x22.phtml RH7.2
http://www.linuxcare.com/labs/certs/ibm/thinkpad/x22/ Caldera, RH, SuSE, Turbo

ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/
http://www.er.ams.eng.osaka-u.ac.jp/user/yasutake/debian/xfree86-woody.html

基礎情報

メモリは増設して 256MB にしてある。
キーボードは日本語のまま。
Windows2000 と Debian woody のデュアルブートにする。
インストーラ FD を作るのがめんどうなので、インストーラは DOS から loadlin で起動。(後で考えると FD 作った方が楽だったかも)
ブートローダは LILO で。他のわかんないし。

DOS 起動ディスクを作る

デフォルトで入ってた Windows2000 では、えーと、ほら、なんつーの?、あの、「DOS で起動」ってやつ、あれができない。
なので loadlin するためには「DOS で起動」するための手段を用意しなきゃなんない。
ほかの Windows98 かなんかのマシンで起動ディスクを作ってもいいけど、どうせなら X22 だけでなんとかしたい。
で、D2D を起動すると Windows98 のロゴが出ることに気づいて、こんな感じで DOS 起動ディスクを作れることが判明した。

この FD で起動して、rename した AUTOEXEC.BAT を実行すると MBR を元に戻すことができる。っぽい。

loadlin を使う/使わないにかかわらず、このディスクは必ず作っておくこと
LILO などで MBR を上書きすると D2D を実行できなくなる可能性がある。http://itpro.nikkeibp.co.jp/free/ITPro/OPINION/20030311/1/

パーティショニング

以前試したとき、なぜか FIPS がうまくつかえなかった。
なので、こんな感じの手順でやった。ような気が。

カーネルと LAN

X22 の NIC は eepro100 モジュールが使える、はずだが 2.2 カーネルの eepro100 だとぜんぜんスビードが出なかったりエラーメッセージを吐いたりする。
なので 2.4 カーネルに入れ替える方向で。

ハイバネ領域を作る

http://www-6.ibm.com/jp/domino05/pc/download/download.nsf/DownloadSearchView/E06CECE434B3EA3C49256CE60053BF9A
のハイバネーション・ユーティリティ (スタンドアロン・ブートの方) を使う。
もっと新しいバージョンのが出ているかもしれないので
http://www-6.ibm.com/jp/domino04/pc/support/Sylphd03.nsf/jtechinfo/SYJ0-0120AAA
あたりで確認のこと。

FAT32 に十分空き容量はあるはずなのに、ページングファイルは0にしたのに、デフラグもかけたのに、"Create file" だと「容量が足りない」と言われてうまくいかなかった。
"Create partition" でハイバネ領域をパーティションとして作成。
Primary として作られる。

インストーラの準備

vanilla だと「md 止まり」でうまくいかないので idepci を試す。
ftp://ftp.jp.debian.org/debian/dists/woody/main/disks-i386/ の以下のものを C:\debian\ にディレクトリ構成を保ったまま落とす。

また、カーネル 2.4 を入れるのに必要な以下の .deb を C:\debian\deb\ に落としておく。(インストーラでパーティションを切るだけなら不要。)

インストーラを起動

DOS 起動ディスクで起動する。
インストーラを起動。(「:」は Shift +「;」で。)

> c:
> cd \debian\current\idepci
> install.bat

ここで画面が真っ黒になってあせる。
FB が悪さしてるらしく、Fn+F8 を2回押せば直る。
インストーラ実行中に仮想コンソール切り替えで真っ黒になったときも同様に対処。

インストーラ実行中のポイント

カーネルの「インストールメディアの選択」は「ハードディスク」→「リスト」を選ぶと DOS パーティションから見つけてくれる。
「デバイスドライバモジュールの選択」で「net」→「eepro100」を選ぶ。(オプション不要)
基本システムの「インストールメディアの選択」も「ハードディスク」→「リスト」で。
Windows2000 も D2D も自動で LILO の項目に追加してくれる。けど D2D はうまくブートできない。
「Apt Configuration」はとりあえず「edit sources list by hand」を選んで、空のまま終了しておく。
tasksel とか dselect はここでは実行せず、カーネルを 2.4 に入れ替えてネットワークが使えるようになった後で。

カーネルを 2.4 に

# cd /etc
# cp -p lilo.conf lilo.conf.orig
# vi lilo.conf

image=/vmlinuz の下に initrd=/initrd.img という行を追加。

# mount /dev/hda1 /mnt
# cd /mnt/debian/deb
# dpkg -i ash_0.3.8-37_i386.deb
# dpkg -i zlib1g_1%3a1.1.4-1_i386.deb
# dpkg -i cramfsprogs_1.1-3_i386.deb
# dpkg -i initrd-tools_0.1.32woody.3_all.deb
# dpkg -i kernel-image-2.4.18-686_2.4.18-5_i386.deb

dpkg -i kernel... の質問で、initrd.img のシンボリックリンクは作る、LILO はインストールする、と答える。
で、リブート。

今後カーネル再構築に失敗してブートできなくなることがありそうなので、別なバージョンのカーネルも入れておく。

ここまで行けば

あとはどんどんパッケージを入れられる。
ネットワークも使えるし。
/etc/apt/sources.list 書いて apt 使うなりなんなりで。


X

チップは ATI Radeon Mobility M6 LY らしい。

vesa ドライバならそれなりに動く。
が、しばらくほっておいたり mplayer を起動すると

Caught signal 4.  Server aborting

とログに残して落ちる。
バグらしい。バージョンアップで解決するらしい。
http://lists.debian.or.jp/debian-users/200205/msg00447.html

DPMS が原因?
http://www.paken.org:8080/linux/linux-tips/dpms.html
http://www.netfort.gr.jp/~ohura/diary/200206-3.html#25-1
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=159783&archive=yes
http://lists.debian.or.jp/debian-users/200205/msg00447.html

apt-get install xserver-xfree86 xbase-clients xfonts-base xterm でインストール。

Manage XFree86 4.x server configuration file with debconf? -> Yes
Select the desired X server driver. -> vesa
Use kernel framebuffer device interface? -> Yes
Please select the XKB rule set to use. -> xfree86
Please select your keyboard model. -> jp106
Please select your keyboard layout. -> jp
Please select your keyboard variant. -> (なし)
Please select your keyboard optios. -> ctrl:nocaps
Please select your mouse port. -> /dev/psaux
Please choose the entry that best describes your mouse. -> PS/2
Is your monitor an LCD device? -> Yes
Please choose a method for selecting your monitor characteristices. -> Medium
Please select your monitor's best video mode. -> 1024x768 @ 60Hz
Select the video modes you would like the X server to use. -> 1024x768
Please select your desired default color depth in bits. -> 16

再設定は dpkg-reconfigure xserver-xfree86 で。

http://www.opensource.gr.jp/~kmuto/xfree86 の 4.2.1 には radeon ドライバがある
が、いまいち調子がよくない。
APM との相性が悪いのか、サスペンド/ハイバネからの復帰時に固まることがある。

sid の X では radeon 関連がかなり修正されてるっぽい。
そっちは調子いいのかな?

APM

上記手順でハイバネ領域作成、カーネルを 2.4.18-686 に入れ替えた場合。
modprobe apm で apm モジュールをロードすれば Fn + F4 や apm -s のサスペンド、Fn + F12 のハイバネともに可能っぽい。
/etc/modules に apm という行を追加するか modconf で kernel/arch/i386/kernel の apm をロードすれば、OS 起動時に自動でロードしてくれる。

サスペンドからの復帰がうまくいかないときは CONFIG_APM_ALLOW_INTS=y としてカーネルを再構築するといいかも。
(手順は下記「カーネル再構築」の項参照)

X の radeon ドライバと相性悪いっぽい。上記 X の項を参照。

ハイバネやサスペンドから復帰するとキーリピートがやたら遅くなる。
kbdrate で再設定すべし。
http://pc.2ch.net/test/read.cgi/linux/1014196962/748-758n
http://www.tamaru.kuee.kyoto-u.ac.jp/~kobayasi/linux/x22/

USB

$ sudo apt-get install usbutils hotplug devfsd

して、/etc/default/devfsd で MOUNT=yes とすればおっけー。
キーボード、マウス、シリアル変換ケーブルあたりは特に問題なく使えてる。
うそ。なんかおかしいこともある。気がする。ような。
X22 固有の問題なのかそうでないのかよくわからない。

PS/2 キーボード + USB-PS2 変換器を使っているのだが、「_」や「|」が入力できないことがある。

# /etc/init.d/hotplug stop
# modprobe usbkbd
# /etc/init.d/hotplug start

でなぜか再生。

http://www.tamaru.kuee.kyoto-u.ac.jp/~kobayasi/linux/x22/ では「ハイバネ復帰後におかしくなる」とあるが、再現しない。

ドッキングステーション

未着手。

PCMCIA

$ sudo apt-get install pcmcia-cs kernel-pcmcia-modules-2.4.18-686

して、/etc/default/pcmcia で PCIC=yenta_socket とすればおっけー。
カードさしっぱなしだとサスペンドやハイバネがうまくいかないことがあった。

無線 LAN

woody-proposed-updates のカーネル 2.4.20 なら orinoco_pci.o が入っているが、かなり古いバージョン。
しばらく使っていると通信できなくなった。

$ sudo apt-get install wireless-tools
$ sudo apt-get install kernel-headers-`uname -r`
$ wget http://ozlabs.org/people/dgibson/dldwd/orinoco-0.13c.tar.gz
$ tar xzvf orinoco-0.13c.tar.gz
$ cd orinoco-0.13c
$ KERNEL_HEADERS=/usr/src/kernel-headers-`uname -r`/include make -e
$ sudo make install
$ modprobe orinoco_pci

で使える、かな?

バージョン上げてみる

$ wget http://ozlabs.org/people/dgibson/dldwd/orinoco-0.13e.tar.gz
$ tar xzvf orinoco-0.13e.tar.gz
$ cd orinoco-0.13e
$ KERNEL_HEADERS=-I/usr/src/kernel-headers-`uname -r`/include KERNEL_SRC=~/src/kernel/kernel-source-2.4.18 make -e
$ KERNEL_HEADERS=-I/usr/src/kernel-headers-`uname -r`/include KERNEL_SRC=$HOME/src/kernel/kernel-source-2.4.18 ORINOCODIR=$HOME/src/orinoco-0.13e sudo make -e install
$ modprobe orinoco_pci

なんかうまくいかない。

HDD チューニング

hdparm -d /dev/hda すると DMA が off になっている。
hdparm -d1 /dev/hda で on にして hdparm -t /dev/hda でベンチマーク。
CONFIG_IDEDMA_PCI_AUTO=y でカーネルを構築すると自動で on になるらしい。
-d1 すると -c は影響なかった。
http://libra.higashi.hit-u.ac.jp/manual/hdparm.html

カーネル再構築

$ sudo apt-get install kernel-package
$ sudo apt-get install kernel-source-2.4.18
$ sudo apt-get install libncurses5-dev
$ sudo apt-get install fakeroot

$ mkdir -p ~/src/kernel
$ cd ~/src/kernel

$ tar xjvf /usr/src/kernel-source-2.4.18.tar.bz2

$ cd kernel-source-2.4.18
$ make menuconfig

Load an Alternate Configuration File
  /boot/config-2.4.18-686
General setup  --->
  [*] Power Management support
  [ ]   ACPI support
  <M>   Advanced Power Management BIOS support
  [ ]     Ignore USER SUSPEND
  [ ]     Enable PM at boot time
  [ ]     Make CPU Idle calls when idle
  [ ]     Enable console blanking using APM
  [ ]     RTC stores time in GMT
  [*]     Allow interrupts during APM BIOS calls
  [ ]     Use real mode APM BIOS call to power off

$ diff /boot/config-2.4.18-686 .config

$ make-kpkg clean
$ MODULE_LOC=../modules fakeroot make-kpkg --revision local1 --initrd kernel-image kernel-headers

$ cd ..
$ sudo dpkg -i kernel-headers-2.4.18_local1_i386.deb kernel-image-2.4.18_local1_i386.deb
$ sudo init 6

Sound

intel8x0 らしい。
http://www.linuxcare.com/labs/certs/ibm/thinkpad/x22/suse72-config.epl

こんなんで alsa のモジュール作ればうまくいくかなと思ったけど、なんかうまくいかんすよ。
モジュールをロードできない。
あきらめぎみなんでおざなりぎみ。

http://www.melt.kyutech.ac.jp/~ueno/HowTo/alsa.html

$ cd ~/src/kernel
$ sudo apt-get install alsa-headers  (いらないかも)
$ sudo apt-get install libasound2-dev (いらないかも)
$ sudo apt-get install alsa-source
Select cards to be built. -> intel8x0
Build ALSA driver with ISA PnP? -> No
Build ALSA driver with debugging code? -> No

$ less /etc/alsa/alsa-source.conf
; なぜか反映されていない。

$ sudo dpkg-reconfigure alsa-source
$ less /etc/alsa/alsa-source.conf

$ tar xzvf /usr/src/alsa-driver.tar.gz

$ cd ~/src/kernel
$ MODULE_LOC=../modules fakeroot make-kpkg --revision local1 --initrd modules-image

$ cd ..

$ sudo apt-get install alsa-base
Stop ALSA drivers forcibly before suspend? -> Yes (念のため)

$ sudo apt-get install alsaconf
$ sudo alsaconf
Select card -> 0x31 Intel_i810/810E,i820,i830,i840,MX440
Card identifier -> CARD_0 (デフォルト)
Max. playback frame size in kB (4-128) -> なし (デフォルト)
Max. capture frame size in kB (4-128) -> なし (デフォルト)
Max. microphone frame size in kB (4-128) -> なし (デフォルト)
Select card -> 0 No_more_cards
Do you want to modify /etc/alsa/modutils/0.5? -> Yes

$ sudo dpkg -i alsa-modules-2.4.18_0.9.0+beta12+3+p0+local1_i386.deb
$ sudo /etc/init.d/alsa start



ご意見・ご質問などはこちらへ。(不調)
名前 :