在 MacBook Pro 上安装 OpenSolaris 2008.05
其实,我并不是第一个撰文介绍此配置的人。但是,除了撰写文档之外,我找不到其他更加有效的阐述方式。或许,大多数人使用 OpenSolaris 2008.05 预发行版时都遇到了这类问题。因此,本文将介绍我的成功方法。
硬件设备[*]苹果笔记本 MacBook Pro w,2.4 GHz Intel Core 2 Duo 处理器(型号 A1226),运行OS X 10.5.1操作系统。我相信这些步骤能适用于任何具有 Intel Core 2 Duo 处理器的苹果笔记本。 必需条件[*]OpenSolaris 2008.05一张空白的可写 CD(用来烧录 OpenSolaris 2008.05) OS X DVD 安装光盘 rEFIt - 类似于 Intel Mac 基于 EFI 的启动菜单 一个 USB 闪盘(用于存储网络驱动程序) [*]一个 USB 鼠标(Solaris 不支持 ctrl-单击) 事先声明我仍然没有让音频正常运行。
操作步骤步骤 1: 烧录 OpenSolaris 2008.05 Live CD 光盘OpenSolaris 以实时启动 CD 光盘的形式提供,它在装载完毕后会为你提供安装操作系统的选项。
下载 OpenSolaris 2008.05。 启动光盘工具。 [*]选择 os200805.iso 文件,单击工具栏中的 Burn 选项。
 步骤 2: 将以太网驱动程序存储在 USB 存储器中不幸的是,Live CD 中没有提供以太网适配器的驱动程序。将 yukonxsol_x64v8.19.2.3.tar.Z 保存到 USB 闪存中(如果您手头没有 USB 驱动程序,也可以将它烧录到 CD 光盘中)
步骤 3: 为 OpenSolaris 2008.05 创建一个分区首先,我尝试使用 “diskutil resizeVolume” 工具在现有 Mac OS 操作系统中创建一个分区,但由于磁盘空间不足而始终无法成功。现在,我的苹果笔记本已经使用了大概 9 个月,并且已升级到 Leopard,因此磁盘中应该含有相当多的碎片。幸运的是,我使用的是 Time Machine,所以我决定从头开始。
[*]插入 OS X DVD 安装盘。载入后,单击安装 Mac OS X(Install Mac OS X):
 [*]然后,单击重新启动(Restart)按钮启动安装程序:
 进入欢迎界面之后,从工具菜单中选择磁盘工具(Disk Utility )。 [*]磁盘工具启动后,选择苹果笔记本 MacBook 的硬件驱动。我的是 "149.1 GB FUJITSU MHW2160BHPL Media"。然后在右侧面板中,选择分区(Partition)选项卡。将卷模式(Volume Scheme)更改为 2 个分区。 选择无标题分区 1(Untitled Partition 1),并设置以下属性: 名称(Name): OPENSOLARIS 格式(Format): MS-DOS FAT [*]大小(Size): 55.00 GB 选择无标题分区 2,设置以下属性: 名称(Name): MacOS [*]格式(Format): Mac OS Extended (Journaled) [*]大小(Size): 所有空闲空间,我的是 94.05 GB [*]单击选项(Options)按钮,确认选择 GUID 分区表(GUID Partition Table)作为分区模式(由于 OpenSolaris 安装程序无法识别 GUID 分区表,因此我们稍后需要对它进行更改)。[*]当分区磁盘(Partition Disk )对话框出现后,单击应用(Apply)和分区(Partition )选项。这需要花费几秒钟的时间来创建新的分区映射。下面是我的磁盘重新分区后的情况:
 步骤 4: 安装 OS X[*]现在,您应该已经返回了安装程序的欢迎界面,单击继续(Continue)按钮继续 OS X 安装。在选择目标(Select a Destination)界面中,选择 MacOS 分区。 在安装概要(Install Summary )界面中,单击安装(Install)按钮。OS X 安装需要花费几个小时。 [*]安装完成后会出现一个欢迎界面,您需要在其中设置国家、键盘和从 Time Machine 备份还原的选项。从 Time Machine 还原需要花费几个小时,所以这个时候,我会跳过这个步骤(因为我可以在以后再做这个还原工作),只完成 vanilla 的安装(选择当前不要移动我的信息)。[*]键入您的 Apple ID 和注册信息等来完成安装过程。 步骤 5: 安装 rEFItrEFIt 是一个启动菜单,它允许您在系统启动之初选择 Mac OS 或者 OpenSolaris。
