LibrettoL1にFedora Core 3
LibrettoL1へFedora Core 3をインストールした時の手順をまとめたものです。
Installは、WindowsXP/Linuxのマルチブートとするために、WindowsXPインストール後に行う。
40GByteのHDD Partitionは以下のように設定。
・hda1:基本:WindowsXP :NTFS: 20GByte ・hda2:基本:Linux-ext3 :/boot: 78MByte ・hda3:基本:Linux-ext3 :/ : 17GByte (・hda4:論理:論理Partition: :510MByte) ・hda5:論理:Linux-swap :swap :510MByte
・LibrettoL1へFedora Core 3インストール
インストールに必要なISOイメージをダウンロードしCDを作成する。
パッケージ名称 ダウンロード元 Fedora Core 3 ISO Image ftp://ftp.riken.go.jp/pub/Linux/fedora/core/3/i386/iso/
・CD boot Install
特殊な対応を行なう事無くインストール可能。
Install終了後(shutdown後)Rebootできないため電源ボタンを押し続けて電源を切るくらい。
・longrun & GKrelLongRun
再起動すると驚く程遅い。
これは、longrun設定がeconomyモードになっているためです。
変更するには、longrunコマンドにより行います。
FC3から標準のlongrunコマンドが動作します。
初回のみ必用 # mknod /dev/udev/devices/cpu/0/msr c 202 0 # mknod /dev/udev/devices/cpu/0/cpuid c 203 0 再起動 # modprobe cpuid # modprobe msr # longrun -f performance
GKrellmで利用するGKrelLongRunは、「2.2.0(開発版) for GKrellM-2.2.x 」を利用する。
パッケージ名称 ダウンロード元 gkrellongrun-2.2.0-dev.tar.gz http://www.fjts.org/~m/Soft/GKrelLongRun/
・X11設定
1280x600の解像度を16bit colorで使用するために以下の変更を行ないます。
/etc/X11/xorg.conf の「Section "Monitor"」項目設定へ、以下のModeLine設定を追加。
「Section "Screen"」「Modes」項目の「"800x600" "640x480"」を「"1280x600"」へ変更。
「DefaultDepth」項目と「Depth」項目の「24」を「16」へ変更。
/etc/grub/grub.confのkernelオプションへ「vga=0x405」を追加。
24bit colorで使用する場合は、「DefaultDepth」と「Depth」の変更はいりません。
/etc/X11/xorg.confの設定 Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor" ModelName "Unknown monitor" HorizSync 31.5 - 37.9 VertRefresh 50.0 - 70.0 Option "dpms" ModeLine "1280x600" 60.0 1280 1328 1512 1712 600 601 603 625 EndSection Section "Screen" Identifier "Screen0" Device "Videocard0" Monitor "Monitor0" DefaultDepth 16 SubSection "Display" Viewport 0 0 Depth 16 Modes "1280x600" EndSubSection EndSection /boot/grub/grub.confの設定 title Fedora Core (2.6.5-1.358) root (hd0,6) kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/ vga=0x405 rhgb quiet initrd /initrd-2.6.9-1.667.img
vgaオプションは、以下の通り。
vgaオプション モード 0x404 1280x600 8ビットカラー 0x405 1280x600 16ビットカラー 0x407 1280x600 32ビットカラー
ここまでできたらFC3を一通りアップデートする事。
・acpid
ScriptFileを設定するのみ。
各々以下の内容でファイルを配置する。
/etc/acpi/events/sample.confは/etc/acpi/events/.sample.confに名前を変えるか削除する。
起動時の設定を行なうよう、/etc/rc.d/rc.localへ諸設定を追加する。
/etc/acpi/actions/acpi.sh
!/bin/sh # Default acpi script that takes an entry for all actions set $* case "$1" in ac_adapter) cat /proc/acpi/ac_adapter/ADP1/state | grep on-line > /dev/null if [ "$?" = "0" ] ; then hdparm -S 120 /dev/hda > /dev/null echo "brightness:4" > /proc/acpi/toshiba/lcd /usr/sbin/longrun -s 0 100 /usr/sbin/longrun -f performance else hdparm -S 12 /dev/hda > /dev/null echo "brightness:0" > /proc/acpi/toshiba/lcd /usr/sbin/longrun -s 0 100 /usr/sbin/longrun -f economy fi ;; *) logger "ACPI group $1 is not defined" ;; esac
/etc/acpi/actions/button.sh
#!/bin/sh # a sample skeleton for handling ACPI events if [ $# != 1 ]; then exit 1 fi set $* case "$1" in button/power) /sbin/init 0 ;; *) logger "ACPI group $1 is not defined" ;; esac
/etc/acpi/events/acpi.conf
event=ac_adapter *.* action=/etc/acpi/actions/acpi.sh "%e"
/etc/acpi/events/button.conf
# This is a sample ACPID configuration event=button/power * action=/etc/acpi/actions/button.sh "%e"
/etc/rc.d/rc.local
# This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local cat /proc/acpi/ac_adapter/ADP1/state | grep on-line > /dev/null if [ "$?" = "0" ] ; then hdparm -S 120 /dev/hda > /dev/null echo "brightness:4" > /proc/acpi/toshiba/lcd /usr/sbin/longrun -s 0 100 /usr/sbin/longrun -f performance else hdparm -S 12 /dev/hda > /dev/null echo "brightness:0" > /proc/acpi/toshiba/lcd /usr/sbin/longrun -s 0 100 /usr/sbin/longrun -f economy fi
・ホットキー
LCDの明るさをFn+F6で明るく、Fn+F7で暗くできるようにする。
また、利用しないと思いますがFn+F8でファン回転オン/オフが可能。
インストールに必要なlibretto-hotkeysファイルをダウンロードする。
ファイル名称 ダウンロード元 libretto-hotkeys http://memebeam.org/free-software/toshiba_misc/libretto-hotkeys
ダウンロードしたlibretto-hotkeysファイルを/usr/local/bin/libretto-hotkeysに配置しファイルモードを755に設定する。
また起動/停止のために/etc/rc.d/init.d/hotkeysファイルを以下の内容で作成しファイルモード755に設定する。
/etc/rc.d/init.d/hotkeysの内容
#!/bin/sh # Tags for Red Hat init configuration tools # # chkconfig: 2345 99 0 # description: Start/Stop Toshiba Buttons Script. start () { echo "Starting toshiba buttons..." DISPLAY=:0 /usr/local/bin/libretto-hotkeys } stop () { echo "Stopping toshiba buttons..." for PNUM in `ps ax | grep "python /usr/local/bin/libretto-hotkeys" | grep -v "grep" | awk '{ print $1 }'` do kill $PNUM done } case "$1" in start) stop start ;; stop) stop ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0
以下のコマンドで/etc/rc.d/rc?.d下へ配置する。
# chkconfig --add hotkeys
・mount
ntfsをマウントする場合は以下のように行なう。
# mount -r -t ntfs デバイス mount先ディレクトリ
/etc/fstabへの記述の場合は以下のように記述する。
デバイス mount先ディレクトリ ntfs noauto,ro 0 0
/tmpディレクトリ下に色々とゴミファイルが作成されるためtmpfsに置き換えて利用する場合は以下のように記述する。
以下の例では、サイズ32Mbyteとしている。
設定後再起前に# init 1[Enter]後/tmpをきれいにする事を忘れないように。
この対応を行なった場合大事なファイルを/tmpに置かないよう気を付けて下さい。
none /tmp tmpfs mode=1777,size=64m 0 0
・カーネル再構築
カーネルを再構築し、Reboot可とする。
カーネルソースのSRPMをダウンロードし展開する。
パッケージ名称 ダウンロード元 kernel-2.6.9-1.681_FC3.src.rpm ftp://ftp.riken.go.jp/pub/Linux/fedora/core/updates/3/SRPMS/
# rpm -ivh kernel-2.6.9-1.681_FC3.src.rpm # cd /usr/src/redhat/SPECS # rpmbuild -bp --target=i686 kernel-2.6.spec # cd /usr/src/redhat/BUILD/kernel-2.6.9 # mv * /usr/src/linux-2.6.9-prep-FC3
Reboot可能とするために drivers/usb/host/ohci-hcd.cへ以下の修正を行なう。
/* Start an OHCI controller, set the BUS operational * enable interrupts * connect the virtual root hub */ static int hc_start (struct ohci_hcd *ohci) { #ifdef LIBRETTOL1 u32 mask, tmp; #else u32 mask; #endif struct usb_device *udev; struct usb_bus *bus; disable (ohci); /* Tell the controller where the control and bulk lists are * The lists are empty now. */ writel (0, &ohci->regs->ed_controlhead); writel (0, &ohci->regs->ed_bulkhead); /* a reset clears this */ writel ((u32) ohci->hcca_dma, &ohci->regs->hcca); periodic_reinit (ohci); /* some OHCI implementations are finicky about how they init. * bogus values here mean not even enumeration could work. */ if ((ohci_readl (&ohci->regs->fminterval) & 0x3fff0000) == 0 || !ohci_readl (&ohci->regs->periodicstart)) { ohci_err (ohci, "init err\n"); return -EOVERFLOW; } /* start controller operations */ ohci->hc_control &= OHCI_CTRL_RWC; ohci->hc_control |= OHCI_CONTROL_INIT | OHCI_USB_OPER; writel (ohci->hc_control, &ohci->regs->control); ohci->hcd.state = USB_STATE_RUNNING; /* wake on ConnectStatusChange, matching external hubs */ writel (RH_HS_DRWE, &ohci->regs->roothub.status); /* Choose the interrupts we care about now, others later on demand */ mask = OHCI_INTR_INIT; writel (mask, &ohci->regs->intrstatus); writel (mask, &ohci->regs->intrenable); #ifdef LIBRETTOL1 /* handle root hub init quirks ... */ tmp = roothub_a (ohci); tmp &= ~(RH_A_PSM | RH_A_OCPM); if (ohci->flags & OHCI_QUIRK_SUPERIO) { /* NSC 87560 and maybe others */ tmp |= RH_A_NOCP; tmp &= ~(RH_A_POTPGT | RH_A_NPS); } else if (power_switching) { /* act like most external hubs: use per-port power * switching and overcurrent reporting. */ tmp &= ~(RH_A_NPS | RH_A_NOCP); tmp |= RH_A_PSM | RH_A_OCPM; } else { /* hub power always on; required for AMD-756 and some * Mac platforms. ganged overcurrent reporting, if any. */ tmp |= RH_A_NPS; } writel (tmp, &ohci->regs->roothub.a); writel (RH_HS_LPSC, &ohci->regs->roothub.status); writel (power_switching ? RH_B_PPCM : 0, &ohci->regs->roothub.b); #endif // flush those pci writes
カーネル作成は以下の手順で行なう。
# cd /usr/src/linux-2.6.9-prep-FC3 # make menuconfig CPU等必用な変更を行なう # make # make modules_install # make install
・Kernel-2.6.10-rc3によるVGA最適化
FC3オリジナルカーネルではXの動作が非常に遅い。
kernel.orgの2.6.10-rc3にてSavage用Enable Console Accelerationがサポートされているので利用する。
この対応とPreemptible Kernelを設定する事で何とか使えるレベルになります。
インストールに必要なファイルをダウンロードする。
パッケージ名称 ダウンロード元 linux-2.6.10.tar.bz2 patch-2.6.10-rc3.bz2 http://www.kernel.org/
kernel作成手順を記述する。
ダウンロードしたファイルは/patchに配置。
kernelソース解凍 # cd /usr/src # tar jxvf /patch/linux-2.6.10.tar.bz2 # cd linux-2.6.10 # make mrproper # cp /boot/config-2.6.9-1.681.FC3 linux-2.6.10/.config # cd linux-2.6.10 # make oldconfig
Reboot可能とするために drivers/usb/host/ohci-hcd.cへ以下の修正を行なう。
FC3カーネルとUSBが異なっているため注意。
/* Choose the interrupts we care about now, others later on demand */ mask = OHCI_INTR_INIT; ohci_writel (ohci, mask, &ohci->regs->intrstatus); ohci_writel (ohci, mask, &ohci->regs->intrenable); #ifdef LIBRETTOL1 /* handle root hub init quirks ... */ temp = roothub_a (ohci); temp &= ~(RH_A_PSM | RH_A_OCPM); if (ohci->flags & OHCI_QUIRK_SUPERIO) { /* NSC 87560 and maybe others */ temp |= RH_A_NOCP; temp &= ~(RH_A_POTPGT | RH_A_NPS); } else if (power_switching) { /* act like most external hubs: use per-port power * switching and overcurrent reporting. */ temp &= ~(RH_A_NPS | RH_A_NOCP); temp |= RH_A_PSM | RH_A_OCPM; } else { /* hub power always on; required for AMD-756 and some * Mac platforms. ganged overcurrent reporting, if any. */ temp |= RH_A_NPS; } ohci_writel (ohci, temp, &ohci->regs->roothub.a); ohci_writel (ohci, RH_HS_LPSC, &ohci->regs->roothub.status); ohci_writel (ohci, power_switching ? RH_B_PPCM : 0, &ohci->regs->roothub.b); #endif // flush those writes (void) ohci_readl (ohci, &ohci->regs->control);
make menuconfigにより .configファイルの設定を変更する。
FrameBufferとLogoをONにすると起動時画面が乱れるので全てOFFとする。
/boot/grub/grub.confのVGA=オプションはカーネル作成後削除する事。
Device Drivers ---> Graphics support ---> [*] Support for frame buffer devices --- Enable Video Mode Handling Helpers [*] Enable Tile Blitting Support < > Cirrus Logic support < > Permedia2 support < > CyberPro 2000/2010/5000 support [ ] Chips 69000 display support [ ] IMS Twin Turbo display support < > VGA 16-color graphics support [ ] VESA VGA graphics support < > Hercules mono graphics support < > nVidia Riva support < > Intel 810/815 support (EXPERIMENTAL) < > Intel 830M/845G/852GM/855GM/865G support (EXPERIMENTAL) < > Matrox acceleration < > ATI Radeon display support (Old driver) < > ATI Radeon display support < > ATI Rage128 display support < > ATI Mach64 display support <*> S3 Savage support < > Enable DDC2 Support <*> Enable Console Acceleration < > SiS acceleration < > NeoMagic display support < > IMG Kyro support < > 3Dfx Banshee/Voodoo3 display support < > 3Dfx Voodoo Graphics (sst1) support < > Trident support < > Virtual Frame Buffer support (ONLY FOR TESTING!) Console display driver support ---> --- VGA text console [ ] Video mode selection support < > MDA text console (dual-headed) (EXPERIMENTAL) < > Framebuffer Console support Logo configuration ---> [ ] Bootup logo
カーネル作成は「カーネル再構築」同様の方法で行なう。
# cd /usr/src/linux-2.6.10 # make menuconfig 必用な変更を行なう # make # make modules_install # make install