2007年2月15日星期四

Ubuntu 6.10下编译内核

1、准备工作

替换/bin/sh
在Ubuntu 6.10中, /bin/sh其实是/bin/dash的一个链接.但/bin/dash好像会有问题。所以就把它换了.

rm -f /bin/sh
ln -s /bin/bash /bin/sh


2、安装编译内核要用的包

apt-get update
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2


3、下载内核源代码
可以到www.kernel.org下载:

cd /usr/src
wget
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.1.tar.bz2

解开:

tar xjf linux-2.6.18.1.tar.bz2
ln -s linux-2.6.18.1 linux
cd /usr/src/linux


4、打补丁
假定已经下载了补丁文件是 patch.bz2 到 /usr/src. :

bzip2 -dc /usr/src/patch.bz2 | patch -p1 --dry-run
bzip2 -dc /usr/src/patch.bz2 | patch -p1

第一个命令是测试用的。没什么问题的话现动真格的。

若想用试验中的内核,比如 2.6.19-rc4 ,可以这样:

cd /usr/src
wget
http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.19-rc4.bz2
cd /usr/src/linux
bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 --dry-run
bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1

5、配置内核参数
最好从一个你已经配置好的内核参数开始。如:

cp /boot/config-`uname -r` ./.config

然后运行

make menuconfig

配置好后,别忘记保存

6、编译内核
运行命令:

make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers

在 --append-to-version= 后,你可以写入任意字符串来标记你的内核,但要以送减号(-)开始且不能含空格.

现在耐心等待吧....


7、安装
编译完成后,你可以在 /usr/src 中发现 deb 文件,就是编译好的内核.

cd /usr/src
ls -l

如可能是这样的linux-image-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb (这是真正的内核) 和 linux-headers-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb (这是你以后编译内核要用的). 安装:

dpkg -i linux-image-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb

现在重启机器,就可以看到你的内核了

29 条评论:

匿名 说...

Greetings from California! I'm bored to death at work so I decided to check out your blog on my iphone during lunch break. I enjoy the information you provide here and can't wait to take a
look when I get home. I'm shocked at how fast your blog loaded on my mobile .. I'm not even using WIFI, just 3G .
. Anyways, very good blog!

My web site; capsiplex discount code

匿名 说...

This is really interesting, You're a very skilled blogger. I have joined your rss feed and look forward to seeking more of your excellent post. Also, I've shared your website in my
social networks!

Also visit my site enhancement pills male

匿名 说...

Hmm is anyone else having problems with the images on this
blog loading? I'm trying to figure out if its a problem on my end or if it's the
blog. Any responses would be greatly appreciated.

my web blog :: Oral hemorrhoid treatment

匿名 说...

Hi, I do think this is a great blog. I stumbledupon it ;
) I am going to revisit once again since I saved as a favorite it.
Money and freedom is the greatest way to change,
may you be rich and continue to help other people.

my web-site :: http://www.inlabeauty.com/

匿名 说...

I don't know whether it's just me or if everyone else encountering problems with your site.
It appears as though some of the text in your posts are running off the screen.
Can someone else please comment and let me know if this is happening to them as well?

This might be a problem with my web browser because I've had this happen previously. Many thanks

Feel free to surf to my web page :: Sexual health for women

匿名 说...

Do you mind if I quote a few of your articles as long as I provide credit and sources back to
your blog? My blog site is in the exact same area of interest as yours and my users
would certainly benefit from a lot of the information you present here.
Please let me know if this alright with you.
Thank you!

Here is my homepage ... buy alta white

匿名 说...

Having read this I believed it was extremely enlightening.
I appreciate you spending some time and energy to put this content
together. I once again find myself spending a lot of time both reading and posting comments.

But so what, it was still worthwhile!

Feel free to visit my web-site http://zhanpu.blogspot.com/

匿名 说...

You can certainly see your enthusiasm within the work you write.
The world hopes for more passionate writers like you
who are not afraid to say how they believe.
All the time go after your heart.

my homepage :: buy xtremeno

匿名 说...

continuously i used to read smaller articles or reviews which as well clear their motive,
and that is also happening with this post which I am reading here.


my site ... joint pain relief

匿名 说...

