在Linux内核2.6之前linux c,内核中有可以约束小型系统的限制升级linux内核版本升级linux内核版本,例如每条链256个设备。v2.6内核彻底地打破了这种限制,
不但可以支持更多类型的设备,并且支持更多同类型的设备。在Linux2.6系统中,可以支持4095种主要的设备类型,
每一个单独的类型可以有超过一百万个子设备。
文件系统大小
Linux内核2.6所容许的可轮询文件系统大小最大为16TB。
11.文件系统
ext2、ext3和ReiserFS等传统Linux文件系统得到了明显的改进。最值得注意的改进是扩充属性(或文件元数据)的引入。
最重要的是POSIXACL的实现,这是对普通UNIX权限的扩充,可以支持更细化的用户访问控制。
12.不仅对传统Linux文件系统的改进支持以外linux虚拟主机,新的内核完全支持在Linux中相对较新的XFS文件系统。
Linux2.6内核如今还引入了对NTFS文件系统的改进的支持,如今容许以读/写模式安装NTFS文件系统。
升级开始!
为RH9升级Kernel(2.4.xx-2.6.xx),顺便加上iptablesIPP2P支持,
用于限制网路中P2P类软件下载.(一切操作是在root用户下,下载的软件放到/opt/soft/相关目录下)
L一.Preparation:
1.参考2.6.xx内核软件包文档(Documentation/Changes)中的软件升级需求升级了ps工具程序到最新版本(是到下载对应redaht或则fedora的procps-3.2.5-1.src.rpm,之后运行rpmbuild
--rebuildprocps-3.2.5-1.src.rpm,安装编译好的RPM包即可)
安装module-init-tools-3.0.tar.bz2:()
tar-zxvfmodule-init-tools-3.0.tar.gz
cdmodule-init-tools-3.0
./configure--prefix=/
makemoveold
make
makeinstall
./generate-modprobe.conf/etc/modprobe.conf
命令"makemoveold"将把系统原先的modutils工具程序更名为"*.old"(例如,lsmod.old等等).
NOTE!这是十分重要的一步,千万不要省略.这将促使你可以继续使用原有的linux-2.4.x系统,
由于在2.4.x系统下,新的module-init-tools工具包实际上是仰赖原先"*.old"程序来加载内核模块.
假如忘掉了这一步也不要紧张,可以先下载并安装原先的modutils程序包,之后根据前面的步骤重来一遍就可以了.
新的module-init-tools工具包不再使用原先的/etc/modules.conf配置文件了,
而是使用新的配置文件/etc/modprobe.conf.因而必需用命令"./generate-modprobe.conf
/etc/modprobe.conf"来世成新的配置文件/etc/modprobe.conf.
假如你使用devfs系统你还须要复制modprobe.devfs到/etc目录下。
2.安装modutils-2.4.26-16.i386.rpm:()
rpm-iUvhmodutils-2.4.26-16.i386.rpm
3.下载新的mkinitrd/lvm2软件包
下载mkinitrd和lvm2最新版本并安装.
rpm-iUvhmkinitrd-xxx.rpmlvm2-xxxx.rpm--nodeps
否则在makeinstall时侯会提示以下错误:
Nomodulemptbasefoundforkernel2.6.10,aborting.
mkinitrdfailed
make[1]:***[install]Error1
make:***[install]Error
4.下载最新的内核()
linux-2.6.10.tar.bz2或则linux-2.6.10.tar.bz2(最好将内核拷到/usr/src,这样解压便捷一点)
解压:
cd/usr/src
tar-xjpvflinux-2.6.10.tar.bz2或则
tar-xzpvflinux-2.6.10.tar.gz
5.Pathciptables
到下载最新的iptables和patch-o-matic-ng软件包.
须要注意的是:
1)先卸载了系统原本的iptables软件包
rpm-qa|grepiptables
rpm-e--nodepsiptables-devel
rpm-e--nodepsiptables
2)解压软件包
tar-xjpvfiptables-1.3.0.tar.bz2
tar-xjpvfpatch-o-matic-ng-20050225.tar.bz2
cdpatch-o-matic-ng-20050225
./runmeextra
输入内核源代码的路径/usr/src/linux-2.6.10
输入iptables源代码的路径/opt/soft/iptables/iptables-1.3.0
之后按你自己的须要把iptables的扩充补丁打到内核(要实现封t一定要选上ipp2p这扩充)
在以下配置内核部份,须要:
把networkingsupport-->networkingoptions-->networkingpacket
filtering-->IP:netfilterconfigruation-->ipp2pmatch选上
二.KernelConfiguration
1.内核配置很费事,选项太多了,最好用默认的.在linux-2.6.10/arch下有好多关于各类机子的配置:
alphacrisia64m6868knommuppcshsparc64x86_64
armh8300m32rmipsppc64sh64um
arm26i386m68kpariscs390sparcv850
找到你的机子对应的目录,上面会有一个defconfig文件,就是对应机子的默认配置,很不错,假如你的配置跟我的一样的话,几乎不许要改哪些地方.
配置可以使用makemenuconfig,makexconfig,make
gconfig这三个命令中的任何一个,第一个图形界面和控制台下都能用,后两个只能在图形界面下使用,我喜欢在字符界面下工作,所以用make
menucofig
cd/usr/src/linux-2.6.10
cparch/i386/defconfig./.config
makemenuconfig或则makexconfig,makegconfig
三.CompileKernel
这一步没哪些好说的,不须要你做哪些
make
makemodules
makemodules_install
makeinstall
假如你想偷懒的话可以用:
make&&makemodules&&makemodules_install&&makeinstall
之后就可以去喝杯奶茶,休息一下哪些的.假如你想让它编译完连机子都关了的话,用下边这条命令
make&&makemodules&&makemodules_install&&makeinstall
&&poweroff
四.Problems
1.不认识root=LABEL/的问题:
假如重新启动新内核未能步入出现root=LABEL/不能辨识,用原先的内核启动系统,编辑/boot/grub/grub.conf
vi/boot/grub/grub.conf
找到:
titleRedHatLinux(2.6.10)
root(hd0,3)
kernel/boot/vmlinuz-2.6.10roroot=LABEL=/
initrd/boot/initrd-2.6.10.img
去除root=LABEL=/
titleRedHatLinux(2.6.10)
root(hd0,3)
kernel/boot/vmlinuz-2.6.10ro
initrd/boot/initrd-2.6.10.img
重启.
2.Hotplug问题(源自snoopyxp大婶的>)
其实,首先要在内核配置时配置了HOTPLUG的支持.之后,
因为/proc/ksyms更名为/proc/kallsyms,所以必需更改启动脚本/etc/rc.sysinit.
为了兼容原有的linux-2.4.x系统,可以加上下边几行:
#-----KERNEL2.6.xsupport------
#Thisisforcompatibilitybetweenkernel-2.4.xand
kernel-2.6.x
UNAME=`uname-r`
KERNELVER=$
if["$KERNELVER"="2.6"];then
#Thisiskernel-2.6.x
KSYMS=/proc/kallsyms
else
#Thisiskernel-2.4.x
KSYMS=/proc/ksyms
fi
之后,把rc.sysinit文件中所有出现/proc/ksyms的地方都换成"$KSYMS"变量引用.配置好后,
还必需下载hotplug的用户态辅助工具包:
4_03_11.tar.gz.解开这个包之后,直接"makeinstall"就可以了.
它将形成/etc/hotplug/配置目录.
3.USB问题
USB问题主要是由于2.6内核中的那些模块早已更名了
USB-2.0的host控制器的内核模块名子依然是ehci-hcd
USB-1.1的host控制器的内核模块名子早已从usb-ohci改为ochi-hcd
通用USBhost控制器的内核模块名子早已从usb-uhci该为uhci-hcd.
USB鼠标的模块名子从keybdev变为usbkbd
支持USB键盘的模块名子也从mousedev改为usbmouse
因而,我们必需更改启动脚本/etc/rc.sysinit文件.同时必须兼容原有的2.4.x系统:
首先更改/etc/modprobe.conf
找到:
aliasusb-controllerusb-ohci
aliasusb-controller1ehci-hcd
把它改为:
aliasusb-controllerohci-hcd
aliasusb-controller1ehci-hcd
更改/etc/rc.sysinit
2.6内核默认将HID编进内核,这样将不会生成hid,usbmouse,和usbkbd模块,也不会有USBMOUSE,USBKEYBOARD选项
DeviceDrivers--->
USBsupport--->
USBHumanInterfaceDevice(fullHID)support
[*]HIDlayerinoutsupport
[]/dev/hiddevrawHIDdevicesupport
#///////////////////////////////////////////////////////////////////
#MOdifybyJune.Hn.
#2.6内核中找不到usbdevfs
#odl:
#if[$usb=1-a!-f/proc/bus/usb/devices];then
#action$"MountingUSBfilesystem:"mount-tusbdevfs
usbdevfs/proc/bus/usb
#fi
if["$KERNELVER"="2.4"];then
if[$usb=1-a!-f/proc/bus/usb/devices];then
action$"MountingUSBfilesystem:"mount-tusbdevfsusbdevfs
/proc/bus/usb
fi
fi
#end
#///////////////////////////////////////////////////////////////
needusbstorage=
if[$usb="1"];then
#//////////////////////////////////////////////////////////////
#AddbyJune.Hn.
if["$KERNELVER"="2.6"];then
needusbstorage=`LC_ALL=Cgrep-e"^I.*Cls=08"
/sys/bus/usb/devices2>/dev/null`
#LC_ALL=Cgrep'hid'/sys/bus/usb/drivers||action
$"InitializingUSBHIDinterface:"modprobeusbhid2>
/dev/null
else
#end
#///////////////////////////////////////////////////////////////
needusbstorage=`LC_ALL=Cgrep-e"^I.*Cls=08"
/proc/bus/usb/devices2>/dev/null`
LC_ALL=Cgrep'hid'/proc/bus/usb/drivers||action
$"InitializingUSBHIDinterface:"modprobehid2>/dev/null
fi
#//////////////////////////////////////////////////////////
#ModifybyJune.Hn.
#2.6内核中被编进内核,不须要加载
#old:
#action$"InitializingUSBkeyboard:"modprobekeybdev2>
/dev/null
#action$"InitializingUSBmouse:"modprobemousedev2>
/dev/null
#new:
if["$KERNELVER"="2.4"];then
action$"InitializingUSBkeyboard:"modprobekeybdev2>
/dev/null
action$"InitializingUSBmouse:"modprobemousedev2>
/dev/null
fi
#end
#/////////////////////////////////////////////////////////////////
fi
假如把USBHumanInterfaceDevice(full
HID)support编译成模块,有USBMOUSE,USBKEYBOARD选项
DeviceDrivers--->
USBsupport--->
USBHumanInterfaceDevice(fullHID)support
[*]HIDlayerinoutsupport
[]/dev/hiddevrawHIDdevicesupport
USBHIDBootProtocoldrivers--->
[*]USBHIDBPKeyboard(simpleBoot)support
[*]USBHIDBPMouse(simpleBoot)support
假如你要把它作为模块,请参考snoopyxp大婶的>中的这一段
#-----KERNEL2.6.xsupport------
#Thisisforcompatibilitybetweenkernel-2.4.xand
kernel-2.6.x
UNAME=`uname-r`
KERNELVER=$
if["$KERNELVER"="2.6"];then
#Thisiskernel-2.6.x
KSYMS=/proc/kallsyms
KEYBDEV_NAME=usbkbd
MOUSEDEV_NAME=usbmouse
else
#Thisiskernel-2.4.x
KSYMS=/proc/ksyms
KEYBDEV_NAME=keybdev
MOUSEDEV_NAME=mousedev
fi
之后,
把/etc/rc.sysinit脚本文件中出现keybdev和mousedev的地方都改为$KEYBDEV_NAME和$MOUSEDEV_NAME.
把脚本文件/etc/rc.sysinit中的needusbstorage部份从:
needusbstorage=
if[$usb="1"];then
needusbstorage=`LC_ALL=Cgrep-e"^I.*Cls=08"
/proc/bus/usb/devices2>/dev/null`
LC_ALL=Cgrep'hid'/proc/bus/usb/drivers||action
$"InitializingUSBHIDinterface:"modprobehid2>/dev/null
action$"InitializingUSBkeyboard:"modprobe$KEYBDEV_NAME
2>/dev/null
action$"InitializingUSBmouse:"modprobe$MOUSEDEV_NAME2>
/dev/null
fi
改为:
needusbstorage=
if[$usb="1"];then
if["$KERNELVER"="2.6"];then
needusbstorage=`LC_ALL=Cgrep-e"^I.*Cls=08"
/sys/bus/usb/devices2>/dev/null`
LC_ALL=Cgrep'hid'/sys/bus/usb/drivers||action
$"InitializingUSBHIDinterface:"modprobeusbhid2>
/dev/null
else
needusbstorage=`LC_ALL=Cgrep-e"^I.*Cls=08"
/proc/bus/usb/devices2>/dev/null`
LC_ALL=Cgrep'hid'/proc/bus/usb/drivers||action
$"InitializingUSBHIDinterface:"modprobehid2>/dev/null
fi
action$"InitializingUSBkeyboard:"modprobe$KEYBDEV_NAME
2>/dev/null
action$"InitializingUSBmouse:"modprobe$MOUSEDEV_NAME2>
/dev/null
fi