OpenBSD的另类安装法
AZJTDMWSHD3GWYWP
昨天晚上回来, 看着备份恢复mbr命令突然想到我可以将系统移到新硬盘上, 想到就动手操作, 从开始备份操作到新硬盘上的系统成功启动, 整个过程花了差不到2个小时.
需要: 一台已安装配置好的OpenBSD系统, 一块没安装系统的空硬盘.
我是在OpenBSD3.6下操作的.在操作之前, 我先简单的介绍OpenBSD的系统启动过程.
在i386平台上, OpenBSD启动分两步, 系统开机进入启动时, 首先启动的是MBR, 然后再启动PBR ( partition boot record) , mbr说明系统从哪启动, pbr是载入/boot启动系统,
这两步都可以自己操作.具体的损坏后安装操作可以参考OpenBSD FAQ 14节的How does OpenBSD/i386 boot?这一段.
下面我介绍如何将一个已安装配置好的OpenBSD系统移到一个新硬盘上, 然后我们就可以使用新硬盘上的OpenBSD了.
1,备份MBR, 当然如果你不备份也可以使用/usr/mdec/mbr这个也行(这个我还没操作过, 只在看man pages时上面都有说明)
dd if=/dev/wd0a of=boot.bin bs=512 count=1
这一步总是提示硬盘忙, 所以我将这块硬盘挂到别的系统上备份mbr的:
dd if=/dev/wd1a of=boot.bin bs=512 count=1
2, 备份系统文件, 除了/tmp下的文件不备份外, /目录下的所有文件都备份.
我的系统分区为wd0a /, wd0b swap, wd0d /var, wd0e /tmp, wd0f /usr:
同备份mbr一样, 我将硬盘挂到别的系统上完成的:
mount /dev/wd1a /mnt
cd /mnt
tar zcf ~/back/root.tar.gz .
umount /mnt
mount /dev/wd1d /mnt
cd /mnt
tar zcf ~/back/var.tar.gz .
umount /mnt
mount /dev/wd1f /mnt
tar zcf ~/back/usr.tar.gz .
cd ~/back/
mv *.gz /mnt/
cd
mv boot.bin /mnt
halt -p
3,安装新硬盘.
1, 分区: fdisk –i wd1
2, disklabel –E wd1 (这里分的挂载点要和/etc/fstab的挂载点相同, 原来系统上分了几个挂载点, 现在这个硬盘就分几个挂载点).
4, 为新硬盘配置mbr:
dd if = boot.bin of=wd1
这里是FAQ上说的如何恢复mbr操作.我还没试过.
fdisk –u –f /usr/mdec/mbr wd0 (wd0改为wd1, 现在我们为wd1设置mbr)
5, 为新硬盘配置pbr:
操作步骤installboot (8);
fsck /dev/wd1a
mount /dev/wd1a /mnt
cp /usr/mdec/boot /mnt/boot
/usr/mdec/installboot –v /mnt/boot /usr/mdec/biosboot wd1
6, 将步骤2备份的系统文件解到新硬盘上.
先前步骤2的root.tar.gz, var.tar.gz, usr.tar.gz文件是放在/usr目录下,
将root.tar.gz解到 /dev/wd1a , var.tar.gz解到/dev/wd1d, usr.tar.gz解到/dev/wd1f.
好了, 现在可以将原来的系统关掉, 取下硬盘, 然后将从硬盘wd1改为挂主硬盘wd0, 开机启动新硬盘上的OpenBSD!基本上克隆主硬盘的OpenBSD系统到从硬盘上.现在发现主要是在启动gnome时报XKB错误,哪位兄弟能否详解一个XKB的各种信息;别的改变以的地方今晚回去再查查~~!
上面操作中有错误的地方请各位兄弟姐妹们指出!
OpenBSD的安装步骤,摘录于网络。
安装前的准备
一、 下载所需要的文件:floppy33.fs, 这可从一般的OpenBSD FTP站点上下载!
国内的OpenBSD很少, 我一个都没找到! 在安装时从国外的站点上下载文件很慢, 我上次晚上安装时到了那里就不管理它了, 到第二天早上才去继续安装!
下面说说启动盘的镜像文件:floppy33.fs, floppyB33.fs, floppyC33.fs
floppy33.fs 桌面PC版本, 它支持一般的PCI, ISA NICs, IDE, SCSI接口, 还有一些PCMCIA接口。
floppyB33.fs 服务器版本, 支持很多的RAID, 和一些SCSI。但一些基本的SCSI, ISA NICs, EISA都删除了!
floppyC33.fs 笔记本电脑版本, 支持Cardbus, PCMCIA.
我想, 一般都是桌面PC, 我自己的就是, 下载floppy33.fs.
下面是安装所需要的一些基本文件, 我把它下载下来放到内部网的FTP上了, 这样安装起来快一些:
bsd, bsd.rd, base33.tgz, etc33.tgz, comp33.tgz, man33.tgz, misc33.tgz, game33.tgz, xbase33.tgz,xfont33.tgz, xserv33.tgz, xshare33.tgz.
我还下载了ports.tar.gz, src.tar.gz, sys.tar.gz, 系统安装后这些ports tree, 内核源码都没安装, 要自己手动安装的。
二、制作启动盘
现在我们已下载了软盘镜像, 开始制作启动盘
1. Unix 下:
我是在slackware上制作的, 我在windows 下用rawrite2.exe没作成功!
# fdformat /dev/fd0
# dd if=floppy33.fs of=/dev/fd0 bs=32k
2. windows下(请参考OpenBSD主站上的安装指南)
主要工具都放在FTP站点上的TOOLS目录里, 主要有: rawrite, fdimage, ntrw, rawrite不能在windows NT, windows 2000 or XP下使用!
相关操作可自己找资料, 都很简单, 在DOS下操作!
现在我们要收集自己计算机上的信息:什么平台, 硬盘上的资料要不要备份?, 网卡信息(IP,subnet masks, gateway, DNS) 一些isa卡可以安装时以dmesg查看!
已下载了安装所需要的文件!现在我们进行的是FTP安装, 我将下载的文件放在FTP上, 目录是openbsd/OpenBSD下!这样安装快很多!
安装过程
用软盘启动系统!我们会看到蓝色背景的字!这里是OpenBSD的开机信息!然后我们会看到下面的这个:
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? I
选择I, 安装新系统, 如果是从原来的系统上升级则选择U, 或者你可以选择S, 在SHELL下操作, 其实当你在安装过程序中自己有某些设置错误Ctrl + c中止后, 也是回到这个SHEEL下操作的!在SHEEL下执行install就是安装系统。
Welcome to the OpenBSD/i386 3.3 install program.
This program will help you install OpenBSD in a simple and rational way. At
any prompt except password prompts you can run a shell command by typing
'!foo', or escape to a shell by typing '!'. Default answers are shown in []'s
and are selected by pressing RETURN. At any time you can exit this program by
pressing Control-C and then RETURN, but quitting during an install can leave
your system in an inconsistent state.
Specify terminal type: [vt220] Enter
Do you wish to select a keyboard encoding table? [n] y
选择键盘类型, 一些都是US。
IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this
program can cause SIGNIFICANT data loss.
It is often helpful to have the installation notes handy. For complex disk
configurations, relevant disk hardware manuals and a calculator are useful.
Proceed with install? [n] y
下面我们继续安装:
Cool! Let's get to it...
You will now initialize the disk(s) that OpenBSD will use. To enable all
available security features you should configure the disk(s) to allow the
creation of separate filesystems for /, /tmp, /var, /usr, and /home.
选择从哪个硬盘上安装, 我的系统只挂了一个小硬盘, 所以只一个!
Available disks are: wd0.
Which one is the root disk? (or done) [wd0] Enter
是否整个硬盘都安装OpenBSD, 是.
Do you want to use *all* of wd0 for OpenBSD? [no] yes
Treating sectors 63-6303024 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.
Initial label editor (enter '?' for help at any prompt)
> ?
现在我们来进行硬盘分区, 这里打入?寻求帮助!
Available commands:
p [unit] - print label.
M - show entire OpenBSD man page for disklabel.
e - edit drive parameters.
a [part] - add new partition.
b - set OpenBSD disk boundaries.
c [part] - change partition size.
d [part] - delete partition.
D - set label to default.
g [d|b] - Use [d]isk or [b]ios geometry.
m [part] - modify existing partition.
n [part] - set the mount point for a partition.
r - recalculate free space.
u - undo last change.
s [path] - save label to file.
w - write label to disk.
q - quit and save changes.
x - exit without saving changes.
X - toggle expert mode.
z - zero out partition table.
? [cmnd] - this message or command specific help.
Numeric parameters may use suffixes to indicate units:
'b' for bytes, 'c' for cylinders, 'k' for kilobytes, 'm' for megabytes,
'g' for gigabytes or no suffix for sectors (usually 512 bytes).
Non-sector units will be rounded to the nearest cylinder.
Entering '?' at most prompts will give you (simple) context sensitive help.
>
我分了五个区, a 根分区 200M, b 交换分区 300M , d 100M /tmp, e 100M /var , f 最后的全给 /usr,
使用 d删除分区,a 创建分区,p 查看分区情况,q 退出!
d a 删除a分区
a a 创建a分区
p g 查看分区, 大小以G显示
p m 查看分区, 大小以M显示
下面我们挂载分区:
The root filesystem will be mounted on wd0a.
wd0b will be used for swap space.
Mount point for wd0d (size=122976k), none or done? [/tmp] Enter
Mount point for wd0e (size=82152k), none or done? [/var] Enter
Mount point for wd0g (size=2097144k), none or done? [/usr] Enter
Mount point for wd0h (size=4194288k), none or done? [/home] Enter
Mount point for wd0d (size=122976k), none or done? [/tmp] done
Done - no available disks found.
You have configured the following partitions and mount points:
wd0a /
wd0d /tmp
wd0e /var
wd0g /usr
wd0h /home
格式化分区:
The next step creates a filesystem on each partition, ERASING existing data.
Are you really sure that you're ready to proceed? [n] y
/dev/rwd0a: 307440 sectors in 305 cylinders of 16 tracks, 63 sectors
200MB in 20 cyl groups (16 c/g, 7.88MB/g, 1920 i/g)
/dev/rwd0b: 245952 sectors in 244 cylinders of 16 tracks, 63 sectors
300MB in 16 cyl groups (16 c/g, 7.88MB/g, 1920 i/g)
/dev/rwd0d: 164304 sectors in 163 cylinders of 16 tracks, 63 sectors
100MB in 11 cyl groups (16 c/g, 7.88MB/g, 1920 i/g)
/dev/rwd0e: 4194288 sectors in 4161 cylinders of 16 tracks, 63 sectors
100MB in 261 cyl groups (16 c/g, 7.88MB/g, 1920 i/g)
/dev/rwd0f: 8388576 sectors in 8322 cylinders of 16 tracks, 63 sectors
2300MB in 521 cyl groups (16 c/g, 7.88MB/g, 1920 i/g)
/dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=Thu Oct 10 21:
50:36 2 002)
/dev/wd0h on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid,
ctime=Thu Oct 10 21:50:36 2002)
/dev/wd0d on /mnt/tmp type ffs (rw, asynchronous, local, nodev, nosuid,
ctime=Thu Oct 10 21:50:36 2002)
/dev/wd0g on /mnt/usr type ffs (rw, asynchronous, local, nodev, ctime=Th
u Oct 10 21:50:36 2002)
/dev/wd0e on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid,
ctime=Th u Oct 10 21:50:36 2002)
配置主机名
Enter system hostname (short form, e.g. 'foo'): OpenBSD
配置网络:
Configure the network? [y] Enter
Available interfaces are: ne3.
Which one do you wish to initialize? (or 'done') [ne3] Enter
Symbolic (host) name for fxp0? [puffy] Enter
The default media for fxp0 is
media: Ethernet autoselect (100baseTX full-duplex)
Do you want to change the default media? [n] Enter
IP address for fxp0? (or 'dhcp') 202.116.92.235
Netmask? [255.255.255.0] 255.255.254.0
Done - no available interfaces found.
DNS domain name? (e.g. 'bar.com') [my.domain] OpenBSD.localhost
DNS nameserver? (IP address or 'none') [none] 202.116.64.1
Use the nameserver now? [y] Enter
Default route? (IP address, 'dhcp' or 'none') 202.116.92.1
add net default: gateway 202.116.92.1
Edit hosts with ed? [n] Enter
Do you want to do any manual network configuration? [n] Enter
设置root密码, 不会显示出来的!
Password for root account? (will not echo)
Password for root account? (again)
现在我们选择安装方式, 我是FTP安装!硬盘安装就设置相应的东西就行了!
You will now specify the location and names of the install sets you want to
load. You will be able to repeat this step until all of your sets have been
successfully loaded. If you are not sure what sets to install, refer to the
installation notes for details on the contents of each.
Sets can be located on a (m)ounted filesystem; a (c)drom, (d)isk or (t)ape
device; or a (f)tp, (n)fs or (h)ttp server.
Where are the install sets? f
下面我们设置FTP服务器的地址! 是否要设置代理? FTP, HTTP安装都一样, 如果需要设置一下!
HTTP/FTP proxy URL? ( e.g. ‘http://proxy.8080’, or ‘none’ ) [ none ] Entry
查看FTP列表:
Do you want to see a list of potential ftp servers? [ y ] n
设置FTP的地址
Server IP address, or hostname ? 我的FTP地址
Does the server support passive mode ftp? [ y ]
设置放置安装文件的目录, 根据自己的设置写目录
Server directory? [ pub/OpenBSD/3.3/i386 ] openbsd/OpenBSD
是否匿名登陆, 不是, 则输入用户名, 密码!
Login? [ anonymous ] usernme
Password? [ will no echo ] password
下面是选择要安装的软件包:我试过, 如果你的FTP上有几个包它会显示几个包, 但有几个包是一定要的:bsd, base33.tgz, etc33.tgz, comp33.tgz, man33.tgz. 打入all将选择全部安装:
The following sets are available. Enter a filename, 'all' to select
all the sets, or 'done'. You may de-select a set by prepending a '-'
to its name.
[X] bsd
[ ] bsd.rd
[X] base33.tgz
[X] etc33.tgz
[X] misc33.tgz
[X] comp33.tgz
[X] man33.tgz
[X] game33.tgz
[ ] xbase33.tgz
[ ] xshare33.tgz
[ ] xfont33.tgz
[ ] xserv33.tgz
File Name? (or 'done') [bsd.rd] all
The following sets are available. Enter a filename, 'all' to select
all the sets, or 'done'. You may de-select a set by prepending a '-'
to its name.
[X] bsd
[X] bsd.rd
[X] base33.tgz
[X] etc33.tgz
[X] misc33.tgz
[X] comp33.tgz
[X] man33.tgz
[X] game33.tgz
[X] xbase33.tgz
[X] xshare33.tgz
[X] xfont33.tgz
[X] xserv33.tgz
File Name? (or 'done') [done] doen
选择好包后, 开始下载安装:
Ready to install sets? [y] Enter
Getting bsd ...
100% |**************************************************| 4472 KB 00:03
Getting bsd.rd ...
100% |**************************************************| 4190 KB 00:02
Getting base33.tgz ...
100% |**************************************************| 30255 KB 00:21
Getting etc33.tgz ...
100% |**************************************************| 1469 KB 00:01
Getting misc33.tgz ...
100% |**************************************************| 1828 KB 00:01
Getting comp33.tgz ...
100% |**************************************************| 16207 KB 00:13
Getting man33.tgz ...
100% |**************************************************| 5921 KB 00:04
Getting game33.tgz ...
100% |**************************************************| 2545 KB 00:01
Getting xbase33.tgz ...
100% |**************************************************| 9073 KB 00:06
Getting xshare33.tgz ...
100% |**************************************************| 1574 KB 00:02
Getting xfont33.tgz ...
100% |**************************************************| 30666 KB 00:21
Getting xserv33.tgz ...
100% |**************************************************| 14948 KB 00:11
Sets can be located on a (m)ounted filesystem; a (c)drom, (d)isk or (t)ape
device; or a (f)tp, (n)fs or (h)ttp server.
Where are the install sets? (or 'done')done
现在基本包安装完成!设置一下时区, 还有你以后要不要运行X:
Extract more sets? [n] Enter
Do you expect to run the X Window System? [y] y
Saving configuration files......done.
Generating initial host.random file ......done.
What timezone are you in? ('?' for list) [US/Pacific] ? 寻求帮助!
Africa/ Chile/ GB-Eire Israel NZ-CHAT Turkey
America/ Cuba GMT Jamaica Navajo UCT
Antarctica/ EET GMT+0 Japan PRC US/
Arctic/ EST GMT-0 Kwajalein PST8PDT UTC
Asia/ EST5EDT GMT0 Libya Pacific/ Universal
Atlantic/ Egypt Greenwich MET Poland W-SU
Australia/ Eire HST MST Portugal WET
Brazil/ Etc/ Hongkong MST7MDT ROC Zulu
CET Europe/ Iceland Mexico/ ROK posix/
CST6CDT Factory Indian/ Mideast/ Singapore posixrules
Canada/ GB Iran NZ SystemV/ right/
What timezone are you in? ('?' for list) [US/Pacific] Asia
然后输入:Shanghai,
Making all device nodes...done.
Installing boot block...
boot: /mnt/boot
proto: /usr/mdec/biosboot
device: /dev/rwd0c
/usr/mdec/biosboot: entry point 0
proto bootblock size 512
room for 12 filesystem blocks at 0x16f
Will load 7 blocks of size 8192 each.
Using disk geometry of 63 sectors and 240 heads.
0: 9 @(203 150 55) (3078864-3078872)
1: 63 @(203 151 1) (3078873-3078935)
2: 24 @(203 152 1) (3078936-3078959)
3: 16 @(203 8 47) (3069910-3069925)
/mnt/boot: 4 entries total
using MBR partition 1: type 166 (0xa6) offset 3069360 (0x2ed5b0)
...done.
CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter halt at the command prompt. Once the
system has halted, reset the machine and boot from the disk.
# reboot
现在重启, 系统已安装完成!
安装后配置
我们安装了基本的系统,但只有最基本的东西, 像内核源代码, ports tree都没安装!
在安装时我们安装了X, 现在我们配置X-windows, 运行xf86cfg设置!OpenBSD的默认桌面是fvwm。
现在我们给系统添加新用户adduser, 在第一次使用时会有一些基本的设置, 如密码使用什么加密, 有好几种, 我选择了最常用的md5。
首先, 我们开始安装内核源代码, 为以后编译内核作准备!
如果你有CD,则只需要从CD中取出src.tar.gz,cd /usr/src 然后tar xvzf src.tar.gz, 上篇, 我们是从FTP安装的, 因此, 我们要下载两个包:src.tar.gz, sys.tar.gz.
ftp://ftp.ca.openbsd.org/pub/OpenBS...i386/src.tar.gz ftp://ftp.ca.openbsd.org/pub/OpenBS...i386/sys.tar.gz 安装ports tree, 下载ports.tar.gz, 然后copy /usr/ , tar xzvf ports.tar.gz .
ftp://ftp.ca.openbsd.org/pub/OpenBS...86/ports.tar.gz 安装cvsup,
下载cvsup-16.1f.tar.gz, 如果没安装X则下载 cvsup-16.1f-no_X.tar.gz
#ftp://ftp.ca.openbsd.org/pub/OpenBS...p-16.1f..tar.gz
#pkg_add cvsup-16.1f.tar.gz
编辑cvsup-supfile, OpenBSD里的编辑器是mg, 类似于emacs。
#Defaults that apply to all the collections
*default release=cvs
*default delete use-rel-suffix
*default umask=002
*default host=cvsup.uk.openbsd.org
*default base=/cvsup
*default prefix=/cvsup
#If your network link is T1 or faster, comment out the following line.
*default compress
OpenBSD-all
#OpenBSD-src
#OpenBSD-www
#OpenBSD-ports
#OpenBSD-x11
#OpenBSD-xf4
保存,
# mg cvsup-supfile
# cd /
# mkdir cvsup
# cd
# cvusp –g –L 2 cvsup-supfile
就可升级ports tree等了!
安装软件同FreeBSD下一样, 以后再说说编译内核吧!
主要cvsup站点:
cvsup.uk.openbsd.org]
cvsup.de.openbsd.org
cvsup2.de.openbsd.org
cvsup.hu.openbsd.org
cvsup.fr.openbsd.org
cvsup.ca.openbsd.org
cvsup.usa.openbsd.org
cvsup.kr.openbsd.org
cvsup.no.openbsd.org
cvsup.pt.openbsd.org
anoncvs.de.openbsd.org
rt.fm
skeleton.phys.spbu.ru
cvsup.jp.OpenBSD.org
mirror.osn.de
openbsd.informatik.uni-erlangen.de
OpenBSD-src - The src repository
OpenBSD-ports - The ports repository
OpenBSD-www - The www repository
OpenBSD-x11 - The XFree86-3 repository
OpenBSD-xf4 - The XFree86-4 repository
OpenBSD-all - All OpenBSD repositories
网络配置
因为与FreeBSD等配置有点出入, 所以我在这里指出来!
我自己是使用局域网, 所以只介绍这个方面的, 如果有人使用的是PPP方式, 可自行查看官方站点上的FAQ。
可能很多使用OpenBSD的人是从FreeBSD下转过来的, 但OpenBSD的网络设置与FreeBSD有所不同, 它的网络配置没有写进rc.conf, 而是作为单独的文件存放的。
网卡IP存放在/etc/hostname.网卡型号名, 网关存放在/etc/mygate
主机名存放在/etc/myname, 名字服务器地址没变, 存放在/etc/resolv.conf
我们使用ifconfig –a 查看网卡型号:(这个是我已配置好的)
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33224
inet 127.0.0.1 netmask 0xff000000
lo1: flags=8008<LOOPBACK,MULTICAST> mtu 33224
ne0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
address: 00:e0:4c:e0:45:0c
media: Ethernet autoselect (10baseT)
inet ***.***.***.*** netmask 0xfffffe00 broadcast ***.***.***.***
pflog0: flags=0<> mtu 33224
pfsync0: flags=0<> mtu 2020
我的网卡是ne0, 但不知怎么的, 系统安装好后, 在/etc/中建立的文件却是hostname.ne3, 我只好自己手动改成 hostname.ne0,
关于这个hostname.*文件的格式:
inet 192.168.0.1 netmask 255.255.255.0 NONE
inet 指定ip地址, netmask指定网络掩码。
当然你也可以指定详细的网卡说明:
inet 10.0.0.38 255.255.255.0 NONE media 100baseTX mediaopt full-duplex
现在指定网关, 修改/etc/mygate, 写入网关IP就行了。
主机名, 写入/etc/myname.
/etc/resolv.conf, 与别的系统一样的, 这个就不用说了!
OpenBSD安装后全程操作-中文使用环境篇
--------------------------------------------------------------------------------
OpenBSD安装后全程操作 – 中文环境篇
系统环境:openbsd 3.5
依下面操作后,openbsd中能使用中文,创作sgml文档,能使用apache, mysql, php.娱乐方面是使用xmms听歌,看电影,但只能观看mpeg格式的影片.以后我会保持对此文档的维护.
一, 编译新内核, 依据dmesg的信息对/usr/src/sys/arch/i386/conf/GENERIC文件进行注释, 做完这一个后, 再修改/usr/src/sys/conf/GENERIC文件, 需要注意一定要打开这个选项:
options COMPAT_LINUX
编译安装内核后, 再修改/etc/sysctl.conf文件, 将kern.emul.linux一行前的#去掉. 重启.
二, 安装程序
以下是我安装的程序列表:
ORBit-0.5.13
aalib-1.2
atk-1.4.1
aumix-2.8
bash-2.05b
bzip-0.21
bzip2-1.0.2
cdparanoia-3.a9.8
cvsup-16.1g-no_x11
docbook-4.2p1
docbook-dsssl-1.72
docbook-guide-2.0.8
esound-0.2.28
fvwm2-2.4.16
gawk-3.1.3
gettext-0.10.40p1
ghostscript-7.05p2
ghostscript-fonts-6.0 35
gimp-1.2.5
gkrellm-2.1.27
glib-1.2.10
glib2-2.2.3
gnuls-4.1
gtk+-1.2.10p1
gtk+2-2.2.4
imlib-1.9.14p2
iso8879-1986
ispell-3.2.06
jadetex-3.11
jpeg-6b
libao-0.8.4
libaudiofile-0.2.5
libiconv-1.9.1
libid3tag-0.15.1b
libmad-0.15.1b
libungif-4.1.0b1
libxml-2.6.5
libxml1-1.8.17
linuxdoc-1.1
mozilla-firefox-0.8
mpeg_lib-1.3.1
mpg321-0.2.10
mysql-client-4.0.18
mysql-server-4.0.18
openjade-1.3
openmotif-2.1.30.5
p5-DBD-mysql-2.90.03
p5-DBI-1.38
p5-Net-Daemon-0.38
p5-PlRPC-0.2017
pango-1.2.5
php4-core-4.3.8
php4-mysql-4.3.8
png-1.2.5p2
popt-1.7
python-2.1.3p2
python-2.3.3
recode-3.6p1
redhat_base-8.0p4
sdl-1.2.6p0-sun
sgmlformat-1.7
smpeg-0.4.4
t1lib-5.0.0
teTeX_base-2.0.2
teTeX_texmf-2.0.2p0
texi2html-1.64
tiff-3.6.1
unzip-5.50p2
wget-1.8.2
xdaliclock-2.18
xmms-1.2.7
xmms-esd-1.2.7
xmms-mp3-1.2.7
xmms-smpeg-0.3.5
xpdf-3.00
xv-3.10a
zh-fonts-taipei-1.01
zh-rxvt-big5-2.7.8p0
zope-2.6.1
zope-cmf-1.3.3
zope-zwiki-0.27.1
zopebook-2.6
这些程序我都是下载tgz包安装的.我将这些程序放在我的另一台机上, 这样可以在每次重装openbsd3.5后,可以快速的建立使用环境.你可以不安装php, mysql, zope这几个程序, 因为我是建立一个桌面环境外带一个apache + php + mysql, 而且还想学学zope.
安装mysql:
# pkg_add mysql-server-4.0.18.tgz
安装后操作:
查看/etc/rc.conf文件最后是否有这一行:
local_rcconf=”/etc/rc.conf.local”
没有自己加上, 创建文件rc.conf.local, 内容为:
mysql=YES
修改/etc/rc.local, 加入:
if [ X”${mysql}” == X”YES” –a –x /usr/local/bin/mysqld_safe ]; then
echo –n “mysqld”; /usr/local/share/mysql/mysql.server start
fi
执行命令:
# chmod 755 /usr/local/share/mysql/mysql.server
重启系统.
# /usr/local/bin/mysqladmin –u root password setpassword
以后使用mysql:
# /usr/local/bin/mysql –u root –p
OpenBSD自带apache, 只需要在/etc/rc.conf中修改一下就可以使用apache了:
httpd_flags=””
也可以手工启动:
/usr/sbin/apachectl start | restart | stop
Apache的配置文件是/var/www/conf/httpd.conf,网页根目录是/var/www/htdocs.
安装php:
# pkg_add php4-core-4.3.8.tgz
# /usr/local/sbin/phpxs –s
# cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini
# pkg_add php4-mysql-4.3.8.tgz
# /usr/local/sbin/phpxs –a mysql
修改/var/www/conf/httpd.conf, 让apache支持php文件.重启apache.
三. 环境变量设置
需要在.cshrc中加入如下几行:
set TERM=xterm
set SGML_CATALOG_FILES=/usr/local/share/sgml/catalog
set XML_CATALOG_FILES=/usr/local/share/xml/catalog
setenv LC_CTYPE zh_CN.GB2312
setenv XMODIFIERS "@im=fcitx"
alias jj openjade -E 0 -t sgml -V nochunks –d /usr/local/share/sgml/docbook/dsssl/modular/html/docbook.dsl
alias mm mount_msdos /dev/wd1i /mnt
另外还在 set path行未加入 /usr/local/emul/redhat/usr/bin 保存.
解压我保存的fvwm配置文件:
tar xvfz fvwm.tar.gz
or
unzip fvwm.zip
另外修建.xinitrc文件, 文件内容:
fcitx &
exec /usr/X11R6/bin/fvwm -f ~/.fvwm/.fvwm2rc
下面是关于 .fvwm2rc文件说明:
# be sure to customize these paths for your installation:
ModulePath /usr/X11R6/lib/X11/fvwm模块的路径名
PixmapPath /usr/X11R6/include/X11/pixmapsfvwm使用图片的路径, 桌面背景图片就是放在这里, 我使用的桌面背景图片是:openbsddesktop.xpm
IconPath /usr/X11R6/include/X11/bitmaps
EdgeResistance 250 100
EdgeScroll 50 50当mouse移到桌面边缘时, 桌面的移动情况
ClickTime 750
# make sure these fonts exist on your system:
WindowFont -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-*窗口使用的字体
IconFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
HilightColor blue #898e84 窗口的高亮显示时的颜色
MenuStyle #b0d5fc gray40 #49c671 -adobe-times-bold-r-*-*-12-*-*-*-*-*-*-* fvwm菜单使用的前景色, 背景色,阴影色, 字体类型
DeskTopSize 3x3 每一个虚拟桌面的大小
ColormapFocus FollowsMouse
# default Styles:
Style "*" BorderWidth 5, HandleWidth 5, NoHandles 在这里我加了一个NoHandles, 也就是窗口不要柄
Style "*" Icon unknown1.xpm, Color green/#698593 定义窗口颜色
Style "*" MWMFunctions, MWMDecor, HintOverride
Style "*" DecorateTransient, NoPPosition
Style "*" IconBox -0 -1 +1 -1
Style "*" SloppyFocus, FocusFollowsMouse
Style "*" RandomPlacement, SmartPlacement
# Styles for various Fvwm modules:
Style "Fvwm*" NoTitle, Sticky, WindowListSkip
Style "Fvwm*" BorderWidth 2, CirculateSkipIcon, CirculateSkip
Style "FvwmPager" StaysOnTop
Style "FvwmBanner" StaysOnTop
Style "FvwmButtons" Icon toolbox.xpm, ClickToFocus
Style "FvwmButtons" BorderWidth 1, NoHandles
# Styles for your common terminal emulator programs:
AddToDecor terms
+ ButtonStyle 1 Pixmap mini.xterm.xpm
+ HilightColor blue #898e84
Style "XTerm" UseDecor terms
Style "XTerm" Icon xterm.xpm, SloppyFocus, IconBox -70 1 -1 -140
Style "rxvt" UseDecor terms
Style "rxvt" Icon term.xpm, SloppyFocus, IconBox -70 1 -1 -140
Style "rxvt" MWMBorder, MWMButtons
# Styles for various common programs:
Style "xcalc" Icon xcalc.xpm, NoButton 2,RandomPlacement,ClickToFocus
Style "xmh" Icon mail1.xpm, NoIconTitle,StickyIcon
Style "xmh" RandomPlacement, NoButton 2
Style "xman" Icon xman.xpm, RandomPlacement, ClickToFocus
Style "xmag" Icon mag_glass.xpm, RandomPlacement, ClickToFocus
Style "xgraph" Icon graphs.xpm, RandomPlacement, ClickToFocus
Style "xmosaic" Color Green/Yellow, ClickToFocus
Style "xdaliclock" NoTitle, NoHandles, Sticky, WindowListSkip, ClickToFocus你看到, 我的桌面上有一个电子钟, 在这里定义它的显示类型, 这样我就可以在每一个虚拟桌面上都看到它了。
在这里定义的是应用程序图标化后在桌面的显示, 图标文件要用绝对路径.
Style "firefox" Icon /root/.fvwm/48/firefox48.xpm
Style "emacs" Icon /root/.fvwm/48/emacs.xpm
Style "gimp" Icon /root/.fvwm/48/gimp.xpm
Style "xpdf" Icon /root/.fvwm/48/xpdf.xpm
Style "xv" Icon /root/.fvwm/xv.xpm
Style "xmms" Icon /root/.fvwm/48/xmms.xpm
# some simple default key bindings:
Key Next A SCM Next[*] Focus
Key Prior A SCM Prev[*] Focus
# some simple default mouse bindings:
# for the root window:
Mouse 1 R A Menu RootMenu Nop
Mouse 2 R A Menu Window-Ops Nop
Mouse 3 R A WindowList
窗口title上的各按键的定义说明
# for the title bar buttons:
Mouse 0 1 A Menu Window-Ops2 Close
Mouse 0 2 A Close
Mouse 0 4 A Maximize-Func
Mouse 1 6 A Iconify
# for other parts of the window/borders/icons:
Mouse 1 F A Resize-or-Raise
Mouse 1 TS A Move-or-Raise
Mouse 1 I A Move-or-Iconify
Mouse 2 I A Iconify
Mouse 2 FST A Menu Window-Ops2 Nop
Mouse 3 TSIF A RaiseLower
fvwm启动时的初始函数,配置文件中使用的模块要在这里启动
######################## Initialization Functions ############################
AddToFunc InitFunction "I" Module FvwmPager 0 3 虚拟桌面的启动情况
+ "I" Module FvwmButtons
+ "I" Module FvwmAuto 500 Raise Nop
+ "I" Exec exec /usr/X11R6/bin/xpmroot /usr/X11R6/lib/X11/xdm/pixmaps/openbsd.xpm设置桌面背景图片
fvwm重启时的操作
AddToFunc RestartFunction "I" Module FvwmPager 0 3
+ "I" Module FvwmButtons
+ "I" Module FvwmAuto 500 Raise Nop
+ "I" Exec exec /usr/X11R6/bin/xpmroot /usr/X11R6/lib/X11/xdm/pixmaps/openbsd.xpm
下面是菜单的配置情况, 当你安装了新的软件时, 可以在这里将它们加到菜单中去。
######################## Menus ###################
AddToMenu RootMenu "Root Menu%root.xpm%" Title
+ "XTerm%xconsole.xpm%" Exec exec xterm
#+ "" Nop
+ "Rxvt%rxvt.xpm%" Exec exec rxvt
#+ "" Nop
+ "Mozilla-Firefox%firefox.xpm%" Exec exec firefox
#+ "" Nop
+ "Gimp%gimp.xpm%" Exec exec gimp
#+ "" Nop
+ "XMMS%emacs.xpm%" Exec exec xmms
+ "Xpdf%pdf.xpm%" Exec exec xpdf
+ "Xv%xv-2.xpm%" Exec exec xv
+ "" Nop
#+ "Remote Logins" Popup Remote-Logins
#+ "" Nop
+ "Utilities%pkg.xpm%" Popup Utilities
+ "" Nop
+ "Fvwm Modules%module.xpm%" Popup Module-Popup
+ "Fvwm Window Ops%setting.xpm%" Popup Window-Ops
+ "Fvwm Simple Config Ops%config.xpm%" Popup Misc-Ops
+ "" Nop
+ "Refresh Screen%mypic2.xpm%" Refresh
+ "Recapture Screen%mypic1.xpm%" Recapture
+ "(Re)Start%restart.xpm%" Popup Quit-Verify
+ "" Nop
+ "Exit%exit-2.xpm%" Module FvwmForm QuitVerify
AddToMenu Misc-Ops "Misc Config Opts" Title
+ "Sloppy Focus" ChangeDefaultFocus SloppyFocus
+ "Click To Focus" ChangeDefaultFocus ClickToFocus
+ "Focus Follows Mouse" ChangeDefaultFocus FocusFollowsMouse
+ "" Nop
+ "Colormap Follows Mouse" ColormapFocus FollowsMouse
+ "Colormap Follows Focus" ColormapFocus FollowsFocus
+ "" Nop
+ "Full Paging ON" EdgeScroll 100 100
+ "All Paging OFF" EdgeScroll 0 0
+ "Horizontal Paging Only" EdgeScroll 100 0
+ "Vertical Paging Only" EdgeScroll 0 100
+ "Partial Paging" EdgeScroll 50 50
+ "Full Paging && Edge Wrap" EdgeScroll 100000 100000
AddToMenu Window-Ops "Window Ops" Title
+ "Move%mini.move.xpm%" Move
+ "Resize%mini.resize.xpm%" Resize
+ "Raise%mini.raise.xpm%" Raise
+ "Lower%mini.lower.xpm%" Lower
+ "(De)Iconify%mini.iconify.xpm%" Iconify
+ "(Un)Stick%mini.stick2.xpm%" Stick
+ "(Un)Maximize%mini.maximize.xpm%" Maximize
+ "" Nop
+ "Delete%mini.excl.xpm%" Delete
+ "Close%mini.cut.xpm%" Close
+ "Destroy%mini.destroy.xpm%" Destroy
+ "" Nop
+ "Refresh Window%mini.refresh.xpm%" RefreshWindow
AddToMenu Window-Ops2 "&Move%mini.move.xpm%" Move
+ "&Resize%mini.resize.xpm%" Resize
+ "R&aise%mini.raise.xpm%" Raise
+ "&Lower%mini.lower.xpm%" Lower
+ "(De)&Iconify%mini.iconify.xpm%" Iconify
+ "(Un)&Stick%mini.stick2.xpm%" Stick
+ "(Un)Ma&ximize%mini.maximize.xpm%" Maximize
+ "" Nop
+ "&Delete%mini.excl.xpm%" Delete
+ "&Close%mini.cut.xpm%" Close
+ "Destroy%mini.destroy.xpm%" Destroy
+ "" Nop
+ "ScrollBar" Module FvwmScroll 2 2
+ "Print" PrintFunction
#+ "Print Reverse" PrintReverseFunction
AddToMenu Module-Popup "FvwmModules" Title
+ "Identify" Module FvwmIdent
+ "Talk" Module FvwmTalk
+ "" Nop
+ "Button-Bar" Module FvwmButtons
+ "Pager" Module FvwmPager 0 0
+ "Pager (2 desks)" Module FvwmPager 0 1
+ "WinList" Module FvwmWinList
+ "" Nop
+ "Banner" Module FvwmBanner
+ "ScrollBar" Module FvwmScroll 50 50
+ "Background" Module FvwmBacker
+ "AutoRaise" Module FvwmAuto 200 Raise Nop
+ "Stop AutoRaise" KillModule FvwmAuto
+ "" Nop
+ "IconBox" Module FvwmIconBox
+ "IconMan" Module FvwmIconMan
+ "Form - QuitVerify" Module FvwmForm QuitVerify
AddToMenu Quit-Verify
+ "Restart Fvwm%mini.refresh.xpm%" Restart fvwm
+ "No, Don't Quit" Nop
######################## Sample Functions ##########################
AddToFunc MailFunction "I" Next [$0] Iconify -1
+ "I" Next [$0] Focus
+ "I" None [$0] Exec $0 $1
AddToFunc Move-or-Raise "I" Raise
+ "M" Move
+ "D" Lower
AddToFunc Move-or-Raise2 "M" Raise
+ "M" Move
+ "D" Lower
这里我修改了最大化窗口时的情况:
AddToFunc Maximize-Func "M" Maximize 0 100
+ "C" Maximize 80 80(桌面的80%)
+ "D" Maximize 95 95 (桌面的95%)
AddToFunc Move-or-Iconify "I" Raise
+ "M" Move
+ "D" Iconify
AddToFunc Resize-or-Raise "I" Raise
+ "M" Resize
+ "D" Lower
AddToFunc Resize-or-Raise2 "M" Raise
+ "M" Resize
+ "D" Lower
AddToFunc PrintFunction "I" Raise
+ "I" Exec xdpr -id $w
AddToFunc PrintReverseFunction "I" Raise
+ "I" Exec xdpr 1/2 -h -rv -id $w
AddToFunc Iconify-and-Raise "I" Iconify
+ "I" Raise
# RLOGIN machine fg bg
AddToFunc RLOGIN "I" Exec xterm -fg $1 -bg $2 -e rlogin $0 -8
# TELNET machine fg bg
AddToFunc TELNET "I" Exec xterm -fg $1 -bg $2 -e telnet $0
AddToFunc FocusAndWarp "I" Focus
+ "I" WarpToWindow 2p 2p
AddToFunc DeiconifyFocusAndWarp "I" Iconify -1
+ "I" FocusAndWarp
AddToFunc ChangeDefaultFocus "I" Style "*" $0
+ "I" Recapture
############################################################################
# Now some keyboard shortcuts.
# Arrow Keys
# press arrow + control anywhere, and scroll by 1 page
Key Left A C Scroll -100 0
Key Right A C Scroll +100 +0
Key Up A C Scroll +0 -100
Key Down A C Scroll +0 +100
# press arrow + meta key, and scroll by 1/10 of a page
Key Left A M Scroll -10 +0
Key Right A M Scroll +10 +0
Key Up A M Scroll +0 -10
Key Down A M Scroll +0 +10
# press shift arrow + control anywhere, and move the pointer by 1% of a page
Key Left A SC CursorMove -1 0
Key Right A SC CursorMove +1 +0
Key Up A SC CursorMove +0 -1
Key Down A SC CursorMove +0 +1
# press shift arrow + meta key, and move the pointer by 1/10 of a page
Key Left A SM CursorMove -10 +0
Key Right A SM CursorMove +10 +0
Key Up A SM CursorMove +0 -10
Key Down A SM CursorMove +0 +10
# Keyboard accelerators
Key F1 A M Menu RootMenu
Key F2 A M Menu Window-Ops
Key F3 A M WindowList FvwmWinList
Key F4 A M Iconify
Key F5 A M Move
Key F6 A M Resize
Key F7 A M CirculateUp
Key F8 A M CirculateDown
#Page Up/Dapge Down keys are used to scroll by one desktop page
# in any context, press page up/down + control
# in root context, just pressing page up/down is OK
#
# I prefer the non-wrapping scroll. These are for example purposes only
#Key Next A C Scroll 100000 0
#Key Next R N Scroll 100000 0
#Key Prior A C Scroll -100000 0
#Key Prior R N Scroll -100000 0
################## FvwmButtons button-bar ################################
*FvwmButtonsBack #5c54c0
*FvwmButtonsGeometry 120x30+400-2定义电子钟的大小和出现的位置
*FvwmButtons(Swallow(Respawn, NoHints) xdaliclock `Exec exec xdaliclock -bg gray40 -fg yellow -fn 12x24`) bg背景色, fg前景色, fn字体大小
上面的buttons配置是我的桌面上的电子钟的配置情况
########################## Window-Identifier ###############################
# Just choose colors and a fonts
*FvwmIdentBack MidnightBlue
*FvwmIdentFore Yellow
*FvwmIdentFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
########################### Pager #########################################
*FvwmPagerRows 1 虚拟桌面排列行数
*FvwmPagerColumns 4 虚拟桌面排列列数
*FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*使用的字体
*FvwmPagerBack #5c54c0虚拟桌面的背景色
*FvwmPagerFore white虚拟桌面的前景色
*FvwmPagerHilight #6b64b0当前使用桌面的颜色
#*FvwmPagerGeometry 100x100-1-1
*FvwmPagerGeometry +0-0桌面面板的出现位置
*FvwmPagerLabel 0 "OpenBSD 3.5"每一个虚拟桌面的名称, 当名称中有空格时用双引号括起来
*FvwmPagerLabel 1 Maker
*FvwmPagerLabel 2 Mail
*FvwmPagerLabel 3 Study
*FvwmPagerSmallFont 5x8
*FvwmPagerBalloons All
*FvwmPagerBalloonBack yellow
*FvwmPagerBalloonFore black
*FvwmPagerBalloonFont -adobe-times-bold-r-*-*-10-*-*-*-*-*-*-*
*FvwmPagerBalloonYOffset +2
*FvwmPagerBalloonBorderWidth 1
*FvwmPagerBalloonBorderColor black
# FvwmForm alias - query exit ala mwm
*QuitVerifyGrabServer
*QuitVerifyWarpPointer
*QuitVerifyFont *helvetica*m*r*n*18*
#*QuitVerifyButtonFont *helvetica*m*o*n*18*
*QuitVerifyButtonFont 7x13bold
*QuitVerifyFore Black
*QuitVerifyBack Light Gray
*QuitVerifyItemFore Gold
*QuitVerifyItemBack Gray40
# begin items
*QuitVerifyLine center
*QuitVerifyText "Do you really want to exit FVWM?"
*QuitVerifyLine expand
*QuitVerifyButton quit " Exit "
*QuitVerifyCommand Quit
*QuitVerifyButton quit "Cancel"
*QuitVerifyCommand Nop
四, 中文环境:
安装ttf字体, 我将这个字体保存在truetype.tar.gz,
# mv truetype.tar.gz /usr/X11R6/lib/X11/fonts/
# tar xvzf truetype.tar.gz
修改/etc/X11/XF86Config:
Load "xtt"
FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"
FontPath "/usr/local/lib/X11/fonts/chinese/"
下面的操作为:
# /usr/local/emul/redhat/sbin/ldconfig
从redhat 系统中复制出fcitx程序安装的各种文件, 列表如下:
/usr/bin/fcitx
/usr/bin/fcitx.xft
/usr/share/fcitx/fcitx
/usr/share/fcitx/fonts/fonts.dir
/usr/share/fcitx/fonts/gbkst16.pcf.gz
/usr/share/fcitx/punc.mb
/usr/share/fcitx/pySym.mb
/usr/share/fcitx/pyphrase.mb
/usr/share/fcitx/sp.dat
/usr/share/fcitx/wbx.mb
将 /usr/bin下的两个文件复制到 /usr/local/emul/redhat/usr/bin 目录下;将 /usr/share/的整个fcitx目录复制到 /usr/local/emul/redhat/usr/share/ 目录下.
修改/usr/local/emul/redhat/usr/bin/fcitx文件, 即修改fcitx的路径, 改为如下:
#!/bin/sh
xset +fp /usr/local/emul/redhat/usr/share/fcitx/fonts
/usr/local/emul/redhat/usr/share/fcitx/fcitx "$@"&
Linuxeden有奖征集网站图标和网站口号
__________________
★ *""*☆*""* ★
FreeBSD & OpenBSD 爱好者
★ *""*☆*""* ★
FreeBSD版 OpenBSD 系列.....
--------------------------------------------------------------------------------
此帖于 2004-10-14 15:00 被 rianren 编辑.
rianren
查看公开信息
发送悄悄话给rianren
查找rianren发表的更多帖子
添加 rianren 到好友列表
2004-10-13, 10:35 #2
rianren
荣誉版主
注册日期: 2002年9月
来自: 广州
我的BLOG 我的职场简历
帖子: 1,504
精华: 17
现金: 124 Eden积分
资产: 13521 Eden积分
安装emacs
从redhat 8.0系统中复制出emacs安装的各种文件:
/usr/bin/emacs
/usr/bin/emacs-21.2
/usr/bin/emacsclient
/usr/libexec/emacs 整个目录
/usr/share/emacs 整个目录
将/usr/bin下的文件复制到 /usr/local/emul/redhat/usr/bin 目录下, 将/usr/libexec/emacs整个目录复制到 /usr/local/emul/redhat/usr/libexec目录下, 将 /usr/share/emacs整个目录复制到 /usr/local/emul/redhat/usr/share/目录下.另外有一些man, info文件也可以复制到相应的目录下, 这些可有可无, 我没有进行复制.
从redhat 8.0中复制出如下文件:
/usr/X11R6/lib/libXaw3d.so.6.0
/usr/X11R6/lib/libXaw3d.so.7.0
/usr/lib/libtiff.so.3.5
/usr/lib/libungif.so.4.1.0
将libXaw3d.so.6.0和libXaw3d.so.7.0复制到/usr/local/emul/redhat/usr/X11R6/lib目录中, 并做两个软连接:
ln –s libXaw3d.so.6.0 libXaw3d.so.6
ln –s libXaw3d.so.7.0 libXaw3d.so.7
将libtiff.so.3.5和libungif.so.4.1.0复制到/usr/local/emul/redhat/usr/lib目录中, 并做三个软连接:
ln –s libtiff.so.3.5 libtiff.so.3
ln –s libungif.so.4.1.0 libgif.so.4.1.0
ln –s libungif.so.4.1.0 libungif.so.4
操作完成后, 执行如下命令:
# cd /usr/local/emul/redhat/usr/bin
# ./emacs
所有操作完成.
本贴涉汲到两个程序包:
fvwm.zip fvwm配置文件
redhat.zip fcitx, emacs等程序的文件
打包放在
ftp://ftp.cnfug.org/incoming/ 如对本贴有不理解的地方, 可先参考我以前写的一些贴子再发贴?*瞿愕奈侍?
作者:东方英明(中国BSD联盟)
我的网站上有原版
http://www.chinabsd.org/bsd/openbsd/openbsd-x/index.asp 《OpenBSD安装指南》介绍了如何安装应用于服务器的文字界面的OpenBSD系统,但是这并不能算是一个完整的OpenBSD系统,完整的OpenBSD系统还应该包括图形界面,那就是X-Windows。OpenBSD默认的X-Windows是FVWM。要安装X-Windows就必须在安装过程中选择有关X的软件包,当然你也可以直接输入all,采用完全安装。(见图021)
图021
安装的其他过程不变,请参阅《OpenBSD安装指南》。安装完OpenBSD后,输入reboot,重新启动计算机,登陆OpenBSD后,一个全新的OpenBSD就呈现在使用者的面前。接下来我们就开始X-Windows的配置。在OpenBSD中配置X-Windows有两种方法:即xf86cfg和xf86config。xf86cfg是图形化交互配置工具,而xf86config则是比较繁琐的文字配置工具,我们就以xf86cfg为例配置X-Windows。在#提示符下输入xf86cfg,便进入了xf86cfg的图形化交互配置界面。(见图022)
图022
首先我们来配置鼠标,在鼠标的图案上单击右键,在弹出的菜单中选择config,则出现鼠标的配置画面。(见图023)
图023
我们无须做太多改动,只需注意一定要选中“Emulate 3 buttons(模拟三键鼠标)”,因为在X-Windows中需要使用到鼠标的第三键(鼠标中间那个,但是我们使用的都是双键鼠标,只有模拟三键鼠标,同时按下左右两个键就能模拟第三键的效果)。配置完成后,单击Quit退出。接下来是键盘的配置,无须改动默认即可。(见图024)
图024
接下来是显卡的配置,根据你机器上安装的显卡型号,选择正确的即可。(见图025)
图025
接下来是显示器的配置,建议查一下显示器的说明书,看一下水平同步和垂直同步,然后选择正确的数值,切记!不然超过显示器带宽而烧毁显示器,后果自负!(见图026)
图026
xf86cfg配置完成后,点击Quit,退出并保存配置。XF86Config的配置文件被保存在/usr/X11R6/lib/X11/XF86Config中,XKB的配置文件被保存在lib/X11/xkb/X0-config.keyboard中。然后回到系统提示符下,输入startx,启动X-Windows环境。这是一个非常无趣而又毫无用处的X会话。(见图027)
图027
FVWM默认是包含9个用户桌面。活动窗口的界面为蓝色,非活动窗口的界面为红色。图027中包含了一些X-Windows最基本的元素,当然我们最常用的就是xterm终端。在桌面空白处单击鼠标左键,弹出快捷菜单。(见图028)
图028
而我们所要关心的是Utilities子菜单。(见图029)
图029
Utilities子菜单中包含了一些常用的工具包括Top、Calculator、Xman、Xmag、Editres。
Top用来监视系统进程。(见图030)
图030
Calculator是一个科学计算器。(见图031)
图031
Xman是一个X-Windows系统指导浏览工具。(见图032)
图032
点击Manual Page按扭,出现Manual Page窗口。(见图033)
图033
点击Scetions按扭,在弹出菜单中选择你要查询的命令的类型,比如这里我们选择User Commands,在选择xf86cfg。(见图034)
图034
这时有关于xf86cfg的帮助便呈现在我们面前。(见图035)
图035
Xmag是背景图案编辑器,又是一个极无聊的东西。(见图036)
图036
Editres(见图037)
图037
OpenBSD的X-Windows还有很多功能在此不做一一介绍,有兴趣的用户可以自己去探索和发现。
全文完。