星期天呀,呵呵,10:30起床,好像有一点早,昨天晚上玩游戏玩到3点钟,好累呀。打开电脑,先玩一会游戏在说。11:00,不玩了,开始干正事了。先换到linux下去。本来想用虚拟机的,但是我做的ftp不能用,而且还可能好慢的。我的电脑是没有上网的,在我的2003下架了个ftp,想让虚拟机来访问,可是虚拟机和我的电脑连不上,好郁闷。
(1)安装module-init-tools-3.0.tar.gz:
# tar -zxvf module-init-tools-3.0.tar.gz
# cd module-init-tools-3.0
# ./configure --prefix=/sbin
# make
# make install
# ./generate-modprobe.conf /etc/modprobe.conf
不知道为什么,我用module-init-tools-3.1时make出错。如果改用3.0的就没事了。
(2)安装modutils-2.4.25-8.9.i386.rpm:
# rpm -uvih modutils-2.4.25-8.9.i386.rpm
对modutils进行升级。
(3)安装新内核:
将新内核copy到/usr/src下,
#tar xzvf linux-2.6.11.tar.gz -----解压缩.
ii. 将名为linux的符号链接删掉,这时旧版本内核的符号链接.
#ln -s linux-2.6.11 linux ------建立linux-2.6.11的符号链接linux.
设置内核.
# cd /usr/src/linux
# make mrproper -----删除不必要的文件和目录.
#make config(基于文本的最为传统的配置界面,不推荐使用)
#make menuconfig(基于文本选单的配置界面,字符终端下推荐使用)
#make xconfig(基于图形窗口模式的配置界面,xwindow下推荐使用)
#make oldconfig(如果只想在原来内核配置的基础上修改一些小地方,会省去不少麻烦)
它们的目的是一样的,那就是生成一个.config文件
这三个命令中,make xconfig的界面最为友好,如果你可以使用xwindow,你就用这个好了,这个比较方便,也好设置。如果你不能使用xwindow,那么就使用make menuconfig好了。界面虽然比上面一个差点,总比make config的要好多了。
选择相应的配置时,有三种选择,它们分别代表的含义如下:
y--将该功能编译进内核
n--不将该功能编译进内核
m--将该功能编译成可以在需要时动态插入到内核中的模块
如果使用的是make xconfig,使用鼠标就可以选择对应的选项。如果使用的是 make menuconfig,则需要使用空格键进行选取。你会发现在每一个选项前都有个括号, 但有的是中括号有的是尖括号,还有一种圆括号。用空格键选择时可以发现,中括号里要么是空,要么是"*",而尖括号里可以是空,"*"和"m"。这表示前者对应的项要么不要,要么编译到内核里;后者则多一样选择,可以编译成模块。而圆括号的内容是要你在所提供的几个选项中选择一项。
附内核配置选项说明(这是我在网上找到的,还可以,有些也是不一样的,给你一个参考)
代码成熟度选项:
code maturity level options --->
[*] prompt for development and/or incomplete code/drivers
[*] select only drivers expected to compile cleanly
打开使用开发中、不完全的代码/驱动会让内核配置多出很多选项,由于我们需要使用一些正在开发中的功能,因此必需打开这一选项。
通用设置选项,
general setup --->
() local version - append to kernel release
这里填入的是64字符以内的字符串,你在这里填上的字符口串可以用uname -a命令看到。
[*] support for paging of anonymous memory (swap)
这是使用交换分区或者交换文件来做为虚拟内存的,当然要选上了。
[*] system v ipc
表示系统5的inter process communication,它用于处理器在程序之间同步和交换信息,如果不选这项,很多程序运行不起来
[*] posix message queues
这是posix的消息队列,它同样是一种ipc。建议你最好将它选上
[*] bsd process accounting
这是充许用户进程访问内核将账户信息写入文件中的。这通常被认为是个好主意,建议你最好将它选上。
[*] bsd process accounting version 3 file format
[*] sysctl support
这个选项能不重新编译内核修改内核的某些参数和变量,如果你也选择了支持/proc,将能从/proc/sys存取可以影响内核的参数或变量。建议你最好将它选上
[ ] auditing support
审记支持,用于和内核的某些子模块同时工作,例如selinux。只有选择此项及它的子项,才能调用有关审记的系统调用
(15) kernel log buffer size (16 => 64kb, 17 => 128kb)
内核日志缓存的大小,12 => 4 kb,13 => 8 kb,14 => 16 kb单处理器,15 => 32 kb多处理器,16 => 64 kb for x86 numaq or ia-64,17 => 128 kb for s/390
[*] support for hot-pluggable devices
是否支持热插拔的选项,肯定要选上
[*] kernel userspace events
内核中分为系统区和用户区,这里系统区和用户区进行通讯的一种方式,选上。
[*] kernel .config support
将.config配置信息保存在内核中,选上它及它的子项使得其它用户能从/proc中得到内核的配置
[*] enable access to .config through /proc/config.gz
[ ] configure standard kernel features (for small systems) --->
这是为了编译某些特殊的内核使用的,通常你可以不选择这一选项,你也不用对它下面的子项操心了。
--- configure standard kernel features (for small systems)
[ ] load all symbols for debugging/kksymoops
是否装载所有的调试符号表信息,如果你不需要对内核调试,不需要选择此项。
[*] enable futex support
不选这个内核不一定能正确的运行使用glibc的程序,当然要选上
[*] enable eventpoll support
不选这个内核将不支持事件轮循的系统调用,最好选上
[*] optimize for size
这个选项使gcc使用-os的参数而不是-o2的参数来优化编译,以获得更小尺寸的内核,建议选上。
[*] use full shmem filesystem
除非你在很少的内存且不使用交换内存时,才不要选择这项
(0) function alignment
(0) label alignment
(0) loop alignment
(0) jump alignment
可加载模块:
loadable module support --->
[*] enable loadable module support
[*] module unloading
不选这个功能,加载的模块就不能卸载
[ ] forced module unloading
[ ] module versioning support (experimental)
[ ] source checksum for all modules
[*] automatic kernel module loading
处理器类型及特性:
processor type and features --->
subarchitecture type (pc-compatible) --->
processor family (pentium-4/celeron(p4-based)/pentium-4 m/xeon) --->
[ ] generic x86 support
这一选项针对x86系列的cpu使用更多的常规优化。如果你在上面一项选的是i386、i586之类的才选这个
[*] hpet timer support
hpet是替代8254芯片的下一代时钟处理器。这里你可以安全的选上这一选项。如果硬件不支持的话,将仍使用8254时钟处理器
[*] symmetric multi-processing support
对称多处理器支持,在单cpu的机器上,不选这个选项会更快一些。由于超线程技术,看起来是两颗cpu,因些要选上这个选项
(1) maximum number of cpus (2-255) 支持的最大cpu数
[ ] smt (hyperthreading) scheduler support
[*] preemptible kernel
这个选项能使应用程序即使内核在高负载时也很可靠,建议最好选上
[*] machine check exception
这个选项能让cpu检测到系统故障时通知内核,一般我用组装的台式机会选这项。
< > toshiba laptop support
< > dell laptop support
< > /dev/cpu/microcode - intel ia32 cpu microcode support
< > /dev/cpu/*/msr - model-specific register support
< > /dev/cpu/*/cpuid - cpu information support
firmware drivers --->
< > bios enhanced disk drive calls determine boot disk (experimental)
high memory support (4gb) --->
[ ] allocate 3rd-level pagetables from highmem
[ ] math emulation
[*] mtrr (memory type range register) support
[ ] boot from efi support (experimental)
[*] enable kernel irq balancing
[ ] use register arguments (experimental)
电源管理:
power management options (acpi, apm) --->
[*] power management support
[ ] power management debug support
[ ] software suspend (experimental)
acpi (advanced configuration and power interface) support --->
apm (advanced power management) bios support --->
cpu frequency scaling --->
acpi (advanced configuration and power interface) support --->
[*] acpi support
这是一种电源管理方式,你可以看看你的bios是否支持。如果支持的话建议你选上这项
[ ] sleep states (experimental)
< > ac adapter
< > battery
<*> button 捕获power、sleep、lid(我也不知道这是什么按钮)等按钮是否按下,并做相应的动作
<*> video 集成在板上的显卡的acpi支持,对有些板卡可能不起作用
< > fan
<*> processor
<*> thermal zone
< > asus/medion laptop extras
< > ibm thinkpad laptop extras
< > toshiba laptop extras
(0) disable acpi for systems before jan 1st this year
[ ] debug statements
[*] power management timer support
apm (advanced power management) bios support --->
< > apm (advanced power management) bios support
高级电源管理的支持,一般来说笔记本应该选上,台式机可以不选。
[ ] ignore user suspend
[*] enable pm at boot time
[ ] make cpu idle calls when idle
[ ] enable console blanking using apm
[ ] rtc stores time in gmt 按unix的标准,硬件的时钟应该设为格林威治时间
[ ] allow interrupts during apm bios calls
[*] use real mode apm bios call to power off
[*] cpu frequency scaling
这一选项允许改变cpu的主频,使cpu在低负荷或使用电池时降低主频,达到省电的目的。
[ ] enable cpufreq debugging
< > /proc/cpufreq interface (deprecated)
default cpufreq governor (performance) --->
--- 'performance' governor
<*> 'powersave' governor
<*> 'userspace' governor for userspace frequency scaling
[ ] /proc/sys/cpu/ interface (2.4. / old)
<*> 'ondemand' cpufreq policy governor自动调节主频
<*> cpu frequency table helpers 多数的cpu需要这一项来调节主频
<*> acpi processor p-states driver 报告处理器的状态
< > amd mobile k6-2/k6-3 powernow!
< > amd mobile athlon/duron powernow!
< > amd opteron/athlon64 powernow!
< > cyrix mediagx/natsemi geode suspend modulation
<*> intel enhanced speedstep intel的变频技术支持
[ ] use acpi tables to decode valid frequency/voltage pairs
--- built-in tables for banias cpus
< > intel speedstep on ich-m chipsets (ioport interface)
< > intel speedstep on 440bx/zx/mx chipsets (smi interface)
< > intel pentium 4 clock modulation
< > nvidia nforce2 fsb changing
< > transmeta longrun
< > via cyrix iii longhaul
--- shared options
[ ] /proc/acpi/processor/../performance interface (deprecated)
[ ] relaxed speedstep capability checks
总线类型:
[*] pci support
pci access mode (any) --->强列建议选any,系统将优先使用mmconfig,然后使用bios,最后使用direct检测pci设备。
[ ] message signaled interrupts (msi and msi-x)
[ ] legacy /proc/pci interface
[ ] pci device name database
[ ] isa support
[*] eisa support
[*] vesa local bus priming
[*] generic pci/eisa bridge
[*] eisa virtual root device
[ ] eisa device name database
[ ] mca support
< > natsemi scx200 support
pccard (pcmcia/cardbus) support --->
pci hotplug support --->
pccard (pcmcia/cardbus) support --->一般只有笔记本电脑上才会有pcmcia插槽,如果你是台式机的话,可以不选这一项,然后跳过这一部份。
pci hotplug support --->
< > support for pci hotplug (experimental)
一般来讲只有服务器上会有热插拔的设备,如果你使用的是台式机,你可以不选择此项并跳过这一部份。
可执行文件格式,
[*] kernel support for elf binaries
elf是开放平台下最常用的二进制文件,它支持不同的硬件平台
< > kernel support for a.out and ecoff binaries
<*> kernel support for misc binaries
此选项允许插入二进制的封装层到内核中,当使用java、.net、python、lisp等语言编写的程序时非常有用
硬件设备相当复杂,看得偶头晕,大家针对自己的设备慎重选择(手边最好准备一本汉英字典:)如果想使用adsl,记得网络部分除了tcp/ip协议还得把ppp部分编译进内核,想当初偶就是把这个给忘了,郁闷了许久。
文件系统,
<*> second extended fs support
[*] ext2 extended attributes
[*] ext2 posix access control lists
[*] ext2 security labels
<*> ext3 journalling file system support
[*] ext3 extended attributes
[*] ext3 posix access control lists
[*] ext3 security labels
[ ] jbd (ext3) debugging support
<*> reiserfs support
[ ] enable reiserfs debug mode
[ ] stats in /proc/fs/reiserfs
[*] reiserfs extended attributes
[*] reiserfs posix access control lists
[*] reiserfs security labels
jfs filesystem support
[*] jfs posix access control lists
[ ] jfs debugging
[ ] jfs statistics
xfs filesystem support
[*] realtime support (experimental)
[*] quota support
[*] security label support
[*] posix acl support
< > minix fs support
< > rom file system support
[*] quota support
< > old quota format support
quota format v2 support
[*] dnotify support
< > kernel automounter support
< > kernel automounter version 4 support (also supports v3)
cd-rom/dvd filesystems --->
dos/fat/nt filesystems --->
pseudo filesystems --->
miscellaneous filesystems --->
.network file systems --->
partition types --->
native language support --->
profiling support --->
kernel hacking --->
security options --->
cryptographic options --->
library routines --->
这个东东你要是搞不来就不要搞,默认的也可以的。先学习一下怎么样编译内核,等成功了,有了经验了在改也没有事的!
编译内核:
# cd /usr/src/linux
# make dep -----链接程序代码与函数库.
# make clean -----删除不必要的模块和文件.
# make bzimage -----开始编译系统内核.
# make modules -----开始编译外挂模块.
# make modules_install -----安装编译完成的模块.
要好常时间的,我洗了一件衣服,抽了n根白沙之后,总算完成了,好激动呀!
# su -
# /sbin/depmod -a -----创建模块的链接.
更换内核:
# cd /boot -----切换到引导分区/boot.
# rm system.map vmlinuz -----删除旧的符号链接.
# mv /usr/src/linux/system.map system.map
# mv /usr/src/linux/arch/i386/boot/bzimage vmlinuz
如果你用grub来管理开机,简单点就是你装了win还装了linux就要修改/boot/grub下的menu.1st文件:
# vi /boot/grub/menu.1st
键入i进入编辑模式:
# grub.conf generated by anaconda
#
# note that you do not have to rerun grub after making changes to this file
# notice: you do not have a /boot partition. this means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,1)
# kernel /boot/vmlinuz-version ro root=/dev/hda2
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
title fedora core(2.6.11)
root (hd0,1)
kernel /boot/vmlinuz ro root=/dev/hda2 ---你的linux所在的分区
title dos
rootnoverify (hd0,0)
chainloader +1
title fedora core(2.4.22)
root (hd0,1)
kernel /boot/vmlinuz-2.4.22-1.2115.nptl ro root=label=/ hdd=ide-scsi rhgb
initrd /boot/initrd-2.4.22-1.2115.nptl.img
这样还可以保留旧版本的内核以防编译新内核失败进不了系统
重启电脑,好了,进去了。网上说新内核速度好快的,我怎么感觉快不了多少呢。无所谓了,反正是成功了。呵呵,我可是失败了很多次才成功的。好高兴,2点了,穿衣服去吃东西了。
rpm没法用了,怎么办?
在/usr/lib/rpm/macros里面寻找代码:
%__dbi_cdb create cdb mpool mp_mmapsize=16mb mp_size=1mb
修改成代码:
%__dbi_cdb create cdb mpool mp_mmapsize=16mb mp_size=1mb private
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器