Sony VAIO TypeCにFreeBSD 7.0をインストールするためのメモ
注意
このページの内容は古くなっています.記録のために残してありますが,更新されません.
もちろん,ここに記述されている内容は無保証である. トラブルが発生した際のために,VAIOのマニュアルに従いリカバリ・ディスクを作成しておくことを推奨する.
VAIO TypeC (VGN-C90HS)はオーナーメイド・モデルである. 私がインストールしたマシンのスペックは,以下の表の通りである. 以下の説明では,このPCをTypeCと呼ぶ.
| モデル名 | VGN-C90HS |
|---|---|
| CPU | Intel Celeron M 430 (1.73[GHz]) |
| チップセット | Intel 945GM Express |
| メモリ | 1.0[GB] |
| ビデオ・チップ | Intel Graphics Media Accelerator(GMA) 950 |
| LANチップ | 有線: Marvell Yukon 88E8036 無線: Intel PRO/Wireless 3945ABG |
| オーディオ機能 | Intel HDA準拠 |
| HDD | 80[GB] (FreeBSDで約20[GB]を使用) |
| 光学ドライブ | CD-RW/DVD-ROM一体型ドライブ |
| その他 | 英語キーボード |
ここでは,主にTypeCへのインストールの際に注意すべきことを記述する. FreeBSDのインストールの基本的な手順は『FreeBSDハンドブック』の「第2章 FreeBSDのインストール」,『FreeBSDビギナーズバイブル 改訂第2版』(後藤 大地. 毎日コミュニケーションズ, 2005),『改訂版 FreeBSD徹底入門』(衛藤・のだ・細川他. 翔泳社, 2002)などを,Unixの操作やシステム管理方法については『新The UNIX Super Text — 改訂増補版 (上・下)』(中村・新城・西山他. 山口・古瀬[監修]. 技術評論社, 2003),『Absolute BSD FreeBSDシステム管理とチューニング』(Lucas, M. 佐藤 広生[訳]. 毎日コミュニケーションズ, 2004)などを,それぞれ参照すること.
準備
マルチ・ブート・セレクタの入手
TypeCにインストールされているMicrosoft Windows Vista Home BasicとFreeBSDとのデュアル・ブートのために「LBシステムコマンダー9」(ライフボート, 2007)を使用する. このため,LBシステムコマンダー9を入手しておく.
起動用CDの作成
TypeCにはCD-RW/DVD-ROMドライブが付いている. CD-Rからブートしてインストールを行うため,日本にあるFreeBSD関連のサイトのFTPサービスに挙げられているFTPサーバより,“7.0-RELEASE-i386-disc1.iso"をダウンロードし,これをCD-Rに焼いて起動用のCDを作成する. もちろん,FreeBSD MallなどからCD-ROMを購入しても良い.
インストール
LBシステムコマンダー9のインストール
LBシステムコマンダー9に付属している「公式ガイドブック」に従い,LBシステムコマンダー9をインストールする.
注: 公式ガイドブックには,インストールによりWindowsの「スタート - 全てのプログラム」で表示されるメニューに「システムコマンダー9」が追加されると思われる記述があるが,今回のインストール作業ではメニューへの追加は行われなかった.
もし必要なら,自分でC:\SC\CONSOLE.EXEをメニューに追加する.
FreeBSDをインストールする領域の確保
LBシステムコマンダー9のOSウィザードでは,FreeBSDのインストールをすることはできなかった. このため,LBシステムコマンダー9のパーティションウィザートでのマニュアル操作により,Windowsパーティションを分割し,FreeBSDをインストールする領域を確保する. パーティションウィザードでのパーティションの分割のための手順は以下の通りである(詳しくは,LBシステムコマンダー9公式ガイドブックを参照すること).
- TypeCを再起動し,「OS選択メニュー」画面で「パーティション操作」をクリックする.
- 「パーティションウィザード」メニュー画面が表示されるので,「パーティションのマニュアル操作」を選択する.
- 「パーティション操作」画面で,分割するWindowsパーティションをクリックする.
注: 出荷時のままであれば,表示される2つのパーティションのうち,8[GB]程度の領域にはHDDリカバリ用のデータが入っている. - 「パーティション操作」画面で,「サイズ変更」ボタンをクリックする.
- 「パーティションのサイズ変更」画面で,この領域の新しい大きさを入力する.
今回は,FreeBSDのために約20[GB]の領域を確保するので,現在のこの領域の大きさから20[GB]引いた値とした.
FreeBSDのインストール
ブート
起動用CD-Rをドライブに入れ,TypeCを再起動する. “Kernel Configuration Menu"では,デフォルト(Skip kernel configuration and continue with installation)のままenterキーを押し,インストールを継続する.
FreeBSD用スライスの確保
FDISKパーティション・エディタで,先の領域確保においてFreeBSDのために確保した領域をFreeBSDのためのスライスとして設定する. 今回は,ad4s3をFreeBSDで使用することになる.
注: FreeBSDでは,LBシステムコマンダー9やWindowsでパーティションと呼ばれている領域はスライスと呼ばれる.そして,スライスをパーティションに分割する.
パーティションの設定
ディスクラベル・エディタで,FreeBSDのスライスにパーティションを作成する. 今回は,以下のように設定した.
| Mount point | Size |
|---|---|
| / | 512[MB] |
| swap | 2048[MB] |
| /var | 1024[MB] |
| /tmp | 512[MB] |
| /usr | 約16[GB](残り全て) |
配布ファイルの選択
必要に応じて,適切な配布ファイルを選択する.
インストール・メディアの選択
今回はCDからインストールするので,インストール・メディアの選択では"CD/DVD"を選択する.
その他
その他は,通常のFreeBSDインストール手順の通りで,特に注意することはない.
オーディオ・ドライバはカーネル・モジュールとしてインストールされる. オーディオ・ドライバを利用する場合には,/boot/loader.confにsnd_hda_load=“YES”を追加して,起動時にモジュールがロードされるようにしておく.
デュアル・ブートの設定
LBシステムコマンダー9のOS選択メニューへの追加
今回のインストール作業の手順では,インストールしたFreeBSDがLBシステムコマンダー9の「OS選択メニュー」画面に追加されなかった. このため,LBシステムコマンダー9に付属している「LBシステムコマンダー9 トラブル集(FAQ集)」のA10を参考に,手動でFreeBSDをメニューに追加する.
以上で,FreeBSDのインストール作業についての説明は終了である.
付録
カーネルとユーザ・ランドの再構築
FreeBSD 7.0-RELEASEでは,カーネルやユーザ・ランドを再構築せずに,TypeCのほとんどのデバイス(無線LANインターフェイスについては未確認)を使用することができる. このため,以下の作業は絶対に必要というものではない.
以下の説明では,カーネルとユーザ・ランドのソースを取得し,これらを再構築することで7.0-STABLEとする.
以下の作業は,全てrootで行う.
cvsupのインストール
CVSupを使ってカーネルとユーザ・ランドのソースを最新版に更新するため,日本にあるFreeBSD関連のサイトのFTPサービスに挙げられているFTPサーバより,cvsup-without-gui-16.1h_3.tgzをダウンロードし,pkg_add cvsup-without-gui-16.1h_3.tgzでインストールする.
cvsupの設定ファイルの設定
/usr/share/examples/cvsup/stable-supfileを/etc/ディレクトリに適当な名前でコピーし,これを変更してcvsupの設定ファイルとして使用する.
ここでは,設定ファイルの名前を/etc/supfile-stableとする.
以下に,cvsupの設定ファイルの記述例を挙げる.
ここで,hostで指定するホスト名はCVSupサーバの統計情報から空いているホストを選択して記述する.
*default host=cvsup4.jp.FreeBSD.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=RELENG_7
*default delete use-rel-suffix
src-all
カーネルとユーザ・ランドのソースの更新
cvsup -g /etc/supfile-stableにより,カーネルとユーザ・ランドのソースを更新する.
make.confの設定
/usr/share/examples/etc/make.confを参考にして,/etc/make.confを記述する. 以下に,/etc/make.confの記述例を挙げる. ここで,KERNCONFで指定している名前(ISABELLE)は,次に作成するカーネル・コンフィグレーション・ファイルの名前である.
CPUTYPE=i686
KERNCONF=ISABELLE
カーネル・コンフィグレーション・ファイルの設定
/usr/src/sys/i386/conf/GENERICを適当な名前でコピーし,これを変更してカーネル・コンフィグレーション・ファイルとして使用する. ここでは,カーネル・コンフィグレーション・ファイルの名前を/usr/src/sys/i386/conf/ISABELLEとする. 以下に,カーネル・コンフィグレーション・ファイルの記述例を挙げる(詳しくは,"FreeBSD Handbook“の”8.4 The Configuration File“を参照すること).
cpu I686_CPU
ident ISABELLE
options SCHED_4BSD # 4BSD scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Improve performance on big directories
#options UFS_GJOURNAL # Enable gjournal-based UFS journaling
options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_PART_GPT # GUID Partition Tables.
options GEOM_LABEL # Provides labelization
options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options COMPAT_FREEBSD6 # Compatible with FreeBSD6
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
options KTRACE # ktrace(1) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options ADAPTIVE_GIANT # Giant mutex is adaptive.
options STOP_NMI # Stop CPUS using NMI instead of IPI
options AUDIT # Security event auditing
# To make an SMP kernel, the next two lines are needed
#options SMP # Symmetric MultiProcessor Kernel
device apic # I/O APIC
# CPU frequency control
device cpufreq
# Bus support.
device pci
# ATA and ATAPI devices
device ata
device atadisk # ATA disk drives
device atapicd # ATAPI CDROM drives
device atapifd # ATAPI floppy drives
device atapicam
options ATA_STATIC_ID # Static device numbering
# SCSI peripherals
device scbus # SCSI bus (required for SCSI)
device da # Direct Access (disks)
device cd # CD
device pass # Passthrough device (direct SCSI access)
device ses # SCSI Environmental Services (and SAF-TE)
# atkbdc0 controls both the keyboard and the PS/2 mouse
device atkbdc # AT keyboard controller
device atkbd # AT keyboard
device psm # PS/2 mouse
device vga # VGA video card driver
device splash # Splash screen and screen saver support
# syscons is the default console driver, resembling an SCO console
device sc
device agp # support several AGP chipsets
device drm # DRM core module required by DRM drivers
device i915drm # Intel i830 through i915
# Add suspend/resume support for the i8254.
device pmtimer
# PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
device cbb # cardbus (yenta) bridge
device pccard # PC Card (16-bit) bus
device cardbus # CardBus (32-bit) bus
# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device miibus # MII bus support
device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
# Wireless NIC cards
device wlan # 802.11 support
device wlan_wep # 802.11 WEP support
device wlan_ccmp # 802.11 CCMP support
device wlan_tkip # 802.11 TKIP support
device wlan_amrr # AMRR transmit rate control algorithm
device wlan_scan_ap # 802.11 AP mode scanning
device wlan_scan_sta # 802.11 STA mode scanning
device ath # Atheros pci/cardbus NIC's
device ath_hal # Atheros HAL (Hardware Access Layer)
device ath_rate_sample # SampleRate tx rate control for ath
device wpi # Intel 3945ABG Wireless LAN controller
# Pseudo devices.
device loop # Network loopback
device random # Entropy device
device ether # Ethernet support
device tun # Packet tunnel.
device pty # Pseudo-ttys (telnet etc)
device gif # IPv6 and IPv4 tunneling
device faith # IPv6-to-IPv4 relaying (translation)
device firmware # firmware assist module
# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device bpf # Berkeley packet filter
# USB support
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices
device ugen # Generic
device uhid # "Human Interface Devices"
device ukbd # Keyboard
device ulpt # Printer
device umass # Disks/Mass storage - Requires scbus and da
device ums # Mouse
device uscanner # Scanners
# FireWire support
device firewire # FireWire bus code
device dcons # Dumb console driver
device dcons_crom # Configuration ROM for dcons
# I2C and SMBUS support
device ichsmb
device smbus
device iicbus
device iicsmb
device iicbb
device intpm
device smb
device iic
カーネルとユーザ・ランドのmakeとインストール
/usr/src/Makefileのコメントとして記述された説明にあるように,以下の手順でカーネルとユーザ・ランドのmakeとインストール,および/etc/ディレクトリの設定ファイルの更新を行う.
- cd /usr/src
- make buildworld
- make buildkernel
- make installkernel
- システムをrebootし,シングル・ユーザ・モードでログイン
- mergemaster -p
- make installworld
- make delete-old
- mergemaster
Xorgの設定
PortsのXorg 7.3に含まれるXサーバのintelドライバは,Intel GMA950(これは,チップセットである945GM Expressに内蔵されている)をサポートしている. このため,TypeCで問題無くXorgを使用できる. 以下に,Xorgの設定ファイルであるxorg.confの記述例を挙げる.
注: この設定例は,
- 英語キーボード・モデル
- Caps LockキーとCtrlキーを入れ換えている
- 3ボタン・マウスのエミュレートは
mousedで行っている - 後にportsでインストールしたフォントのディレクトリ設定も含んでいる
というものであることに注意すること.
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
RgbPath "/usr/local/lib/X11/rgb"
ModulePath "/usr/local/lib/xorg/modules"
FontPath "/usr/local/lib/X11/fonts/URW/"
FontPath "/usr/local/lib/X11/fonts/OTF/"
FontPath "/usr/local/lib/X11/fonts/Type1/"
FontPath "/usr/local/lib/X11/fonts/TrueType/"
FontPath "/usr/local/lib/X11/fonts/TTF/"
FontPath "/usr/local/lib/X11/fonts/terminus-font/"
FontPath "/usr/local/lib/X11/fonts/bitstream-vera/"
FontPath "/usr/local/lib/X11/fonts/misc/"
FontPath "/usr/local/lib/X11/fonts/75dpi/"
FontPath "/usr/local/lib/X11/fonts/100dpi/"
FontPath "/usr/local/lib/X11/fonts/cyrillic/"
EndSection
Section "Module"
Load "extmod"
Load "record"
Load "dbe"
Load "glx"
Load "GLcore"
Load "xtrap"
Load "dri"
Load "freetype"
Load "type1"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "ctrl:swapcaps"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Sony"
ModelName "VGN-C90HS LCD"
HorizSync 48.8 - 49.8
VertRefresh 59.5 - 60.5
Option "DPMS"
EndSection
Section "Device"
Identifier "Card0"
Driver "intel"
VendorName "Intel Corporation"
BoardName "Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
BusID "PCI:0:2:0"
Option "DRI" "True"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSectionSub "Display"
Depth 24
Modes "1280x800"
EndSubSection
EndSection
Section "DRI"
Mode 666
EndSection
無線LANインターフェイス
2008年3月9日現在,使用できるかどうかを確認していない.
解決できていない問題
ACPIまわり
サスペンド
sysctl hw.acpi.supported_sleep_stateしてみるとS3, S4, S5がサポートされているようだが,shutdown -p nowやacpiconf -s 5で電源を落とそうとしても,きちんと電源が落ちない.
このとき電源ランプは点灯しており,電源ボタンを押すとHDDのアクセス・ランプが点灯するが,システムが再起動したりするわけではない.
今のところ,こうなったら電源ボタンを長押して電源を落とすしかない.
現在はshutdown -h nowでシステムを停止し,電源ボタンを押して電源を切っている.
電源
ACアダプタの抜き差しは,検知することができる(e.g. ports/sysutils/wmbsdbattなどを使用する).
しかし,バッテリ残料は取得できない (acpiconf -i 0でバッテリの電圧が"unkown"と表示される).