[*]使用 Mac 光盘映像下载 和安装 rEFIt。
 [*]为了确保 rEFIt 始终为启用状态,请打开终端并键入以下命令:
$ sudo /efi/refit/enable-always.sh
 [*]OpenSolaris 安装完成后,rEFIt 启动菜单将显示 OpenSolaris 的 Linux 插件。由于我们使用 Mac OS 操作系统,并且有权访问 EFI 分区,因此可以将 OpenSolaris 图标替换 Linux 图标:[*]将这些文件保存到 /efi/refit/icons 目录下。为便于记忆,您可以重新命名原始文件。 步骤 6: 更改 EFI 分区 ID如果您现在试图安装 OpenSolaris,则无法识别刚才创建的新分区,只能通过整个光盘安装。在这个步骤中,我们将 EFI 分区的 ID 从 'EE' 更改为 'AF'。
打开终端并运行 diskUtil 列表:
william-leonards-macbook-pro:~ brianleonard$ diskUtil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *149.1 Gi disk0
1: EFI 200.0 Mi disk0s1
2: Microsoft Basic Data OPENSOLARIS 55.0 Gi disk0s2
3: Apple_HFS MacOS 93.7 Gi disk0s3
内部硬盘驱动器应该显示为 /dev/disk0。您还将看到 OS X 安装 DVD 的磁盘和 Time Machine 驱动器。 接下来,我们将更改分区 1,即 EFI 分区。运行:
william-leonards-macbook-pro:~ brianleonard$ sudo fdisk -e /dev/disk0
Password:
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1>
[*]在 fdisk 提示符后,键入 p 打印分区表:
fdisk: 1> p
Disk: /dev/disk0 geometry: 19457/255/63 [312581808 sectors]
Offset: 0 Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639]
2: 0B 1023 254 63 - 1023 254 63 [ 409640 - 115344664] Win95 FAT-32
3: AF 1023 254 63 - 1023 254 63 [ 115754304 - 196565320] HFS+
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
fdisk: 1>
[indent]你会看到分区 1 属于的类型为 EE 。我们将它更改为 AF HFS+:[/indent]在提示符中键入: setpid 1
fdisk: 1> setpid 1
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639]
Partition id ('0' to disable) [0 - FF]: [EE] (? for help)
键入 AF:
Partition id ('0' to disable) [0 - FF]: [EE] (? for help) AF
fdisk:*1>
然后键入 write:
fdisk:*1> write
Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n]
[*]然后键入 y:
A reboot will be needed for changes to take effect. OK? [n] y
Writing MBR at offset 0.
fdisk: 1>
然后键入 quit:
fdisk: 1> quit
william-leonards-macbook-pro:~ brianleonard$
弹出 OS X DVD 安装盘,插入 OpenSolaris 2008.05 Live CD。 重启。 从 rEFIt 菜单中选择 “Boot Legacy OS from CD” 选项。 Live CD 启动后,选择键盘布局和桌面语言,并等待桌面载入。 关闭许可。 单击桌面上安装 OpenSolaris 的图标:
载入欢迎界面后,单击下一步(Next)按钮进入光盘界面:
在磁盘(Disk)界面中,你会注意到 OpenSolaris 已识别出最新创建的 Win95 FAT32 分区。
更改分区类型为 Solaris:
单击下一步(Next)按钮,选择时区、日期和时间。需要注意的是,你可以使用地图来选择所在地区。
选择地区:
建立用户:
检查安装概要无误后开始安装:
安装大概需要花费 30 分钟:
[*]完成后,选择重新启动(Reboot):
 步骤 8:启动 OpenSolaris 并安装有线以太网驱动程序:如果您安装了 OpenSolaris 图标,那么可以在 rEFIt 菜单中看到这些图标。 插上你的 USB 鼠标。 打开“系统(System)” > “管理(Administration)” > “设备驱动程序工具(Device Driver Utility)”。你会看到有线和无线网络驱动都不见了。选择 Marvel Technology Group Ethernet Controller,记下厂商 ID 和设备 ID。本例中分别为 11ab 和 436a:
