LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2011, 10:22 AM   #1
qwerty4061
Member
 
Registered: Nov 2011
Posts: 31

Rep: Reputation: Disabled
Kernel building


Hi,
I was trying to build my own kernel (just for learning) from source so I downloaded v3.0.4 from kernel.org as I saw in Ubuntu site that ubuntu 11.10 (my running version of linux)is based on it. uname -a shows my running kernel as 3.0.0-12-generic-pae so I copied config-3.0.0-12-generic-pae to my kernel sources folder and renamed it as .config and typed in make oldconfig and then make. It took nearly 2 hours to compile and finally generated a vmlinux image of 168 MB. So I did make clean and did make bzImage. This time also it took 2 hrs and again generated a vmlinux image of 168 MB. So basically my doubt was:

1. Why is the kernel size so huge, my running kernel has a size of only 4.5 MB, even though both of them uses the same .config

2. Why did make bzImage generate the same vmlinux image isn't it supposed to generate a much smaller vmlinuz image.

3. Why is taking so long, the configuration of my PC is pretty decent with i5 2nd gen and 4GB RAM

4. Is there any difference between making a bzImage and stripping a vmlinux image?


Thanks
 
Old 12-13-2011, 12:42 PM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Something went wrong with your initial .config

Do you have /proc/config.gz ? (it is your running kernel config)
if yes, cd into your kernel source dir and do: zcat /proc/config.gz > .config
then make oldconfig etc...

Personnaly, I would make xconfig (or menuconfig) after oldconfig
then I would remove many stuff that I will never use
 
1 members found this post helpful.
Old 12-13-2011, 01:29 PM   #3
timetraveler
Member
 
Registered: Apr 2010
Posts: 243
Blog Entries: 2

Rep: Reputation: 31
You should read the README.

1) make mrproper
2) cp config-3.0.0-12-generic-pae .config
3) make oldconfig

Don't run make clean after you've built the kernel, that removes all the objects, etc. that you just built.

4) make

Building a generic kernel takes longer as it's meant to run on just about any hardware.

5) sudo make modules_install install


You should learn what hardware you have and build a kernel just for your hardware instead of a generic kernel.

sudo lspci > hardware
sudo lsusb >> hardware

You may want to run those using verbose mode.
 
1 members found this post helpful.
Old 12-14-2011, 09:47 AM   #4
qwerty4061
Member
 
Registered: Nov 2011
Posts: 31

Original Poster
Rep: Reputation: Disabled
Thanks Cedrik and timetraveler for your answers. I dont have /proc/config.gz. I just wanted to build the kernel in the simplest possible way before I started changing any .config option that is why I just copied from /boot. Probably there is something wrong with it. Even if it is a generic kernel I dont think it should take 2 hours to compile. I will try to generate kernel by configuring according to my hardware.
 
Old 12-14-2011, 10:40 AM   #5
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Good luck, FYI I compile kernel in about 15/20mn with my old athlon 2600+ XP barton
 
Old 12-14-2011, 07:32 PM   #6
asipper
Member
 
Registered: Oct 2011
Distribution: Fedora 17
Posts: 138

Rep: Reputation: 0
What did you run to make it? To speed up make run make -j (+1 processors so for a dual core) 3
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Building Your Own Linux Kernel: Tricky kernel options (part 3) LXer Syndicated Linux News 0 10-23-2009 02:50 AM
kernel panic after building custom kernel for macbook sparrott Linux - Laptop and Netbook 1 06-29-2007 05:06 PM
Building kernel module from multiple source file in 2.6 kernel yogeshwar_s Programming 1 12-20-2004 09:31 AM
Problems building a simple kernel module for kernel 2.6.7 atticman Linux - Software 2 12-13-2004 03:35 PM
Building kernel mods for an existing kernel ugenn Linux - Software 2 10-06-2003 01:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration