LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 04-20-2005, 10:25 AM   #1
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Rep: Reputation: 15
Kernel compile error


Hi all!
I've downloaded the new kernel from www.kernel.org, but there seems to be a problem in it. When I give the command make modules there's a lot going on, but after a while it seems I'm getting a compile error. This seems rather strange to me. I've never compiled my own kernel before, so I'm a bit of a noob. I'm not sure if I have saved the config file in the correct location (the dir where my kernel is extracted).
Thanks!
 
Old 04-20-2005, 10:53 AM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Well, what error are you getting exactly? Where did you extract the kernel? Can you show us the commands you use exactly to extract, configure, and compile the kernel?
 
Old 04-22-2005, 03:43 AM   #3
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
Here's what I do:
I've downloaded the file linux-2.6.11.7.tar.bz2, and copied it to /usr/src
There I extracted the tar, and made a symlink /usr/src/linux to /usr/src/linux-2.6.11.7
Then, from the folder /usr/src/linux I issue the command make xconfig, and use the graphical interface to make some adjustments. And I save the .config file in my home folder for future use and in /usr/src/linux. And I close the graphical interface.
After that I issue the command make dep. I get a warning that make dep is unnecessary now.
Then I issue: make clean. After a very short wait I do this: make modules. When I press enter there's lots of stuff going on I get lots of output to the terminal. So I wait, but the last few lines are these:

drivers/char/drm/gamma_drv.c:56:22: drm_proc.h: No such file or directory
drivers/char/drm/gamma_drv.c:57:20: drm_vm.h: No such file or directory
drivers/char/drm/gamma_drv.c:58:22: drm_stub.h: No such file or directory
drivers/char/drm/gamma_drv.c:59:25: drm_scatter.h: No such file or directory
drivers/char/drm/gamma_lists.h:161: warning: `DRM' defined but not used
drivers/char/drm/gamma_lock.h:36: warning: `DRM' defined but not used
drivers/char/drm/gamma_lock.h:69: warning: `DRM' defined but not used
make[3]: *** [drivers/char/drm/gamma_drv.o] Error 1
make[2]: *** [drivers/char/drm] Error 2
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2

And lots of warnings are before these lines....
I hope someone can help me.
Thanks,

Lex
 
Old 04-22-2005, 04:53 AM   #4
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
make clean is something you run before or after, to clean up any clutter from previous builds. here's what i do:

make xconfig
make bzImage
make modules
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinux-2.6.11
cp System.map /boot/System.map-2.6.11
cp .config /boot/config-2.6.11

then you need to create a new entry in /etc/lilo.conf that points to that image, run lilo, and you're done.
 
Old 04-22-2005, 05:17 AM   #5
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
Thanks! But I still get the same error while making modules... :S
I don't understand why this happens...
Oh, and by the way, when everything is over, and my new kernel is working, do I have to leave the folder /usr/src/linux, or can I delete that? May be a very dumb question, but...

Oh, and another by the way; I used this as a guideline (from the start): http://www.linuxcompatible.org/thread1340-1.html

Thanks.

Lex

Last edited by rael_kid; 04-22-2005 at 05:18 AM.
 
Old 04-22-2005, 05:47 AM   #6
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
The error probably comes from a missconfiguration of the drm modules, but it is hard to tell what you need to change. Did you use a template for the configuration, or did you use the defaults? I usually clone my running kernel and use this as a template for 'make xconfig'
Code:
make cloneconfig
or
Code:
zcat /proc/config.gz > .config
make oldconfig
The template configuration should not be too far away (no 2.4 kernel ).

You could delete /usr/src/linux (it does not affect your running system), but in case you would like to compile additional drivers, you'll need to start-over again.

Last edited by abisko00; 04-22-2005 at 05:48 AM.
 
Old 04-22-2005, 07:08 AM   #7
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
I just issued make xconfig, then there came a graphical interface. I editted a whole lot in it (turning off SCSI support etc, all the things I thought I didn't need). After that I saved the .config file in the same folder where I extracted the source (/src/usr/linux).
Lex
 
Old 04-22-2005, 08:33 AM   #8
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Well here is what I do:

# cd /usr/src/linux
# make clean
# make && make modules_install
 
Old 04-22-2005, 11:55 AM   #9
Lakefall
LQ Newbie
 
Registered: Feb 2005
Location: Finland
Distribution: Debian sarge
Posts: 26

Rep: Reputation: 15
Quote:
Originally posted by rael_kid
make[3]: *** [drivers/char/drm/gamma_drv.o] Error 1
Things seem to go wrong when it is compiling drivers/char/drm/gamma_drv.o, which I suppose is a driver for some hardware. Do you have the hardware and do you need to use it? Try to leave it out from the kernel.

Are you sure you have downloaded and unpacked the sources properly?

What I'd do to compile and install the kernel is
Code:
make xconfig
make
su
make install
make modules_install
but I don't think it makes much difference.

You do not need to extract the sources to /usr/src. You can extract them to your home directory, if you want to. You can delete them after the kernel is working. The only things you need to do as root are "make install" and "make modules_install".
 
Old 04-23-2005, 05:38 AM   #10
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
Thanks, what you told me worked, I've stripped some more things using xconfig, and now it has compiled completely... But what's next... The new kernel didn't show up in grub... I've searched my system for grub.conf, but it wasn't there... Some more help please.
Thanks!
Lex
 
Old 04-23-2005, 07:54 AM   #11
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
grub.conf with sometimes menu.lst as a link is usualy in

/boot/grub

If you can find it edit grub.conf with an entry that points to your new kernel
Good luck
 
Old 04-25-2005, 11:36 AM   #12
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
Ah, thanks, I've found the file. But I'm not sure how to put my newly compiled kernel in it.. Can anyone help me?
Thanks!
 
Old 04-25-2005, 11:44 AM   #13
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
I think it should look something like this:

Code:
title my-new-kernel
    kernel (hdX,Y)/boot/my-new-kernel-binary <some-options>
    initrd (hdX,Y)/boot/my-new-initial-ramdisk
You could also use this notation:

Code:
title my-new-kernel
    root (hdX,Y)    
    kernel /boot/my-new-kernel-binary <some-options>
    initrd /boot/my-new-initial-ramdisk

Last edited by abisko00; 04-25-2005 at 11:46 AM.
 
Old 04-25-2005, 12:25 PM   #14
rael_kid
Member
 
Registered: Mar 2005
Location: Holland
Distribution: Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
Thanks, but there is no initrd.img for the kernel in the boot map. Should I make one manually, if yes, how, if no, what else??
Thanks!
Lex
 
Old 04-25-2005, 12:41 PM   #15
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
It depends! If you compile a kernel yourself, you have the chance to include all required drivers into the kernel. In this case, initrd is not required. However if you did compile e.g. filesystem driver and/or HDD controller driver as modules, they need to be included in your ramdisk (usually by the command mkinitrd). Otherwise your HDD might not be recognised and the root filesystem cannot be mounted.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Kernel compile error Navyblue Linux - Newbie 20 08-01-2005 11:53 PM
Error during the kernel (2.6.10) compile. Whynot Debian 1 03-03-2005 08:34 PM
error 2 trying to compile 2.4 kernel TonyJ Fedora 2 09-15-2004 08:51 PM
Kernel 2.6.4 compile error kkiedrowski Slackware 3 04-30-2004 10:37 AM
Kernel compile error theabyyss Linux - General 4 04-08-2002 05:36 AM


All times are GMT -5. The time now is 07:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration