linux内核升级:Linux 2.4->2.6内核升级指南来源: 发布时间:星期四, 2008年12月4日 浏览:45次 评论:0
前言: -2.6.x内核发布后, 坛子里
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ps, you are welcome to fix me. 1. 备份重要 ![]() 这是个好习惯,就不用多说了:-) 2. 最新 ![]() 这个当然要到官方网站WebSitewww.kernel.org或者它 ![]() ![]() ![]() ![]() ![]() 在/usr/src/目录下解开源码包, 得到源代码目录/usr/src/linux-2.***/. 在对kernel做任何事情的前, 建议你先看 ![]() ![]() ![]() ![]() ![]() 在文档Documentation/Changes中给出了欲成功地升级到kernel-2.6.x所需 ![]() ![]() o Gnu C 2.95.3 # gcc --version o Gnu make 3.79.1 # make --version o binutils 2.12 # ld -v o util-linux 2.10o # fdformat --version o module-init-tools 0.9.10 # depmod -V o e2fsprogs 1.29 # tune2fs o jfsutils 1.1.3 # fsck.jfs -V o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs o xfsprogs 2.6.0 # xfs_db -V o pcmcia-cs 3.1.21 # cardmgr -V o quota-tools 3.09 # quota -V o PPP 2.4.0 # pppd --version o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version o nfs-utils 1.0.5 # showmount --version o procps 3.2.0 # ps --version o oprofile 0.5.3 # oprofiled --version 对于RH8/9 ![]() ![]() ![]() 3. 安装module-init-tools-3.0.tar.gz工具包 linux-2.6.x内核 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() o Rusty's Linux Kernel Page: http://www.kernel.org/pub/linux/ker...ools-3.0.tar.gz o http://www.kernel.org/pub/linux/uti...ools-3.0.tar.gz 接下来, 按照下列步骤安装module-init-tools工具包: # configure --prefix=/ # make moveold # make all ![]() # ./generate-modprobe.conf /etc/modprobe.conf 命令"make moveold"将把系统原来 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 新 ![]() ![]() ![]() ![]() ![]() ![]() 4. 更新mkinitrd ![]() 可以到站点http://people.redhat.com/arjanv/2.6...1-2.i386.rpm包. 由于mkinitrd ![]() 5. 配置,编译和安装linux-2.6.x内核 新内核在Makefile方面 ![]() ![]() ![]() ![]() ![]() 有关新内核 ![]() o 有关"Loadable Module support"选项, ![]() o 有关"Processor type and features"选项, ![]() ![]() ![]() o 有关"Block Devices" ![]() ![]() ![]() o 有关"Multi-device support(RAID and LVM)", 要选上"device mapper". o 有关"Input device support", 记得要选上"Keyboards"和"Mice" ![]() o 有关"Graphics support", 要选上对frame buffer ![]() o 有关ALSA, 要选上"OSS API emulation"选项. OSS可以不用了. o 有关USB, 能选 ![]() o 有关文件系统, 选上常用 ![]() ![]() ![]() 配制好内核后, 就可以直接编译了, "make dep"这 ![]() # make bzImage # make modules # make modules_ ![]() # make ![]() 上面 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() title Red Hat Linux (2.***) root(hd0, 1) kernel /boot/vmlinuz-2.*** ro root=LABEL=/ initrd /boot/initrd-2.***.img 不幸 ![]() ![]() ![]() 到这里, 你已经可以重启机器, 用kernel-2.***启动了. 当然, 多半你不会成功, 不是没鼠标就是没键盘:-) 6. 支持Hotplug 当然, 首先要在内核配置时配置了HOTPLUG ![]() ![]() # # ----- KERNEL 2.6.x support ------ # This is for compatibility between kernel-2.4.x and kernel-2.6.x # UNAME=`uname -r` KERNELVER=${UNAME:0:3} ![]() # # This is kernel-2.6.x # KSYMS=/proc/kallsyms ![]() # # This is kernel-2.4.x # KSYMS=/proc/ksyms fi 然后, 把rc.sysinit文件中所有出现/proc/ksyms ![]() ![]() ![]() 7. 体验sysfs 首先, 创建目录/sys: # mkdir /sys 然后, 按照下列步骤修改启动脚本/etc/rc.sysinit文件: o 找到行: mount -f /proc", 在下面增加: ![]() mount -f /sys fi o 找到行: action $"Mounting proc filesystem: " mount -n -t proc /proc /proc, 在其下面增加这样 ![]() # # Mount /sys for kernel-2.6.x # ![]() action $"Mounting sysfs filesystem: " mount -n -t sysfs /sys /sys fi 接下来, 在/etc/fstab文件中, 加入这样 ![]() none /sys sysfs defaults 0 0 最后, 修改/etc/init.d/halt脚本中 ![]() ![]() ![]() 将: awk '$2 ~ /^\/$|^\/proc|^\/dev/{next} 改为: awk '$2 ~ /^\/$|^\/proc|^\/sys|^\/dev/{next} 8. 支持USB设备 linux-2.6.x ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 然而不幸 ![]() ![]() ![]() alias usb-controller usb-ohci alias usb-controller1 ehci-hcd 因此, 要把它改为: alias usb-controller ohci-hcd alias usb-controller1 ehci-hcd 如果不做这样 ![]() ![]() ![]() ![]() 支持USB键盘 ![]() ![]() ![]() ![]() ![]() # # ----- KERNEL 2.6.x support ------ # This is for compatibility between kernel-2.4.x and kernel-2.6.x # UNAME=`uname -r` KERNELVER=${UNAME:0:3} ![]() # # This is kernel-2.6.x # KSYMS=/proc/kallsyms KEYBDEV_NAME=usbkbd MOUSEDEV_NAME=usbmouse ![]() # # This is kernel-2.4.x # KSYMS=/proc/ksyms KEYBDEV_NAME=keybdev MOUSEDEV_NAME=mousedev fi 然后, 把/etc/rc.sysinit脚本文件中出现keybdev和mousedev ![]() ![]() needusbstorage= ![]() needusbstorage=`LC_ALL=C grep -e "^I.*Cls=08" /proc/bus/usb/devices 2>/dev/null` LC_ALL=C grep 'hid' /proc/bus/usb/drivers || action $"Initializing USB HID ![]() action $"Initializing USB keyboard: " modprobe $KEYBDEV_NAME 2> /dev/null action $"Initializing USB mouse: " modprobe $MOUSEDEV_NAME 2> /dev/null fi 改为: needusbstorage= ![]() ![]() needusbstorage=`LC_ALL=C grep -e "^I.*Cls=08" /sys/bus/usb/devices 2>/dev/null` LC_ALL=C grep 'hid' /sys/bus/usb/drivers || action $"Initializing USB HID ![]() ![]() needusbstorage=`LC_ALL=C grep -e "^I.*Cls=08" /proc/bus/usb/devices 2>/dev/null` LC_ALL=C grep 'hid' /proc/bus/usb/drivers || action $"Initializing USB HID ![]() fi action $"Initializing USB keyboard: " modprobe $KEYBDEV_NAME 2> /dev/null action $"Initializing USB mouse: " modprobe $MOUSEDEV_NAME 2> /dev/null fi 好了, 到此为止, 我们应该可以重新启动机器了, 赶快去体验最新 ![]() 9. 其它 o 有关在linux-2.6.x系统上不能正常使用RPM命令 ![]() o 有关声卡 ![]() o 有关在linux-2.6.x系统上运行vmware ![]() 10. 参考文档 [1] Kernel 2.6.x, the ![]() [2] Upgrading RH9 to 2.6.0-test4: http://www.fearthecow.net/index.pl?...amp;page=kernel [3] HowTo Upgrade To The 2.6 Kernel: http://kerneltrap.org/node/view/799 [4] Building Linux Kernel 2.6 on Red Hat 8: http://www.sabalsoftware.com/articl...26OnRedhat8.php [5] Migrating to Linux kernel 2.6 on recent Redhat systems: http://linux-sxs.org/upgrading/migration26.html [6] Migrating to Linux Kernel 2.6: http://thomer.com/linux/migrate-to-2.6.html 0
相关文章
读者评论发表评论 |