LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1019|回复: 6

推荐:升级内核到2.6系列

[复制链接]
发表于 2003-12-24 06:41:33 | 显示全部楼层 |阅读模式
Guideline for migrating from the 2.4.x to the 2.6.x kernel

http://www.linuxfromscratch.org/ ... l-2_6-migration.txt

AUTHOR:                Kris van Rens
                        kvrprogs AT edsko DOT com

DATE:                2003-12-20

LICENSE:        GPL

SYNOPSIS:        Guideline for migrating from the 2.4.x to the 2.6.x kernel

DESCRIPTION:

After a series of 11 test versions, the stable release of the linux-2.6 kernel
came out (linux-2.6.0), one day before I wrote this hint. I was working with
the 2.6.0test kernel a few months already for school (for the curious among
you; I learn how to design kernel driver modules). I noticed a few people on
the mailinglist having trouble installing the kernel, that's what made me write
this hint.

So, if you're one of the people wanting to try out the new 2.6.0 kernel, you
should probably take a look at this hint for a few tips to bring it to a
successful end. Of course the new kernel does not have to better for you, you
might have some trouble with NVIDIA-drivers or winmodems. You can always fall
back to the 2.4 kernel and wait a while before you'll try it again.


PREREQUISITES:

Before working through this hint, be sure to have the following:

*** module-init-tools sources tarball
Get this from http://www.kernel.org/pub/linux/kernel/people/rusty/modules.

*** linux-2.6.x kernel sources tarball
Get these from http://www.kernel.org or a mirror.

At the time of writing the version of the module-init-tools is 0.9.15-pre4 and
for the kernel it is 2.6.0, I'll use these version names for this hint, if you
have a newer version, replace the version in this hint with it.

Of course, you should also have Make, GCC and an Assembler, but this hint is
meant for the LFS-community so I'll assume you fulfill these requirements.


HINT:

So, you want to migrate from linux-2.4.x to linux-2.6.x? Well no problem!
Quite a lot changed since 2.4, both the SMP (Symmetric MultiProcessing,
multiple processor cores) and the uniprocessor power increased, compatibility
with hardware is better and new security-modules increase the security (!).

As being the owner of a LFS system, I'll assume you're familiar with the usual
way of installing a source package, and a kernel of course.

I cut this hint section in two; installing the new module-init-tools and
installing the kernel.

*note: If you have a Nvidia graphics card; or you want to use a winmodem or
        you want to be sure that you don't have to undertake special steps, take a
        look at the EXCEPTIONS area. It's always a good idea to take a look there.

***STEP 1: Obtaining and installing the new module-init-tools

To migrate from kernel 2.4 to 2.6 you'll need a new module loading system, the
system has been worked over completely.

As you like, move the tarball into the directory from where you'll install it,
for me that's /usr/src, and cd' into it.

Unpack the sources and sources and cd' into the source's directory.

tar xzf module-init-tools-0.9.15-pre4.tar.gz
cd module-init-tools-0.9.15-pre4

Then configure the package by:

./configure --prefix=/

We use prefix=/ here because in the LFS-Book the modutils are installed with
the same prefix and the last thing we want is having two different versions of
one program in multiple places.

