|
本文假设FreeBSD采取 全部安装 方式,具有 gnome 2.6-Lite 和 KDE 3.3。
本文假设读者具有使用一般Unix系统和vi编辑器的经验。
本文仅供参考,作者对参照此文修改造成的任何伤害 不 付任何责任。
请备份好重要数据,开始
第一部分:准备
1、如果硬盘空间允许,建议 采取 全部安装 方式 安装FreeBSD 5.3 release,
修改/etc/make.conf
加上如下一些内容:
#-------------------------------------------------------------#
# 优化参数,编译不通过请注释掉
CPUTYPE =p3#我的CPU是Pentium III
CFLAGS =-O2 -pipe -fomit-frame-pointer
CXXFLAGS+ =-fmemoize-lookups -fsave-memoized
# 下面这些是升级源代码,ports以及doc用的
SUP_UPDATE =yes
SUP=/usr/local/bin/cvsup
SUPFLAGS=-g -L 2
SUPHOST=你的主机名.你的域名# 例如 holy.gnu.org
#SUPFILE=/usr/share/examples/cvsup/standard-supfile
PORTSSUPFILE=/root/.ports-supfile # 需要执行下面更新ports
#DOCSUPFILE=/usr/share/examples/cvsup/doc-supfile
# 用 ports 安装软件时首先从比较近的 镜象服务器 下载源码包
MASTER_SITE_BACKUP=\
ftp://ftp.freebsd.org.org.cn/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\
ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/{DIST_SUBDIR}/
MASTER_SITE_OVERRIDE=${MASTER_SITE_BACKUP}
#-------------------------------------------------------------#
更新ports [劝告:如果对库、系统不太了解或对稳定性要求高,建议
不要更新库!建议在汉化完成后再做]
#cp /usr/share/examples/cvsup/ports-supfile /root/.ports-supfile
#cd /root
#vi .ports-supfile
改 *default host=CHANGE_THIS.FreeBSD.org
为:*default host=cvsup1.FreeBSD.org
#cvsup ports-supfile
复制Windows/Linux/Unix字形至 /usr/X11R6/lib/X11/fonts/[目录名] 下,
其中的 目录名 可以随便起,但最好在 /usr/X11R6/lib/X11/fonts/ 下,
例如我新建一个目录 founder 存放方正字体,将方正字体拷贝到此目录
下,再如新建一个目录 FontsFromTurboLinux 存放从Turbo Linux复制
来的字体。
复制完自己的字形后,安装系统字形:
#cd /usr/ports/chinese/
#cd ./arnettf
#make install clean
#cd ../arphicttf
#make install clean
#cd ../kcfonts
#make install clean
完成后执行 "fccache -f -v"
第二部分:一些配置文件和环境变量的设置。
1、按照下面的样例配置配置自己目录下的.cshrc,如果没有新建一个
注:C shell是FreeBSD系统中超级用户(root)的默认shell
#----------------------开 始----------------------------
# $FreeBSD: src/etc/root/dot.cshrc,v 1.29 2004/04/01 19:28:00 krion Exp $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
#
set dspmbyte=euc
setenv LC_ALL zh_CN.GBK
setenv LANG zh_CN.GBK
setenv LC_CTYPE zh_CN.GBK
setenv G_BROKEN_FILENAMES 1 # 使gnome 2.x 使用GBK而不是UTF-8编码
setenv XMODIFIERS @im=fcitx
#使用xcin25 作为输入法
#setenv XMODIFIERS @im=xcin
setenv XIM fcitx
setenv XIM_PROGRAM fcitx
alias h history 25
alias j jobs -l
alias ls ls -wG
setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx
alias la ls -a
alias lf ls -FA
alias ll ls -lA
alias cp cp -i
alias rm rm -i
alias mv mv -i
#alias vi VI #这一行需要在下面写过VI脚本后才能去掉注释
# A righteous umask
umask 22
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin)
setenv EDITOR vi
setenv PAGER more
setenv BLOCKSIZE K
if ($?prompt) then
# An interactive shell -- set some stuff up
set prompt = "`/bin/hostname -s`# "
set filec
set history = 100
set savehist = 100
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
endif
endif
#----------------------结 束----------------------------
# 注:作者亦是newbie,难免舛误,请仔细检查,切勿照抄
2、按照下面的样例配置自己的~/.shrc和~.profile
注:sh(bourne shell)是FreeBSD系统中的普通用户的默认shell,它的配置文件
有两个:~/.profile 和 ~/.shrc ,但是不知为什么,我的sh总是不能输入汉字,但是
显示可以的,我的输入法是fcitx 3.0.3,如果有谁在 FreeBSD 5.3-release中成功
在sh中输入汉字,把经验写出来,好吗?谢谢!
如果使用bash,你可以直接看下面的bash配置,但也有毛病
#----------------------------- ~/.shrc
# $FreeBSD: src/share/skel/dot.shrc,v 1.3 2002/07/23 12:28:16 jmallett Exp $
#
# .shrc - bourne shell startup file
#
# This file will be used if the shell is invoked for interactive use and
# the environment variable ENV is set to this file.
#
# see also sh(1), environ(7).
#
# Central Nation Language OUTPUT
stty cs8 -istrip -parenb
stty pass8
set dspmbyte=euc
LANG=zh_CN.GBK
LC_ALL=zh_CN.GBK
LC_CTYPE=zh_CN.GBK
export LANG LC_ALL LC_CTYPE
XMODIFIERS='@im=fcitx'
XIM=fcitx
XIM_PROGRAM=fcitx
GTK_IM_MODULE="fcitx"
export XMODIFIERS XIM XIM_PROGRAM GTK_IM_MODULE
set convert-meta off
set meta-flag on
set output-meta on
# file permissions: rwxr-xr-x
#
# umask 022
# Enable the builtin emacs(1) command line editor in sh(1),
# e.g. C-a -> beginning-of-line.
set -o emacs
# Uncomment this and comment the above to enable the builtin vi(1) command
# line editor in sh(1), e.g. ESC to go into visual mode.
# set -o vi
# some useful aliases
alias h='fc -l'
alias j=jobs
alias m=$PAGER
alias ls='ls -wG'
export LSCOLORS=ExGxFxdxCxDxDxBxBxExEx
alias ll='ls -laFo'
alias l='ls -l'
alias g='egrep -i'
#alias vi='export LC_ALL=en_US.ISO8859-1; vi'
# # be paranoid
alias cp='cp -ip'
alias mv='mv -i'
alias rm='rm -i'
# # set prompt: ``username@hostname$ ''
# PS1="`whoami`@`hostname | sed 's/\..*//'`"
# case `id -u` in
# 0) PS1="${PS1}# ";;
# *) PS1="${PS1}$ ";;
# esac
# search path for cd(1)
# CDPATH=.HOME
#------------------------------------ ~/.profile
# $FreeBSD: src/share/skel/dot.profile,v 1.21 2002/07/07 00:00:54 mp Exp $
#
# .profile - Bourne Shell startup script for login shells
#
# see also sh(1), environ(7).
#
# Central Nation Language Support
LANG=zh_CN.GBK; export LANG
LC_ALL=zh_CN.GBK; export LC_ALL
LC_CTYPE=zh_CN.GBK; export LC_CTYPE
set dspmbyte=euc
# Central Nation Charactor Input
XMODIFIERS='@im=fcitx'; export XMODIFIERS
XIM=fcitx; export XIM
XIM_PROGRAM=fcitx; export XIM_PROGRAM
GTK_IM_MODULE="fcitx"; export GTK_IM_MODULE
#PROFILE_TEST="workswell"; export PROFILE_TEST
# for bash / bourne user
stty pass8
stty cs8 -istrip -parenb
set convert-meta off
set meta-flag on
set input-meta on
set output-meta on
# remove /usr/games and /usr/X11R6/bin if you want
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/binHOME/bin; export PATH
# Setting TERM is normally done through /etc/ttys. Do only override
# if you're sure that you'll never log in via telnet or xterm or a
# serial line.
# Use cons25l1 for iso-* fonts
# TERM=cons25; export TERM
BLOCKSIZE=K; export BLOCKSIZE
EDITOR=vi; export EDITOR
PAGER=more; export PAGER
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips
到此为止,在csh中输入和查看汉字是没有任何问题的(还需要安装输入服务器),
sh中仅仅可以看,所以我换成了bash,但输入字符是没有问题的,但是在命令行
上删除字符还有些问题。
3、配置bash
#---------------------------------------- ~/.bashrc
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile
# 使用 8-bit 字符
stty cs8 -istrip
stty pass8
# 设置 locale
export LC_ALL=zh_CN.GBK
export LC_CTYPE=zh_CN.GBK
export LANG=zh_CN.GBK
export G_BROKEN_FILENAMES=1
# 设置 汉字输入服务器
export XMODIFIERS='@im=fcitx'
export XIM=fcitx
export XIM_PROGRAM=fcitx
export GTK_XIM_MODULE="fcitx"
# 使用 8-bit 字符输入输出
set convert-meta off
set meta-flag on
set input-meta on
set output-meta on
# 使用彩色显示及其它 ls 选项
alias ls='ls -wG'
export LSCOLORS=ExGxFxdxCxDxDxBxBxExEx
alias ll='ls -laFo'
alias l='ls -l'
# 使用 VI 脚本代替 vi
alias vi='VI'
# 其它的一些设置
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias g='egrep -i'
alias h='fc -l'
alias j=jobs
alias m=$PAGER
# are we an interactive shell?
if [ "$PS1" ]; then
if [ -x /usr/bin/tput ]; then
if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
stty erase `tput kbs`
elif [ -x /usr/bin/wc ]; then
if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
stty erase `tput kbs`
fi
fi
fi
case $TERM in
xterm*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -x $i ]; then
. $i
fi
done
fi
fi
#-------------------------------------- ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATHHOME/bin
BASH_ENV=$HOME/.bashrc
export BASH_ENV PATH
unset USERNAME
4、配置~/.gtkrc.zh_CN和~/.gtkrc.mine
有些程序例如gvim、xmms需要这些设置。
我的~/.gtkrc.zh_CN
# $(gtkconfigdir)/gtkrc.zh_CN
#
# This file defines the fontsets for Chinese language (zh) using
# the simplified chinese standard GuoBiao as in mainland China (CN)
#
style "gtk-default-zh-cn" {
fontset = "-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,\
,-misc-simsun-medium-r-normal--16-116-100-100-c-160-gbk-0,*-r-*"
}
class "GtkWidget" style "gtk-default-zh-cn"
我的~/.gtkrc.mine
# $(gtkconfigdir)/gtkrc.zh_CN
#
# This file defines the fontsets for Chinese language (zh) using
# the simplified chinese standard GuoBiao as in mainland China (CN)
#
style "gtk-default-zh-cn" {
fontset = "-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,\
,-misc-simsun-medium-r-normal--16-116-100-100-c-160-gbk-0,*-r-*"
}
class "GtkWidget" style "gtk-default-zh-cn"
第二部分:字符界面(text mode)
注:FreeBSD 5.x 的字符界面似乎至今没有完美的解决方案,以下仅仅用cce2k
做一种临时的不得已方案,希望有谁可以找到完美的方案。
因为cce2k需要VGA_800x600的支持,所以必须重新编译内核,
#cd /usr/src/sys/i386/conf
备份 配置文件
#cp ./GENERIC ./GENERIC.BAK
修改配置文件
#vi ./GENERIC
这是我的配置文件
#
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the handbook section on
# Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US ... lconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.413.2.6.2.2 2004/10/24 18:02:52 scottl Exp $
machine i386
#cpu I486_CPU
#cpu I586_CPU
cpu I686_CPU
ident GENERIC_28_12_2004
# To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.
# SCHED_4BSD is the Traditional FreeBSD scheduler
options SCHED_4BSD # 4BSD scheduler
# SCHED_ULE is the New FreeBSD scheduler,it is designed for SMP system(with
# more than or 2 CPUs),and works at UP system(Just one CPU) as well
#options SCHED_ULE # ULE scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
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 MD_ROOT # MD is a potential root device
#options NFSCLIENT # Network Filesystem Client
#options NFSSERVER # Network Filesystem Server
#options NFS_ROOT # NFS usable as /, requires NFSCLIENT
#options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
#options SCSI_DELAY=15000 # 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 AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver.
options ADAPTIVE_GIANT # Giant mutex is adaptive.
#device apic # I/O APIC
# Bus support. Do not remove isa, even if you have no isa slots
device isa
device eisa
device pci
# Floppy drives
device fdc
# ATA and ATAPI devices
device ata
device atadisk # ATA disk drives
#device ataraid # ATA RAID drives
device atapicd # ATAPI CDROM drives
device atapifd # ATAPI floppy drives
#device atapist # ATAPI tape drives
options ATA_STATIC_ID # Static device numbering
# SCSI Controllers
#device ahb # EISA AHA1742 family
#device ahc # AHA2940 and onboard AIC7xxx devices
#device ahd # AHA39320/29320 and onboard AIC79xx devices
#device amd # AMD 53C974 (Tekram DC-390(T))
#device isp # Qlogic family
#device mpt # LSI-Logic MPT-Fusion
#device ncr # NCR/Symbios Logic
#device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
#device trm # Tekram DC395U/UW/F DC315U adapters
#device adv # Advansys SCSI adapters
#device adw # Advansys wide SCSI adapters
#device aha # Adaptec 154x SCSI adapters
#device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60.
#device bt # Buslogic/Mylex MultiMaster SCSI adapters
#device ncv # NCR 53C500
#device nsp # Workbit Ninja SCSI-3
#device stg # TMC 18C30/18C50
# SCSI peripherals
device scbus # SCSI bus (required for SCSI)
#device ch # SCSI media changers
#device da # Direct Access (disks)
#device sa # Sequential Access (tape etc)
#device cd # CD
#device pass # Passthrough device (direct SCSI access)
#device ses # SCSI Environmental Services (and SAF-TE)
# RAID controllers interfaced to the SCSI subsystem
#device amr # AMI MegaRAID
#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
#device ciss # Compaq Smart RAID 5*
#device dpt # DPT Smartcache III, IV - See NOTES for options
#device hptmv # Highpoint RocketRAID 182x
#device iir # Intel Integrated RAID
#device ips # IBM (Adaptec) ServeRAID
#device mly # Mylex AcceleRAID/eXtremeRAID
#device twa # 3ware 9000 series PATA/SATA RAID
# RAID controllers
#device aac # Adaptec FSA RAID
#device aacp # SCSI passthrough for aac (requires CAM)
#device ida # Compaq Smart RAID
#device mlx # Mylex DAC960 family
#device pst # Promise Supertrak SX6000
#device twe # 3ware ATA RAID
# 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
# Enable this for the pcvt (VT220 compatible) console driver
#device vt
#options XSERVER # support for X server on a vt console
#options FAT_CURSOR # start with block cursor
device agp # support several AGP chipsets
# Floating point support - do not disable.
device npx
# Power management support (see NOTES for more options)
#device apm
# 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
# Serial (COM) ports
device sio # 8250, 16[45]50 based serial ports
# Parallel port
device ppc
device ppbus # Parallel port bus (required)
device lpt # Printer
device plip # TCP/IP over parallel
device ppi # Parallel port interface device
#device vpo # Requires scbus and da
# If you've got a "dumb" serial or parallel PCI card that is
# supported by the puc(4) glue driver, uncomment the following
# line to enable it (connects to the sio and/or ppc drivers):
#device puc
# PCI Ethernet NICs.
#device de # DEC/Intel DC21x4x (``Tulip'')
#device em # Intel PRO/1000 adapter Gigabit Ethernet Card
#device ixgb # Intel PRO/10GbE Ethernet Card
#device txp # 3Com 3cR990 (``Typhoon'')
#device vx # 3Com 3c590, 3c595 (``Vortex'')
# 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 bfe # Broadcom BCM440x 10/100 Ethernet
#device bge # Broadcom BCM570xx Gigabit Ethernet
#device dc # DEC/Intel 21143 and various workalikes
#device fxp # Intel EtherExpress PRO/100B (82557, 82558)
#device lge # Level 1 LXT1001 gigabit ethernet
#device nge # NatSemi DP83820 gigabit ethernet
#device pcn # AMD Am79C97x PCI 10/100 (precedence over 'lnc')
device re # RealTek 8139C+/8169/8169S/8110S
device rl # RealTek 8129/8139
#device sf # Adaptec AIC-6915 (``Starfire'')
#device sis # Silicon Integrated Systems SiS 900/SiS 7016
#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
#device ste # Sundance ST201 (D-Link DFE-550TX)
#device ti # Alteon Networks Tigon I/II gigabit Ethernet
#device tl # Texas Instruments ThunderLAN
#device tx # SMC EtherPower II (83c170 ``EPIC'')
#device vge # VIA VT612x gigabit ethernet
device vr # VIA Rhine, Rhine II
#device wb # Winbond W89C840F
#device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# ISA Ethernet NICs. pccard NICs included.
#device cs # Crystal Semiconductor CS89x0 NIC
# 'device ed' requires 'device miibus'
#device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
#device ex # Intel EtherExpress Pro/10 and Pro/10+
#device ep # Etherlink III based cards
#device fe # Fujitsu MB8696x based cards
#device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
#device lnc # NE2100, NE32-VL Lance Ethernet cards
#device sn # SMC's 9000 series of Ethernet chips
#device xe # Xircom pccard Ethernet
# ISA devices that use the old ISA shims
#device le
# Wireless NIC cards
#device wlan # 802.11 support
#device an # Aironet 4500/4800 802.11 wireless NICs.
#device awi # BayStack 660 and others
#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
#device wl # Older non 802.11 Wavelan wireless NIC.
# Pseudo devices.
device loop # Network loopback
device mem # Memory and kernel memory devices
device io # I/O device
device random # Entropy device
device ether # Ethernet support
#device sl # Kernel SLIP
#device ppp # Kernel PPP
device tun # Packet tunnel.
device pty # Pseudo-ttys (telnet etc)
device md # Memory "disks"
#device gif # IPv6 and IPv4 tunneling
#device faith # IPv6-to-IPv4 relaying (translation)
# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
device bpf # Berkeley packet filter
# USB support
#device uhci # UHCI PCI->USB interface
#device ohci # OHCI PCI->USB interface
#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 urio # Diamond Rio 500 MP3 player
#device uscanner # Scanners
# USB Ethernet, requires mii
#device aue # ADMtek USB Ethernet
#device axe # ASIX Electronics USB Ethernet
#device cue # CATC USB Ethernet
#device kue # Kawasaki LSI USB Ethernet
#device rue # RealTek RTL8150 USB Ethernet
# FireWire support
#device firewire # FireWire bus code
#device sbp # SCSI over FireWire (Requires scbus and da)
#device fwe # Ethernet over FireWire (non-standard!)
# More screen pixels support
options VESA
options SC_PIXEL_MODE
# 上面两行一定要加上,这就是这次编译的主要目的
这是一篇带有注释的 配置文件
------------------------------------------------------------------------
machine i386 # 体系模型为i386
cpu I386_CPU # 支持80386
cpu I486_CPU # 支持80486
cpu I586_CPU # 支持Pentium
cpu I686_CPU # 支持Pentium Pro以及更高
ident GENERIC # 内核文件的名字
maxusers 0 # 自动检测同时允许的最大用户数
#makeoptions DEBUG=-g # 包含调试符号。通常只有current版本打开
options MATH_EMULATE #支持协处理器模拟
options INET #支持互联网
options INET6 #IPv6通讯协议
options FFS #伯克利快速文件系统
options FFS_ROOT #FFS作为根设备[必须保留]
options SOFTUPDATES #打开FFS soft updates支持
options UFS_DIRHASH #提高大型目录的支持
options MFS #内存文件系统
options MD_ROOT #MD作为根设备
options NFS #Network Filesystem
options NFS_ROOT #NFS作为根设备(需要NFS)
options MSDOSFS #MSDOS文件系统
options CD9660 #ISO 9660文件系统(光盘)
options CD9660_ROOT #CD-ROM作为根设备(需要CD9660)
options PROCFS #进程文件系统
options COMPAT_43 #兼容4.3BSD[必须保留]
options SCSI_DELAY=15000 #检测SCSI设备前的延时(ms)
options UCONSOLE #用户可以夺取控制台
options USERCONFIG #boot -c编辑器 editor
options VISUAL_USERCONFIG #菜单式boot -c编辑器
options KTRACE #ktrace(1)支持
options SYSVSHM #SYSV-风格的共享内存
options SYSVMSG #SYSV-风格的消息队列
options SYSVSEM #SYSV-风格的信号量(semaphores)
options P1003_1B #Posix P1003_1B实时扩展
options _KPOSIX_PRIORITY_SCHEDULING
options ICMP_BANDLIM #对恶意ICMP请求进行限制
options KBD_INSTALL_CDEV # 在/dev安装一个CDEV设备
# 下面两项在制作对称多处理器(SMP)内核时需要
#options SMP #对称多处理器内核
#options APIC_IO #对称(APIC) I/O
device isa
device eisa
device pci
# 软驱
device fdc0 at isa? port IO_FD1 irq 6 drq 2
device fd0 at fdc0 drive 0
device fd1 at fdc0 drive 1
#
# 如果使用东芝Libretto以及他的Y-E Y-E Data PCMCIA软驱
# 不要使用上面的fdc0,而应使用
#device fdc0
# ATA以及ATAPI设备
device ata0 at isa? port IO_WD1 irq 14
device ata1 at isa? port IO_WD2 irq 15
device ata
device atadisk # ATA 磁盘驱动器(IDE硬盘)
device atapicd # ATAPI 光驱
device atapifd # ATAPI 软驱
device atapist # ATAPI 磁带机
options ATA_STATIC_ID #静态设备编号
# SCSI控制器
device ahb # EISA AHA1742 family
device ahc # AHA2940 板载AIC7xxx设备
device amd # AMD 53C974 (Tekram DC-390(T))
device isp # Qlogic family
device ncr # NCR/Symbios Logic
device sym # NCR/Symbios Logic (较新的芯片组)
options SYM_SETUP_LP_PROBE_MAP=0x40
# 使用ncr可以在配置了sym和ncr的情况下挂接旧的NCR设备
device adv0 at isa?
device adw
device bt0 at isa?
device aha0 at isa?
device aic0 at isa?
device ncv # NCR 53C500
device nsp # Workbit Ninja SCSI-3
device stg # TMC 18C30/18C50
# SCSI 外设
device scbus # SCSI 总线(如果使用SCSI设备,必须有)
device da # Direct Access (硬盘)
device sa # Sequential Access (磁带,等等)
device cd # CD
device pass # Passthrough device (直接 SCSI 访问)
# 通过SCSI子系统接口的RAID控制器
device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
device dpt # DPT Smartcache - See LINT for options!
device iir # Intel Integrated RAID
device mly # Mylex AcceleRAID/eXtremeRAID
device ciss # Compaq SmartRAID 5* series
# RAID控制器
device aac # Adaptec FSA RAID, Dell PERC2/PERC3
device aacp # SCSI passthrough for aac (requires CAM)
device ida # Compaq Smart RAID
device amr # AMI MegaRAID
device mlx # Mylex DAC960 family
device twe # 3ware Escalade
# atkbdc0 控制键盘和PS/2鼠标
device atkbdc0 at isa? port IO_KBD
device atkbd0 at atkbdc? irq 1 flags 0x1
device psm0 at atkbdc? irq 12
device vga0 at isa?
# 启动画面和屏幕保护程序
pseudo-device splash
# syscons 是默认的控制台驱动,类似SCO控制台
device sc0 at isa? flags 0x100
# 对于pcvt vt220控制台,启用这个和PCVT_FREEBSD
#device vt0 at isa?
#options XSERVER # 在vt控制台支持X服务器
#options FAT_CURSOR # 使用大光标
# 如果你是用ThinkPad,将下面的一行和其他PCVT相关设备的注释去掉
#options PCVT_SCANSET=2 # IBM使用非标准键盘
# 浮点运算支持 - 请勿禁用
device npx0 at nexus? port IO_NPX irq 13
# 电源管理支持
device apm0 at nexus? disable flags 0x20 # Advanced Power Management
# PCCARD (PCMCIA) 支持
device card
device pcic0 at isa? irq 0 port 0x3e0 iomem 0xd0000
device pcic1 at isa? irq 0 port 0x3e2 iomem 0xd4000 disable
# 串口(COM)
device sio0 at isa? port IO_COM1 flags 0x10 irq 4
device sio1 at isa? port IO_COM2 irq 3
device sio2 at isa? disable port IO_COM3 irq 5
device sio3 at isa? disable port IO_COM4 irq 9
# 并口
device ppc0 at isa? irq 7
device ppbus # 并口总线 (所有并口设备都需要)
device lpt # 打印机
device plip # 并口TCP/IP
device ppi # 并口接口设备
#device vpo # 需要scbus和da
# PCI 以太网适配器
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel PRO/1000 adapter Gigabit Ethernet Card (``Wiseman'')
device txp # 3Com 3cR990 (``Typhoon'')
device vx # 3Com 3c590, 3c595 (``Vortex'')
# 使用公共的MII总线控制器代码的PCI以太网适配器
# 注意:一定要保留'device miibus'以确保可用
device miibus # MII总线支持
device dc # DEC/Intel 21143 and various workalikes
device fxp # Intel EtherExpress PRO/100B (82557, 82558)
device pcn # AMD Am79C97x PCI 10/100 NICs
device rl # RealTek 8129/8139
device sf # Adaptec AIC-6915 (``Starfire'')
device sis # Silicon Integrated Systems SiS 900/SiS 7016
device ste # Sundance ST201 (D-Link DFE-550TX)
device tl # Texas Instruments ThunderLAN
device tx # SMC EtherPower II (83c170 ``EPIC'')
device vr # VIA Rhine, Rhine II
device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
device bge # Broadcom BCM570x (``Tigon III'')
# ISA以太网适配器
# 'device ed' 需要 'device miibus'
device ed0 at isa? port 0x280 irq 10 iomem 0xd8000
device ex
device ep
device fe0 at isa? port 0x300
# Xircom Ethernet
device xe
# PRISM I IEEE 802.11b wireless NIC.
device awi
# WaveLAN/IEEE 802.11 wireless NICs. Note: the WaveLAN/IEEE really
# exists only as a PCMCIA device, so there is no ISA attachment needed
# and resources will always be dynamically assigned by the pccard code.
device wi
# Aironet 4500/4800 802.11 wireless NICs. Note: the declaration below will
# work for PCMCIA and PCI cards, as well as ISA cards set to ISA PnP
# mode (the factory default). If you set the switches on your ISA
# card for a manually chosen I/O address and IRQ, you must specify
# those parameters here.
device an
# The probe order of these is presently determined by i386/isa/isa_compat.c.
device ie0 at isa? port 0x300 irq 10 iomem 0xd0000
#device le0 at isa? port 0x300 irq 5 iomem 0xd0000
device lnc0 at isa? port 0x280 irq 10 drq 0
device cs0 at isa? port 0x300
device sn0 at isa? port 0x300 irq 10
# 伪设备 - 数字表示分配多少个
pseudo-device loop # 环回网络
pseudo-device ether # 以太网支持
pseudo-device sl 1 # 核心级SLIP
pseudo-device ppp 1 # 核心级PPP
pseudo-device tun # 数据包隧道
pseudo-device pty # 伪-tty(telnet等等)
pseudo-device md # 内存虚拟盘
pseudo-device gif # IPv6和IPv4隧道
pseudo-device faith 1 # IPv6-to-IPv4转发(翻译)
# `bpf'伪设备将启用伯克利数据包过滤器。
# 小心由此带来的管理问题
pseudo-device bpf #Berkeley packet filter
# USB支持
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device usb # USB Bus (required)
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
device urio # Diamond Rio MP3 Player
# USB 以太网,需要mii
device aue # ADMtek USB ethernet
device cue # CATC USB ethernet
device kue # Kawasaki LSI USB ethernet
----------------------------------------------------------------
现在要做的是去掉我们不需要的任何设备。(红色、中划线表示删除,红色无修饰表示修改,蓝色表示增加)。这份配置是生产服务器上的配置文件。
----------------------------------------------------------------
machine i386 # 体系模型为i386
cpu I386_CPU # 支持80386
cpu I486_CPU # 支持80486
cpu I586_CPU # 支持Pentium
cpu I686_CPU # 支持Pentium Pro以及更高
ident APACHE # 内核文件的名字
maxusers 0 # 自动检测同时允许的最大用户数
#makeoptions DEBUG=-g # 包含调试符号。通常只有current版本打开
options MATH_EMULATE #支持协处理器模拟
#options GPL_MATH_EMULATE #GPL模拟更好,但仍然没必要,P III有内建协处理器
options INET #支持互联网
options INET6 #IPv6通讯协议
options FFS #伯克利快速文件系统
options FFS_ROOT #FFS作为根设备[必须保留]
options SOFTUPDATES #打开FFS soft updates支持
options UFS_DIRHASH #提高大型目录的支持
options MFS #内存文件系统
options MD_ROOT #MD作为根设备
options NFS #Network Filesystem
options NFS_ROOT #NFS作为根设备(需要NFS)
options MSDOSFS #MSDOS文件系统
options CD9660 #ISO 9660文件系统(光盘)
options CD9660_ROOT #CD-ROM作为根设备(需要CD9660)
options PROCFS #进程文件系统
options COMPAT_43 #兼容4.3BSD[必须保留]
options SCSI_DELAY=5000 #检测SCSI设备前的延时(ms)
options UCONSOLE #用户可以夺取控制台[没有X,不用]
options USERCONFIG #boot -c编辑器 editor
options VISUAL_USERCONFIG #菜单式boot -c编辑器
options KTRACE #ktrace(1)支持
options SYSVSHM #SYSV-风格的共享内存
options SYSVMSG #SYSV-风格的消息队列
options SYSVSEM #SYSV-风格的信号量(semaphores)
options P1003_1B #Posix P1003_1B实时扩展
options _KPOSIX_PRIORITY_SCHEDULING
options ICMP_BANDLIM #对恶意ICMP请求进行限制[例如flood ping]
options KBD_INSTALL_CDEV # 在/dev安装一个CDEV设备
options CPU_ENABLE_SSE #启用SSE支持(Pentium III)
#options CPU_ATHLON_SSE_HACK #如果你的BIOS不能正确识别Athlon SSE
#options NO_F00F_HACK #如果你使用Pentium且没有F00F bug
# 对ISA总线,AUTO_EOI将启用8259A的自动EOI功能
# 这意味着每次中断调用节省0.7-1.25微秒,但不应用于笔记本
options AUTO_EOI_1
#options AUTO_EOI_2 # 请不要和AUTO_EOI_1同时打开,否则会崩溃。
#options MAXMEM="(1024*1024)" #除非你的BIOS设置不正确造成
#无法检测内存大小,单位是KB
#在xntpd(的监督下启用内核相同步逻辑
#options PPS_SYNC
#IPFirewall。我们需要的功能IPFilter都提供,并且更高效
#除非你需要IPFirewall的某些专有功能,否则这部分不必编译
#options IPFIREWALL #防火墙
#options IPFIREWALL_VERBOSE #允许防火墙日志
#options IPFIREWALL_FORWARD #允许透明代理
#options IPFIREWALL_VERBOSE_LIMIT=100 #限制日至
#options IPFIREWALL_DEFAULT_TO_ACCEPT #默认允许所有IP包
#options IPFW2 # IPFW2,这一特性并非4.x默认。
options IPFILTER #ipfilter支持
options IPFILTER_LOG #ipfilter日志
options IPFILTER_DEFAULT_BLOCK #默认阻断所有IP包
# 静态数据包过滤许可规则(直接放入内核)
options ACCEPT_FILTER_DATA
options ACCEPT_FILTER_HTTP
#options DEVICE_POLLING #改善网络响应时间,但realtek不支持
options IPSTEALTH #支持秘密IP转发
options RANDOM_IP_ID #随机IP ID,阻止信息泄漏
#options TCP_DROP_SYNFIN #抛弃SYN+FIN包,阻止检测服务器
#的TCP协议栈、操作系统,但这对Web
#服务器是不推荐的,因为不符合RFC1644
#options QUOTA #启用配额支持,但此处没用
makeoptions CONF_CFLAGS=-fno-builtin #禁用memcpy等GCC默认的影响性能的设置
# 根据内存大小配置应用程序可用的最大内存
# 这台机器有1GB内存
# FreeBSD默认是允许使用128MB
options MAXDSIZ="(1024*1024*1024)"
options MAXSSIZ="(1024*1024*1024)"
options DFLDSIZ="(1024*1024*1024)"
#options PMAP_SHPGPERPROC=201 #每一进程的可用PV项数。
#options NO_SWAPPING #禁用交换区。不推荐
options PANIC_REBOOT_WAIT_TIME=0 #内核异常(kernel panic)立即重启
#核心内存大小限制。我倾向使用默认值
#options VM_KMEM_SIZE="(12*1024*1024)"
#options VM_KMEM_SIZE_MAX="(256*1024*1024)"
#options VM_KMEM_SIZE_SCALE="4"
#将这份配置文件保存到kernel文件中,以便以后读取
#使用这样的命令:
# strings -n 3 /kernel | sed -n 's/^___//p' > APACHE
#这里我们不需要这样做。
#options INCLUDE_CONFIG_FILE # 包含配置文件到内核中
#options USER_LDT #某些ports需要这么做,未来的FreeBSD可能也需要
# 下面两项在制作对称多处理器(SMP)内核时需要
#options SMP #对称多处理器内核
#options APIC_IO #对称(APIC) I/O
device isa
device eisa
device pci
# 软驱
device fdc0 at isa? port IO_FD1 irq 6 drq 2
device fd0 at fdc0 drive 0
device fd1 at fdc0 drive 1
#
# 如果使用东芝Libretto以及他的Y-E Y-E Data PCMCIA软驱
# 不要使用上面的fdc0,而应使用
#device fdc0
# ATA以及ATAPI设备
# 下面两行被删去,因为新系统不再需要它们。
device ata0 at isa? port IO_WD1 irq 14
device ata1 at isa? port IO_WD2 irq 15
device ata
device atadisk # ATA 磁盘驱动器(IDE硬盘)
device atapicd # ATAPI 光驱
device atapifd # ATAPI 软驱
device atapist # ATAPI 磁带机
options ATA_STATIC_ID #静态设备编号[新系统不再需要]
# SCSI控制器
device ahb # EISA AHA1742 family
device ahc # AHA2940 板载AIC7xxx设备
device amd # AMD 53C974 (Tekram DC-390(T))
device isp # Qlogic family
device ncr # NCR/Symbios Logic
device sym # NCR/Symbios Logic (较新的芯片组)
options SYM_SETUP_LP_PROBE_MAP=0x40
# 使用ncr可以在配置了sym和ncr的情况下挂接旧的NCR设备
device adv0 at isa?
device adw
device bt0 at isa?
device aha0 at isa?
device aic0 at isa?
device ncv # NCR 53C500
device nsp # Workbit Ninja SCSI-3
device stg # TMC 18C30/18C50
# SCSI 外设
device scbus # SCSI 总线(如果使用SCSI设备,必须有)
device da # Direct Access (硬盘)
device sa # Sequential Access (磁带,等等)
device cd # CD
device pass # Passthrough device (直接 SCSI 访问)
# 通过SCSI子系统接口的RAID控制器
device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
device dpt # DPT Smartcache - See LINT for options!
device iir # Intel Integrated RAID
device mly # Mylex AcceleRAID/eXtremeRAID
device ciss # Compaq SmartRAID 5* series
# RAID控制器
device aac # Adaptec FSA RAID, Dell PERC2/PERC3
device aacp # SCSI passthrough for aac (requires CAM)
device ida # Compaq Smart RAID
device amr # AMI MegaRAID
device mlx # Mylex DAC960 family
device twe # 3ware Escalade
# atkbdc0 控制键盘和PS/2鼠标[这台机器没配鼠标,也不用图形界面]
device atkbdc0 at isa? port IO_KBD
device atkbd0 at atkbdc? irq 1 flags 0x1
device psm0 at atkbdc? irq 12 #鼠标器
device vga0 at isa?
options VGA_NO_FONT_LOADING # 不需要保存/加载字体[节省内存]
options VGA_NO_MODE_CHANGE # 不需要修改显示模式[节省内存]
# 启动画面和屏幕保护程序[我的服务器平时不接显示器]
pseudo-device splash
# syscons 是默认的控制台驱动,类似SCO控制台
device sc0 at isa? flags 0x100
options MAXCONS=4 # 不需要更多的控制台
options SC_DISABLE_REBOOT # 禁止Ctrl+Alt+Del重启,必须以root登录。
options SC_NO_CUTPASTE # 禁用剪贴板[节省内存]
options SC_NO_FONT_LOADING # 禁用字体加载[节省内存]
options SC_NO_SYSMOUSE # 禁用鼠标[节省内存]
# 对于pcvt vt220控制台,启用这个和PCVT_FREEBSD
#device vt0 at isa?
#options XSERVER # 在vt控制台支持X服务器
#options FAT_CURSOR # 使用大光标
# 如果你是用ThinkPad,将下面的一行和其他PCVT相关设备的注释去掉
#options PCVT_SCANSET=2 # IBM使用非标准键盘
# 浮点运算支持 - 请勿禁用
device npx0 at nexus? port IO_NPX irq 13
# 电源管理支持[这台机器期待长期运行]
device apm0 at nexus? disable flags 0x20 # Advanced Power Management
# PCCARD (PCMCIA) 支持
device card
device pcic0 at isa? irq 0 port 0x3e0 iomem 0xd0000
device pcic1 at isa? irq 0 port 0x3e2 iomem 0xd4000 disable
# 串口(COM)
device sio0 at isa? port IO_COM1 flags 0x10 irq 4
device sio1 at isa? port IO_COM2 irq 3
device sio2 at isa? disable port IO_COM3 irq 5
device sio3 at isa? disable port IO_COM4 irq 9
# 并口
device ppc0 at isa? irq 7
device ppbus # 并口总线 (所有并口设备都需要)
device lpt # 打印机
device plip # 并口TCP/IP
device ppi # 并口接口设备
#device vpo # 需要scbus和da
# PCI 以太网适配器
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel PRO/1000 adapter Gigabit Ethernet Card (``Wiseman'')
device txp # 3Com 3cR990 (``Typhoon'')
device vx # 3Com 3c590, 3c595 (``Vortex'')
# 使用公共的MII总线控制器代码的PCI以太网适配器
# 注意:一定要保留'device miibus'以确保可用
device miibus # MII总线支持
device dc # DEC/Intel 21143 and various workalikes
device fxp # Intel EtherExpress PRO/100B (82557, 82558)
device pcn # AMD Am79C97x PCI 10/100 NICs
device rl # RealTek 8129/8139
device sf # Adaptec AIC-6915 (``Starfire'')
device sis # Silicon Integrated Systems SiS 900/SiS 7016
device ste # Sundance ST201 (D-Link DFE-550TX)
device tl # Texas Instruments ThunderLAN
device tx # SMC EtherPower II (83c170 ``EPIC'')
device vr # VIA Rhine, Rhine II
device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
device bge # Broadcom BCM570x (``Tigon III'')
# ISA以太网适配器
# 'device ed' 需要 'device miibus'
device ed0 at isa? port 0x280 irq 10 iomem 0xd8000
device ex
device ep
device fe0 at isa? port 0x300
# Xircom Ethernet
device xe
# PRISM I IEEE 802.11b wireless NIC.
device awi
# WaveLAN/IEEE 802.11 wireless NICs. Note: the WaveLAN/IEEE really
# exists only as a PCMCIA device, so there is no ISA attachment needed
# and resources will always be dynamically assigned by the pccard code.
device wi
# Aironet 4500/4800 802.11 wireless NICs. Note: the declaration below will
# work for PCMCIA and PCI cards, as well as ISA cards set to ISA PnP
# mode (the factory default). If you set the switches on your ISA
# card for a manually chosen I/O address and IRQ, you must specify
# those parameters here.
device an
# The probe order of these is presently determined by i386/isa/isa_compat.c.
device ie0 at isa? port 0x300 irq 10 iomem 0xd0000
#device le0 at isa? port 0x300 irq 5 iomem 0xd0000
device lnc0 at isa? port 0x280 irq 10 drq 0
device cs0 at isa? port 0x300
device sn0 at isa? port 0x300 irq 10
# 伪设备 - 数字表示分配多少个
pseudo-device loop # 环回网络
pseudo-device ether # 以太网支持
pseudo-device sl 1 # 核心级SLIP
pseudo-device ppp 1 # 核心级PPP
pseudo-device tun # 数据包隧道
pseudo-device pty # 伪-tty(telnet等等)
pseudo-device md # 内存虚拟盘
pseudo-device gif # IPv6和IPv4隧道
pseudo-device faith 1 # IPv6-to-IPv4转发(翻译)
# `bpf'伪设备将启用伯克利数据包过滤器。
# 小心由此带来的管理问题
pseudo-device bpf #Berkeley packet filter
# USB支持
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device usb # USB Bus (required)
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
device urio # Diamond Rio MP3 Player
# USB 以太网,需要mii
device aue # ADMtek USB ethernet
device cue # CATC USB ethernet
device kue # Kawasaki LSI USB ethernet
原文出处:
《FreeBSD内核配置说明》
http://www.freebsdchina.org/foru ... ac9bdf823fb16b0ef72
修改好GENERIC后,开始正式编译内核:
生成 内核源代码
# /usr/sbin/config GENERIC
编译内核
# cd ../compile/GENERIC
# make depend
# make
安装新内核
# make install
如果这些步骤里没有出现任何错误的话,那么新的内核就安装成功。
使用新的内核
#reboot
如果出现了错误,那么请检查内核配置文件。
如果新的内核启动不了,请在启动后进入 启动选择菜单 时,任选一个
键(Enter除外),按下,输入unload,输入boot kernel.old或者其它可
以启动的内核的名称。
启动系统后:
login#root
password:********************
进入系统:
#cd /boot
#ls
这时你可以发现这个目录下有两个重要的子目录kernel和kernel.old,
kernel是你新的内核(正在使用的内核),kernel.old是旧的内核,如果
经过适当的配置,往往可以发现新的内核比旧的内核小了不少。
#ls -l ./kernel.old/kernel
#ls -l ./kernel/kernel
我的旧内核5.8Mbytes,新内核才2.6Mbytes
为防止下次编译内核时覆盖掉最元始的内核,请备份旧内核:
#cp -R ./kernel.old ./kernel.24_12_2004
开始文本界面的设置:
检查你的计算机支持那些显示模式:
#vidcontrol -i mode | grep G | less
这时如果发现1024x768及其上的模式,请不要乱尝试(如果谁成功设置了
1024x768及其上的模式麻烦把经验写出来,谢谢!好象google可以搜到类
似文章,可惜我没有设置好。)
发现 800x600 的对于 cce2k 足够了。
如果发现 800x600 的,说明你的内核已经支持VESA了,
控制台下:
#vidcontrol -g 100x37 VESA_800x600
看看你的屏幕有无变化,
如果成功了,
#cd /etc
备份要修改的 配置文件
#cp ./rc.conf ./rc.conf.BAK
#vi rc.conf
在该文件的末尾加上
allscreens_flags="-g 100x37 VESA_800x600"
这样你重启登录时屏幕自动设为 800x600 模式
建议你重启系统看看行不行。
(如果重启系统,请用root登录。登录后 ...)
安装cce2k软件包
#cd /usr/ports/chinese/cce/
#make install clean
控制台(text mode)下
#cce
进入cce中文环境,ctrl+Space可以输入中文,
退出cce
#exit
这里有个缺陷,退出cce后,又回复到 640x480 模式,
不了解 cce,应该可以设置退出后还是 800x600 模式。
不过可以采用简单的方法:
在/usr/bin下写一个脚本EXIT:
#!/bin/csh
# exit 命令 的替代方案
exec exit
vidcontrol -g 100x37 VESA_800x600
存盘
#chmod a+x ./EXIT
顺便安装FreeBSD的boot splash
选取一张320x200至800x600的256色BMP或者PCX图象(建议用gimp或者xpaint生成),
这个网址:
http://www.baldwin.cx/splash/
有好多作好的splash图片
获取到合适的图片后取个名,比如logo.bmp(假设为bmp图象),复制到 /boot/ 下,
#cd /boot/defaults/
#cp ./loader.conf ./loader.conf.BAK
#vi ./loader.conf
找到Splash screen configuration这一段:
修改为:
splash_bmp_load="YES"
splash_pcx_load="NO"
vesa_load="YES" #如果你的图象大于640x480,请设为YES
bitmap_load="YES"
bitmap_name="/boot/logo.bmp"
bitmap_type="splash_image_data"
重启后看看有没有效果。 |
|