将 USB 驱动器中的 yukonxsol_x64v8.19.2.3.tar.Z 文件复制到桌面。 打开“应用程序(Applications)” > “系统工具(System Tools)” > “终端(Terminal)”。 您应该位于主目录。键入 CD 进入 Desktop 目录。
bleonard@opensolaris:~$ cd Desktop
bleonard@opensolaris:~/Desktop$ 解压 zip 文件:
bleonard@opensolaris:~/Desktop$ gunzip yukonxsol_x64v8.19.2.3.tar.Z
bleonard@opensolaris:~/Desktop$ 解压 tar 文件:
bleonard@opensolaris:~/Desktop$ tar -xvf yukonxsol_x64v8.19.2.3.tar
YUKONXsolx/
YUKONXsolx/pkgmap
...
YUKONXsolx/install/yukonx.txt
yukonx.txt
yukonx.htm
bleonard@opensolaris:~/Desktop$ 安装程序包:
bleonard@opensolaris:~/Desktop$ pfexec pkgadd -d . YUKONXsolx
Processing package instance from
Marvell Yukon Ethernet Controller 64 bit driver(i386) 8.19.2.3
Marvell
----------------------
IP configuration
printf: ----------------------\n\n: unknown option
Usage: printf [ options ] format [string ...]
Do you want to configure the IP interfaces now (y/n)? 选择 Y,配置 IP 接口。
Do you want to configure the IP interfaces now (y/n)? y
Configuring Marvell Gigabit Ethernet interface 0
NOTE: If you want to configure the driver for the use of VLANs,
you should use the script /usr/sbin/yukonx_vlan_config.
You have to do this after driver installation is finished.
Please enter a hostname for the Marvell Gigabit Ethernet interface.
It should be different from all existing hostnames in
your system (see /etc/hostname.*).
Hostname [yukonx0]: 选择默认主机名 'yukonx0'。
Hostname [yukonx0]: 最后,DHCP 将设置 IP 地址,目前我输入的是 127.0.0.1。
Enter the IP address for 'yukonx0' []: 127.0.0.1
WARNING: The selected IP address has been found in
/etc/hosts:
127.0.0.1 opensolaris opensolaris.local localhost loghost
This can cause problems, but it
might be intentional in this case.
Enter the IP netmask for 'yukonx0' []: 输入 IP 子网掩码,我使用的是 255.255.255.0,并检查设置。
Enter the IP netmask for 'yukonx0' []: 255.255.255.0
Settings for Marvell Gigabit Ethernet interface 0:
hostname : yukonx0
IP-address : 127.0.0.1
IP-netmask : 255.255.255.0
IP-netnumber: 127.0.0.0
NOTE: If the netmask does not consist of '255's and '0's only,
the netnumber in /etc/netmasks will require manual correction
Are these settings OK (y/n)? 输入 Y 确认所设置的信息,或者输入 N 重新配置网络适配器。
Are these settings OK (y/n)? y
Do you have more Marvell Gigabit Ethernet adapters installed (y/n)? n
Using > as the package base directory.
## Processing package information.
## Processing system information.
10 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of [y,n,?] 输入 Y 继续程序包安装。
Do you want to continue with the installation of [y,n,?] y
Installing Marvell Yukon Ethernet Controller 64 bit driver as
## Executing preinstall script.
## Installing part 1 of 1.
/etc/rcS.d/S50yukonx
/kernel/drv/amd64/yukonx
/kernel/drv/yukonx.conf
/usr/sbin/yukonx_vlan_config
/usr/share/man/man7d/yukonx.7d
[ verifying class ]
[ verifying class ]
## Executing postinstall script.
/var/sadm/pkg/YUKONXsolx/install/postinstall[14]: /usr/ucb/echo: not found [No such file or directory]
devfsadm: driver failed to attach: yukonx
Warning: Driver (yukonx) successfully added to system but failed to attach
/var/sadm/pkg/YUKONXsolx/install/postinstall[113]: /usr/ucb/echo: not found [No such file or directory]
pkgadd: ERROR: postinstall script did not complete successfully
Installation of partially failed.
bleonard@opensolaris:~/Desktop$ 不用担心安装失败,我们将在稍后更新驱动程序。
bleonard@opensolaris:~/Desktop$ pfexec update_drv -a -i '"pci11ab,436a"' yukonx
bleonard@opensolaris:~/Desktop$ 然后,检测接口。
bleonard@opensolaris:~/Desktop$ pfexec ifconfig yukonx0 plumb
bleonard@opensolaris:~/Desktop$ 几秒钟后,你会看到接口出现:
测试连接:
bleonard@opensolaris:~/Desktop$ ping www.google.com
www.google.com is alive [*]确认设备驱动工具完好,至少 Marvell Card 可正常工作:
 步骤 9: 安装无线适配器驱动程序连接到因特网后,世界已尽在你的眼中。然而,我们还有一项任务没有完成,即安装无线适配器驱动程序。