If this is the first time you install the new module-init-tools, invoke the
next command, otherwise, if you're upgrading to a new version of
module-init-tools, skip it (LFS versions up to LFS-5.0 come with modutils and
do not have module-init-tools, so you'll have to invoke the command).

make moveold

This makes the modultils such as insmod,rmmod or modprobe to be renamed
to insmod.old, rmmod.old and modprobe.old. The new to be installed
module-init-tools do a runtime check which kernel is running and invoke the
right version of the tools, for example if 2.4.x is running the insmod command
will use insmod.old instead.

Then make the package and install it with:

make
make install

The last thing you'll have to do is to generate a new configurationfile for the
modules:

./generate-modprobe.conf /etc/modprobe.conf

If you're using the device-filesystem also copy the modprobe.devfs into /etc.

If everything went fine, you have the new module-init-tools and you're ready to
install the new kernel!

***STEP 2: Installing the 2.6.x kernel

Copy the linux-2.6.0 tarball to /usr/src and cd' into this directory.

As usual, unpack the sources and cd' into the sources directory:

tar xjf linux-2.6.0.tar.bz2
cd linux-2.6.0

Now configure the kernel, this is just like with the 2.4 kernel, you can choose
from menuconfig and xconfig. Menuconfig is based on Ncurses and xconfig is
based on QT. Do so by:

make menuconfig

or

make xconfig

Now comes the most time-spending and difficult part, the configuration itself.
As far as I know, you cannot use the kernel-2.4 configuration file. So you'll
have to do it all from the start, which is better anyway, because a lot changed
in the structure of the menu and there are loads of new options in it.

Be sure to take the right systemarchitecture in >>processor-type and features<<
and the right filesystem. If you don't know whether you should involve a
certain option or not, press ? or help; there's info about almost every option.
If you still don't know, search or ask the community.

If you're done, you are set to compile the kernel with:

make all

This can take quite a while, on my Pentium 4 2.0GHz with 256MB RAM, it took
about 15 minutes, which is not strange because the kernel code is around 5
million lines of code! You can time your build with >>time make all<< instead.

Then install the modules with:

make modules_install

Now copy the kernel to /boot:

cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.0

Or to another filename as you want.

Now modify your lilo.conf (for lilo) of menu.lst (for grub) to be able to load
the new kernel, if you have lilo, don't forget to invoke /sbin/lilo and re-
write the boot-record.

If everything went right, you can reboot and start with the new kernel.

If there are errors during the booting, read the error-output carefully and
eventually reconfigure the kernel. Otherwise if your screen is black, it has
probably something to do with the framebuffer device, also reconfigure the
kernel and try again. Or try vga=normal in your bootloader configuration, and
check if 'CONFIG_VT' is set to 'y' in your .config file.

You should look at the EXCEPTIONS field, you might have to do some additional
work to get your kernel work properly.

If the problem is really stubborn and you can't get it away, read the
mailinglist archives or ask a new question there.

Otherwise, congratulations with you're shiny new 2.6 kernel!


EXCEPTIONS:

***Nvidia drivers for the 2.6 kernel:

If you have a Nvidia graphics card, you'll have to make the drivers for it
separately, the standard kernel does not support them (well). Take a look at:

http://www.minion.de

Here you will find the (widely tested) patches for the Nvidia drivers, and some
help to install them.

***WinModem drivers for the 2.6 kernel:

Lucent Technologies provides a driver for WinModems, you can get it here:

http://linmodems.technion.ac.il/ ... -2.6-alk-v00.tar.gz

Or (not tested):

http://www.cs.cmu.edu/~rajesh/ltmodem-2.6.tar.bz2


OTHER DOCUMENTS ABOUT THIS SUBJECT:

The post-halloween document from Dave Jones:
http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt

The German translation of it:
http://www.kubieziel.de/computer/halloween-german.html


ACKNOWLEDGEMENTS:

Professor Dr. Juergen Quade from the Niederrein University for printing me
        out the preleminary version of the 'Meister-Installateur' article for
        the Linux Magazin.


CHANGELOG:

        [2003-12-19]
                First version 1.0
        [2003-12-20]
                Version 1.1
                *Changed DATE format to intl.
                *Structural fixes + some typos
                *Added the EXCEPTIONS field; thanks Alexander!
发表于 2003-12-24 08:57:43 | 显示全部楼层
lfs...5.0可能也要用2.6吧。。。。
发表于 2003-12-24 10:28:34 | 显示全部楼层
个人经验:

解压后,先make mrproper
然后按照需要,看看make help,我是用那个默认选项,把基本的东西都选择好了,然后自己再添加如XFS之类特殊的东西,方便,也快。
 楼主| 发表于 2003-12-24 12:05:41 | 显示全部楼层
这篇hint里提到的
http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
很全面,只是内容太多,全部读好像有点麻烦,查查就行了。
发表于 2003-12-24 12:18:21 | 显示全部楼层
tram兄,下次贴地址前,自己先看看嘛。。这个地址因为太多人点击,整个site down掉了。。。嘿嘿。。。。
 楼主| 发表于 2003-12-24 12:19:23 | 显示全部楼层
我是前两天看的,还好的啊!这也行,呵呵,看来2.6太热了。
发表于 2003-12-24 12:22:55 | 显示全部楼层
我也是前2天看的,那个时候已经down了,,看来是这几天的事情。。没眼福啊。。。嘿嘿。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表