- 论坛徽章:
- 0
|
整理的本本上的安装笔记,思路比较零乱,欢迎大家拍砖!!
DELL LS400 Laptop上FreeBSD5.4的安装笔记
原创:Libra9z
我的本本是2000年底买的,当时配置还算高,128M的内存,40G的硬盘,PIII 500MHz的CPU,但是在现在安装Windows Xp免为其难,跑FreeBSD还是可以的。
我的基本要求是要在该本本上安装两个操作系统,Windows XP 和freeBSD5.4,安装Windows Xp的目的主要是工作有时侯会用到(如果那一天FreeBSD上能够跑IBM的Lotus Notes和招商银行专业版,我就完全可以抛弃Windows XP了)
第一步:安装FreeBSD
安装过程分为从CD上直接安装和硬盘直接安装,我的是从硬盘安装的,所以在这里主要描述硬盘安装的过程。
硬盘安装所需要的软件:isoemu
这个软件可以从网上下载。用Winrar解压到C盘根目录下。
准备以下的工作:
1)下载FreeBSD 5.4 的第一张盘5.4-RELEASE-i386-disc1,将该文件放到C盘的根目录下,然后改名为Freebsd.iso。
2)用Winrar或者UltraISO将Freebsd.iso中的5.4-Release中的文件释放到C:\5.4-Release目录下
3)将Freebsd.iso中packages目录下的东西释放到C:\5.4-Release\packages下
4)修改刚才复制过来的5.4-RELEASE\packages的INDEX文件,用写字板打开,查找替换目标"||1"替换成"|"查找"||2"替换成"|",之后保存.
5)修改isoemu.ini,在里面找到isogrub.iso,将isogrub.iso换成Freebsd.iso
6)修改Boot.ini,在Boot.ini里面添加C:\ieldr=”FreeBSD Install”,同时修改系统引导等待的时间,我一般是修改为10秒。
重新起动机器,在进行操作系统选择时,选择“FreeBSD Install” 就可以看到熟悉的安装界面
注意:在安装FreeBSD的过程时,Media选择从MSDOS分区,一般是ad0s1
我的安装比较简单,只安装了基本的系统、x11、和kernel source,没有安装KDE和Gnome桌面系统,因为我的本本上跑的比较慢,一般我喜欢用Fvwm,然后自己配置桌面。所以整个安装都比较快。
第二步:定制内核
1)修改声卡驱动程序
由于DELL LS400所使用的声卡为Neomaigc的,在FreeBSD4.x 和freeBSD5.x中如果要使用该声卡,必须对该程序的代码做一定的修改,否则系统在起动的时候会引起:
Hang on boot w/neomagic audio,然后机器就会死机,不会向下运行。
解决该问题的办法是:
修改/usr/src/sys/dev/sound/pci/neomagic.c
在该文件中查找nm_initcd(),在函数的内部,注释掉nm_wr(sc,0x6cc,0x87,1)这一行。然后重新编译内核,就可以解决该问题。
2)定制内核
我的内核配置如下:
machine i386
cpu I686_CPU
ident LIBRA9Z
# To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
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=2000 # 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.
#add by libra9z
options VESA #
options SC_PIXEL_MODE #增加console对100x43的支持
options PQ_MEDIUMCACHE
options CPU_SUSP_HLT
options AUTO_EOI_1
options IPSEC #内核支持IPSec
options TCP_DROP_SYNFIN #增加网络的安全性
options ZERO_COPY_SOCKETS #提高网络的性能
options CPU_ENABLE_SSE #让CPU支持SSE指令
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 atapicd # ATAPI CDROM drives
options ATA_STATIC_ID # Static device numbering
# SCSI peripherals
device scbus # SCSI bus (required for SCSI)
#device ch # SCSI media changers
device da # Direct Access (disks)
device cd # CD
device pass # Passthrough device (direct SCSI access)
# 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
# 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
# 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 xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# 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!
# Note that 'bpf' is required for DHCP.
device bpf # Berkeley packet filter
device pf #我使用的是pf防火墙,所以将该设备编译进内核
# USB support
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 umass # Disks/Mass storage - Requires scbus and da
device ums # Mouse
配置好内核后,执行下面的操作:
#config LIBRA9Z
#cd ../compile/LIBRA9Z
#make depend
# make
#make install clean
要想使新内核生效,需要重新起动机器,在重新起动机器前还需要对/boot/defaults/loader.conf进行必要的修改,让系统支持Audio,将snd_neomagic_load=”NO” 改为snd_neomagic_load=”YES”
第三步:安装配置Modem
配置好内核后,下一步就是配置ppp,由于本本上的Modem使用的Lucent 的modem,在Freebsd系统中,不支持该驱动,需要使用ports中的驱动,这个ports在/usr/ports/comms/ltmdm
由于不能拨号上网,只有在WindowsXp下,下载相应的软件ltmdm-1.4.tgz到/usr/ports/distfiles下
然后进入/usr/ports/comms/ltmdm,执行make install clean
安装完毕后,要想使操作系统装载该驱动程序,需要修改/etc/rc.conf,在/etc/rc.conf中增加一行ltmdm_enable=”YES”
修改/etc/ppp/ppp.conf
将ppp.conf中的 /dev/cuaa0 改为 /dev/cual0
重新起动机器后,就可以使用ppp上网了。
第四步:中文环境的设置
1)安装中文字体管理软件ttfm
该ports在/usr/ports/chinese下
#cd /usr/ports/chinese/ttfm
#make install clean
安装结束后,别忘记运行rehash
#mkdir /usr/X11R6/lib/X11/fonts/TrueType
将windows Xp下的Simsun.ttc 和tahoma.ttf 拷贝到目录/ usr/X11R6/lib/X11/fonts/TrueType下,然后执行下面的命令
#ttfm.sh –add simsun.ttc
#ttfm.sh –add tahoma.ttf
配置xorg.conf
# This loads the font modules
Load "type1"
# Load "speedo"
Load "freetype"
Load "xtt"
增加对TrueType字体的支持
FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"
增加对鼠标滚轮的支持
Section "InputDevice"
# Identifier and driver
Identifier "Mouse1"
Driver "mouse"
Option " rotocol" "SysMouse"
Option "Device" "/dev/sysmouse"
option "ZAxisMapping" "4 5"
EndSection
修改/usr/X11R6/etc/fonts/fonts.conf
在该文件中增加以下内容
<match target="pattern">;
<test qual="any" name="size" compare="l">;
<int>;10</int>;
</test>;
<edit name="antialias" mode="assign">;
<bool>;false</bool>;
</edit>;
</match>;
2)安装窗口管理器Fvwm-i18n
这个要想让Fvwm支持中文,需要安装/usr/ports/x11-wm/fvwm2-i18n,进入该目录,然后执行:make install clean
配置 ~/.fvwm/.fvwm2rc
将这个文件里面的字体全部换成Simsun
3)安装Firefox1.0.4
进入/usr/ports/www/firefox,执行:make install clean
注意:这样安装后,Firefox的字体不是很好看,需要进一步的美化它的字体,修改~/.mozilla/firefox/XXX/chrome目录下的userChrome.css文件,我的userChrome.css的内容如下
/*
* Do not remove the @namespace line -- it's required for correct functioning
*/
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" ; /* set default namespace to XUL */
/*
* Some possible accessibility enhancements:
*/
/*
* Make all the default font sizes 20 pt:
*/
* {
font-size: 12pt !important;
font-family: Simsun !important;
}
window {
font-size: 3.5mm !important;
font-family: Simsun !important;
}
dialog {
font-size: 4mm !important;
font-family:simsun !important;
}
input {
font-family: Simsun !important;
}
textarea {
font-family: Simsun !important;
background-color: rgb(200,255,220) !important;
}
/*
* Make menu items in particular 15 pt instead of the default size:
*/
menupopup >; * {
font-size: 12pt !important;
font-family: Simsun !important;
}
menubar,menubutton,menulist,menu,menuitem {
font-family: Simsun !important;
font-size: 12pt !important;
}
/*
* For more examples see http://www.mozilla.org/unix/customizing.html
*/
4)安装Fcitx输入法
进入/usr/ports/chinese/fcitx,执行make install clean
修改~/.fcitx/config
[程序]
显示字体(中)=simsun
显示字体(英)=simsun
显示字体大小=14
主窗口字体大小=14
是否使用AA字体=1
其他部分不用修改。
5)安装其他的软件
Gaim-QQ
Realpalyer10.0.3
mplayer
zh-xmms
openoffice.org-1.1.4
xpdf
stardict2
第五步:配置简单防火墙
为了保证上网的安全,需要配置自己的防火墙,由于本本当工作站使用,不提供什么服务,所以我的pf规则如下所示:
pass out quick on lo0
pass in quick on lo0
block in on tun0 all
block in log quick proto icmp from any to any
pass out quick from any to any keep state
我的rc.conf配置如下:
kern_securelevel="-1"
kern_securelevel_enable="YES"
moused_enable="YES"
nisdomainname="NO"
saver="daemon"
usbd_enable="YES"
ltmdm_enable="YES"
linux_enable="YES"
allscreens_flags=" -g 100x37 VESA_800x600"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
clear_tmp_enable="YES"
tcp_extensions="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_program="/sbin/pfctl"
pf_flags=""
pflog_enable="YES"
pflog_program="/sbin/pflogd"
pflog_flags=""
pflog_logfile="/var/log/pflog"
到此,一个工作站配置结束,可以用来写文档、看电影、听歌。
最后,要非常感谢支持我的人,特别是我的爱人!
2005年7月16日 : Libra9z |
|