选择设备驱动工具中的 Atheros Communications Wireless PCI Express Adapter。记录厂商 ID 和设备 ID。本例中分别是 168c 和 24 :
下载 SUNWatheros 0.7.2 程序包,并保存到桌面。 返回终端,解压程序包。 安装数据包:
bleonard@opensolaris:~/Desktop$ pfexec pkgadd -d SUNWatheros
The following packages are available:
1 SUNWatheros Atheros 802.11b/g Wireless NIC Driver
(i386) 11.11,REV=2007.12.18.15.35
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 按回车键选择默认设置 - all。
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:
Processing package instance from
Atheros 802.11b/g Wireless NIC Driver(i386) 11.11,REV=2007.12.18.15.35
# ident "@(#)LICENSE 1.1 05/11/28 SMI"
SOLARIS WIRELESS DRIVER FOR THE ATHEROS 52XX CHIPSET (ATH)
LICENSE AGREEMENT
...
Using > as the package base directory.
## Processing package information.
## Processing system information.
5 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
The following files are already installed on the system and are being
used by another package:
* /kernel/drv/amd64/ath
* /kernel/drv/ath
* /kernel/misc/amd64/net80211
* /kernel/misc/net80211
* - conflict with a file which does not belong to any package.
Do you want to install these conflicting files [y,n,?,q] 输入 Y 安装冲突文件,再次输入 Y 继续安装。
Do you want to install these conflicting files [y,n,?,q] y
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of [y,n,?] y
Installing Atheros 802.11b/g Wireless NIC Driver as
## Installing part 1 of 1.
/kernel/drv/amd64/ath
/kernel/drv/ath
/kernel/misc/amd64/net80211
/kernel/misc/net80211
[ verifying class ]
## Executing postinstall script.
Installation of was successful.
bleonard@opensolaris:~/Desktop$ 删除并重新安装驱动程序。
bleonard@opensolaris:~/Desktop$ pfexec rem_drv ath
bleonard@opensolaris:~/Desktop$ pfexec add_drv -i '"pci168c,24"' ath 检测接口。
bleonard@opensolaris:~/Desktop$ pfexec ifconfig ath0 plumb 配置 DHCP 接口:
bleonard@opensolaris:~/Desktop$ pfexec ifconfig ath0 dhcp 有线连接优先于无线连接。断开有线连接,测试无线连接。 扫描可用网络:
bleonard@opensolaris:~/Desktop$ wificonfig scan
essid bssid type encryption signallevel
CowPlanet 00:1e:52:7a:26:e5 access point none 15 连接可用网络:
bleonard@opensolaris:~/Desktop$ wificonfig connect 'CowPlanet'
wificonfig: connecting to essid 'CowPlanet'
bleonard@opensolaris:~/Desktop$
查看状态:
bleonard@opensolaris:~/Desktop$ wificonfig showstatus
linkstatus: connected
active profile: none
essid: CowPlanet
bssid: 00:1e:52:7a:26:e5
encryption: none
signal strength: strong(15) 测试:
bleonard@opensolaris:~/Desktop$ ping www.google.com
www.google.com is alive [*]确认设备驱动工具中的网络驱动问题已经解决:

参考资料本文中的所有知识点都可参阅以下文献:
|