LibrettoL1にFedora Core 2
LibrettoL1へFedora Core 2をインストールした時の手順をまとめたものです。
Installは、Windows98SE/WindowsXP/Linuxのマルチブートとするために、Windows98SE/WindowsXPインストール後に行う。
40GByteのHDD Partitionは以下のように設定。
・hda1:基本:Windows98SE :FAT32: 2GByte
(・hda2:論理:論理Partition: : 36GByte)
・hda5:論理: :FAT32: 16GByte
・hda6:論理:WindowsXP :NTFS : 5GByte
・hda7:論理:Linux :/boot: 24MByte
・hda8:論理:Linux :/ : 13GByte
・hda9:論理:Linux :swap :502Mbyte
|
・LibrettoL1へFedora Core 2インストール
インストールに必要なISOイメージをダウンロードしCDを作成する。
パッケージ名称 |
ダウンロード元 |
Fedora Core 2 ISO Image |
ftp://ftp.riken.go.jp/pub/Linux/fedora/core/2/i386/iso |
・CD boot Install
電源ON時Cキーを押しCDブート後以下の入力でインストーラーを起動する。
[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescure]
boot: linux acpi=on
|
インストールは以下の手順で行なった。
「Language Selection」で「Japanese(日本語)」を選択。
「キーボード設定」で「Japanese」を選択。
「モニターの設定」で「モニター未検出」となるがそのまま「次(N)」を選択し「続行(P)」を押す。
「アップグレードの検証」で、「インストール(I) Fedora Core」を選択。
「インストールの種類」で、「カスタム」を選択。
「ディスクパーティションの設定」で、「Disk Druidを使用して手動パーティション設定(D)」を選択。
「ディスクの設定」で、パーティションを作成する。
「ブートローダーの設定」はデフォルトで「次(N)」を押す。
「ファイヤーウォール設定」にて必用な設定を行い「次(N)」を押す。
「追加の言語サポート」にてJapaneseが選択されている事を確認し「次(N)」を押す。
「タイムゾーンの選択」はデフォルトで「次(N)」を押す。
「Rootパスワードを設定」にてパスワードを入力し「次(N)」を押す。
「パッケージグループの選択」にて必用なパッケージを選択し「次(N)」を押す。
「インストール準備完了」で「次(N)」を押す。
「再起動」を押す。
|
Install終了後(shutdown後)Rebootできないため電源ボタンを押し続けて電源を切る。
・longrun & GKrelLongRun
再起動すると驚く程遅い。
これは、longrun設定がeconomyモードになっているためです。
変更するには、longrunコマンドにより行いますが、標準のlongrunは動作しません。
そこで「Redhata8.0」を参照して、longrunを入れ換えます。
入れ換えを行なった後に、以下の入力で性能が出るようになります。
# modprobe cpuid
# modprobe msr
# longrun -f performance
|
GKrellmで利用するGKrelLongRunも同様です。
必用があれば「Redhata8.0」を参照し追加します。
・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 "モニター未検出"
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.5-1.358 ro root=LABEL=/ acpi=on vga=0x405 rhgb quiet
initrd /initrd-2.6.5-1.358.img
|
vgaオプションは、以下の通り。
vgaオプション |
モード |
0x404 |
1280x600 8ビットカラー |
0x405 |
1280x600 16ビットカラー |
0x407 |
1280x600 32ビットカラー |
・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 "pyton /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
fedoraでvfatをマウントする場合漢字やカナを表示するためにiocharset=utf8,codepage=932オプションが必用。
コマンドから起動する場合は以下のように行なう。
# mount -r -t vfat -o iocharset=utf8,codepage=932 デバイス mount先ディレクトリ
|
ntfsをマウントする場合は以下のように行なう。
# mount -r -t ntfs -o nls=utf8 デバイス mount先ディレクトリ
|
/etc/fstabへの記述の場合は以下のように記述する。
デバイス mount先ディレクトリ vfat noauto,ro,iocharset=utf8,codepage=932 0 0
デバイス mount先ディレクトリ ntfs noauto,ro,ntfs 0 0
|
/tmpディレクトリ下に色々とゴミファイルが作成されるためtmpfsに置き換えて利用する場合は以下のように記述する。
以下の例では、サイズ32Mbyteとしている。
設定後再起前に# init 1[Enter]後/tmpをきれいにする事を忘れないように。
この対応を行なった場合大事なファイルを/tmpに置かないよう気を付けて下さい。
none /tmp tmpfs mode=1777,size=32m 0 0
|
・日本語入力モード
FC1では日本語変換にkinput2が利用されていましたが、FC2ではIIIMFに変更されています。
kinput2のモード変更は、Shift+Spaceでしたが、IIIMFでは、Ctrl+Spaceとなっているため、Emacsで使い勝手が悪い。
そこで、IIIMFをkinput2に変更します。
IIIMFをkinput2に変更するには、以下のコマンドで可能です。
ただし、この設定はログインユーザー毎に行なう必用があります。
元に戻すためには、以下のコマンドで戻ります。
アップデートを行う事により日本語入力モードにならなくなった場合は、/etc/X11/xinit/xinitrc.d/xinput.shが在るか確認して下さい。
ファイルが無く、xinputが在る場合は、xinputをxinput.shと変更して下さい。
# cd /etc/X11/xinit/xinitrc.d
# mv xinput xinput.sh
|
・カーネル再構築
カーネルを再構築し、Reboot可/IEEE1394デバイス利用可とする。
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 NOLIBRETTOL1
u32 mask, tmp;
#else
u32 mask;
#endif
struct usb_device *udev;
struct usb_bus *bus;
spin_lock_init (&ohci->lock);
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);
/* force default fmInterval (we won't adjust it); init thresholds
* for last FS and LS packets, reserve 90% for periodic.
*/
writel ((((6 * (FI - 210)) / 7) << 16) | FI, &ohci->regs->fminterval);
writel (((9 * FI) / 10) & 0x3fff, &ohci->regs->periodicstart);
writel (LSTHRESH, &ohci->regs->lsthresh);
/* some OHCI implementations are finicky about how they init.
* bogus values here mean not even enumeration could work.
*/
if ((readl (&ohci->regs->fminterval) & 0x3fff0000) == 0
|| !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;
/* Choose the interrupts we care about now, others later on demand */
mask = OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_WDH;
writel (mask, &ohci->regs->intrstatus);
writel (mask, &ohci->regs->intrenable);
#ifdef NOLIBRETTOL1
/* 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
|
また、IEEE1394を利用可能とする場合は/etc/modprobe.confへ以下の1行を追加する。
追加せずにドライバのみ作成すると起動時にロックもしくはPanicします。
alias ieee1394-controller ohci1394
|
ieee1394は以下の設定を行う事でカーネル標準のドライバで動作する。
WinXP コントロールパネルの「東芝HWセットアップ」にある「デバイスの設定」を「全デバイス設定」へ
変更し「適用」or「OK」ボタンを押す。
電源投入時ESCを押しっぱなしにした後にF1キーを押すことでデフォルト設定に戻ります。
この設定を行えない場合は、drivers/ieee1394/ohci1394.cへ以下の修正を行なうこと。
static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
static int version_printed = 0;
struct hpsb_host *host;
struct ti_ohci *ohci; /* shortcut to currently handled device */
unsigned long ohci_base;
#ifndef ENABLE1394
u16 data;
#endif
if (version_printed++ == 0)
PRINT_G(KERN_INFO, "%s", version);
#ifndef ENABLE1394
pci_read_config_word(dev,PCI_CACHE_LINE_SIZE,&data);
#endif
if (pci_enable_device(dev))
FAIL(-ENXIO, "Failed to enable OHCI hardware");
#ifndef ENABLE1394
pci_write_config_word(dev,PCI_CACHE_LINE_SIZE,data);
pci_write_config_word(dev,PCI_INTERRUPT_LINE,dev->irq);
pci_write_config_dword(dev,PCI_BASE_ADDRESS_0,pci_resource_start(dev, 0));
pci_write_config_dword(dev,PCI_BASE_ADDRESS_1,pci_resource_start(dev, 1));
#endif
pci_set_master(dev);
|
|
カーネル作成は以下の手順で行なう。
# ln -s linux-2.6.5-1.358 linux
# cd /usr/src/linux
drivers/usb/host/ohci-hcd.cを修正する。
# make mrproper
# make menuconfig
# make bzImage
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.5-1.358custom
# make modules
# make modules_install
# cp System.map /boot/System.map-2.6.5-1.358custom
# mkinitrd -f /boot/initrd-2.6.5-1.358custom.img 2.6.5-1.358custom
|
/boot/grub/grub.confを修正しkernel-2.6.5-1.358customにて起動可能とする。
default=1
timeout=10
splashimage=(hd0,6)/grub/splash.xpm.gz
title Windows 98/XP
rootnoverify (hd0,0)
chainloader +1
title Fedora Core (2.6.5-1.358custom)
root (hd0,6)
kernel /vmlinuz-2.6.5-1.358custom ro root=LABEL=/ acpi=on vga=0x405 rhgb quiet
initrd /initrd-2.6.5-1.358custom.img
title Fedora Core (2.6.5-1.358)
root (hd0,6)
kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ acpi=on vga=0x405 rhgb quiet
initrd /initrd-2.6.5-1.358.img
|