hey there and thank you for your info – I've certainly picked up anything new from right here. I did however expertise a few technical points using this website, as I experienced to reload the web site many times previous to I could get it to load properly. I had been wondering if your web host is OK? Not that I am complaining, but sluggish loading instances times will sometimes affect your placement in google and could damage your quality score if ads and marketing with Adwords. Anyway I'm adding this RSS to my e-mail and could look out for much more of your respective fascinating content.
Ensure that you update this again very soon.

my blog post - eazol review

匿名 说...

Hi there! This blog post couldn't be written any better! Reading through this post reminds me of my previous roommate! He continually kept talking about this. I most certainly will send this article to him. Pretty sure he's going to have a
great read. I appreciate you for sharing!

Feel free to visit my blog: fbclebanon.net

匿名 说...

This post is genuinely a good one it assists new web people,
who are wishing in favor of blogging.

My web-site athlete health

匿名 说...

I am not sure where you are getting your info, but good topic.
I needs to spend some time learning more or understanding more.
Thanks for fantastic info I was looking for this information for my
mission.

Also visit my blog post; my thyroid

匿名 说...

Today, while I was at work, my sister stole my apple ipad and tested to see if it can survive a thirty foot drop, just so she can be a youtube sensation.

My iPad is now destroyed and she has 83 views. I know this is totally off
topic but I had to share it with someone!

Visit my site :: http://italiangreyhounds.es/story.php?Title=provillus-buy-online

匿名 说...

It's appropriate time to make some plans for the future and it is time to be happy. I've read
this post and if I could I wish to suggest you some interesting things or tips.

Perhaps you can write next articles referring to this article.
I want to read more things about it!

My blog ... provillus directions

匿名 说...

I have been browsing on-line greater than 3 hours as of late, yet I by no means
discovered any attention-grabbing article like yours.
It is beautiful price enough for me. In my view, if all website
owners and bloggers made excellent content material as you probably did, the net
will be a lot more useful than ever before.

Here is my weblog: virility Ex

匿名 说...

Hello i am kavin, its my first time to commenting anywhere, when i
read this piece of writing i thought i could also create comment due to this sensible piece
of writing.

My web page: smokedeter.herbalcurenow.com

匿名 说...

Most of the ingredients in Vig - RX Plus aid in increasing the flow of blood to the penile
area. Vig - RX Plus reviews can be obtained online as well as
in medical journals and popular lifestyle magazines like Maxim and Penthouse.
Merely you can consume Cialis to fight against this erection problem to provide your partner
what she actually requires from you.

my webpage - Buy Vigrx plus

匿名 说...

Superb post however I was wondering if you could write
a litte more on this subject? I'd be very grateful if you could elaborate a little bit further. Kudos!

Here is my weblog: hgh energizer

匿名 说...

This is a really good tip especially to those fresh to the blogosphere.
Simple but very precise information… Appreciate your sharing this
one. A must read article!

Have a look at my web-site - http://revitolproducts.weebly.com/revitol-pore-minimizer-cream.html

匿名 说...

After checking out a number of the articles on your web page,
I truly like your technique of writing a blog. I bookmarked it to my bookmark website list and will be checking back
in the near future. Please check out my web site as well and let me
know what you think.

Take a look at my website :: virility ex

匿名 说...

Just wish to say your article is as amazing. The
clearness in your publish is just cool and that i can assume you are knowledgeable on this
subject. Well together with your permission let me
to grasp your RSS feed to keep up to date with impending post.
Thanks 1,000,000 and please continue the rewarding work.


My website; virility ex fda

匿名 说...

When some one searches for his vital thing, thus he/she wishes
to be available that in detail, so that thing is maintained over here.


Feel free to surf to my webpage; buy genf20 plus

匿名 说...

This information is worth everyone's attention. How can I find out more?

Here is my webpage :: breast actives side effects

匿名 说...

That is very fascinating, You're an excessively professional blogger. I have joined your feed and stay up for in search of extra of your wonderful post. Also, I've shared your site in my social networks

Review my web-site :: venapro how long to work

匿名 说...

Thankfulness to my father who shared with me regarding
this web site, this web site is really amazing.

Take a look at my homepage :: Weight Loss Suppressants

匿名 说...

What's up, every time i used to check blog posts here in the early hours in the daylight, because i enjoy to gain knowledge of more and more.

My web page - pills men

匿名 说...

Hi! I'm at work surfing around your blog from my new apple iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the fantastic work!

Feel free to visit my blog post; Http://Buyproactol.Beep.Com

匿名 说...

Why users still use to read news papers when in this technological world everything is available on net?


Here is my site: creatine muscle builder australia