LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-21-2012, 04:32 AM   #1
miykle
LQ Newbie
 
Registered: Mar 2008
Posts: 27

Rep: Reputation: 0
Compiling Kernel


G'Day; I'm trying to learn to compile a kernel and all goes well until I get to "stage 2" then I get the following error;;

Building modules, stage 2.
MODPOST 3400 modules
ERROR: "__modver_version_show" [drivers/staging/rts5139/rts5139.ko] undefined!
ERROR: "handle_edge_irq" [drivers/gpio/gpio-pch.ko] undefined!
ERROR: "irq_to_desc" [drivers/gpio/gpio-pch.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/miykel/Downloads/3.4/linux-3.4.o-3.2'
make: *** [debian/stamp/build/kernel] Error 2
Can anyone help please

Regards Miykle
 
Old 05-21-2012, 04:49 AM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,014

Rep: Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962
You have possibly an inconsistent .config file.

Try reusing the .config of a working kernel (shipped with your distribution) then run
Code:
make oldconfig
before tuning your kernel's configuration if needed.
 
Old 05-21-2012, 08:42 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware«
Posts: 11,040
Blog Entries: 1

Rep: Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366
Member response

Hi,

You should look at: https://help.ubuntu.com/community/Kernel/Compile

Several good links and justification/cautions for compiling a kernel for Ubuntu.

Last edited by onebuck; 05-22-2012 at 06:24 AM. Reason: typo
 
Old 05-22-2012, 12:21 AM   #4
miykle
LQ Newbie
 
Registered: Mar 2008
Posts: 27

Original Poster
Rep: Reputation: 0
G'Day and thanks for the replies guy's. I've tried every option I've found and been supplied from forums but nothing makes any difference, I always end up at the same error message, even tried different methods nothing seems to work just end up at the same place....very frustrating.
Thanks Again regards Miykel
 
Old 05-22-2012, 12:29 AM   #5
fogpipe
Member
 
Registered: Mar 2011
Distribution: Slackware 64 Current
Posts: 327

Rep: Reputation: 77
What kernel version are you building? I just built and installed 3.3.5 with gcc-4.5.2 and it went off without a hitch.
The command line i usually use is "make && make modules && make modules_install&& make install"
make sure to back up your lilo.conf and /boot directory so you can boot from a cd and restore them if need be.
If you are building a version that came with your distro, that sometimes doesnt work as well as getting the source off kernel.org and starting clean.
If you do need to restore your lilo.conf, dont forget to run lilo after you restore it.

Last edited by fogpipe; 05-22-2012 at 12:34 AM.
 
Old 05-22-2012, 03:33 AM   #6
miykle
LQ Newbie
 
Registered: Mar 2008
Posts: 27

Original Poster
Rep: Reputation: 0
G'Day and thanks fogpipe,
The distro is Ubuntu 12.10
1. kernel 3.4.0-2 from mainline
2. Kernel 3.3.0 liquorix

I'm trying to compile 3.4.0-2.6 generic from mainline

I wonder if having more than 1 kernel installed has anything to do with it. ????
Regards miykel
 
Old 05-22-2012, 05:07 AM   #7
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,014

Rep: Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962
Quote:
Originally Posted by miykle View Post
I wonder if having more than 1 kernel installed has anything to do with it. ????
No.

To understand your problem, please provide :
- the exact steps you followed (which commands you did issue, in what order)
- the .config file you are using (renamed e.g. as config.txt).

PS you should type "make menuconfig" (or "make gconfig", "make xconfig", whatever) before "make".
Preferably, as I said before, reuse the .config from your running kernel before all that first, e.g.
Code:
zcat /proc/config.gz > /path_to_your_new_kernel_directory
make oldconfig

Last edited by Didier Spaier; 05-22-2012 at 05:20 AM.
 
Old 05-22-2012, 08:10 AM   #8
miykle
LQ Newbie
 
Registered: Mar 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Thanks for the interest guys I certainly appreciate it, tried to post the config file but it's to big.
What I have been doing is ;
1 Extract tar.gz to /usr/src
2 cd /usr/src/ubuntu-quantal
3 copy/paste current kernel config file from /boot to /usr/src/ubuntu-quantal/usr as a template for make oldconfig
4 sudo make oldconfig....run ok
5 sudo make
make run ok until it reached stage 2 then received error messages
tracked down the gpio but no .ko files
The kernel I got from mainline repository, tried several methods but all end up at the same point.
Hope this is helpful
Kind Regards Miykle
 
Old 05-22-2012, 08:41 AM   #9
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,014

Rep: Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962
Step 3, you should put then current kernel config file in the directory created by the extraction at step 2 and name it ".config", e.g.
Code:
mv linux-3.4.tar.bz2 /somewhere
cd /somewhere
tar xf linux-3.4.tar.bz2
cp /boot/configxxx /somewhere/linux-3.4/.config
cd /somewhere/linux-3.4
make oldconfig
Otherwise "make oldconfig" won't take the current config file as a basis.
 
Old 05-22-2012, 08:47 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware«
Posts: 11,040
Blog Entries: 1

Rep: Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366
Member response

Hi,
Quote:
Originally Posted by miykle View Post
Thanks for the interest guys I certainly appreciate it, tried to post the config file but it's to big.
<snip>
Try using pastebin.
 
Old 05-22-2012, 11:18 AM   #11
fogpipe
Member
 
Registered: Mar 2011
Distribution: Slackware 64 Current
Posts: 327

Rep: Reputation: 77
Where are you getting the kernel source code you are using? Its not some distro specific thing is it?
Because alot of distros pee on the kernel a bit, i guess because just linux isnt good enough for them.

Last edited by fogpipe; 05-22-2012 at 11:21 AM.
 
Old 05-22-2012, 04:46 PM   #12
miykle
LQ Newbie
 
Registered: Mar 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Thanks again guys;
@ Didier; I left out a step (damn) after;
3 copy/paste current kernel config file from /boot to /usr/src/ubuntu-quantal/usr as a template for make oldconfig
I did cd /usr/src/ubuntu-Quantal/usr
Then make oldconfig.
This was a sugestion I got from searching online so the make would use the config file as a template for the new one without influence from any other config file in /boot
Seemed to make sense at the time, but it could be a red herring

@ Fogpipe; I get the tar.gz friom the launchpad/mainline repository, I assume that is the best place from what I've read.

Postbin........... http://pastebin.com/4PiGCvHS

Kind Regards Miykle
 
Old 05-22-2012, 06:24 PM   #13
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,014

Rep: Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962
Quote:
Originally Posted by miykle View Post
Thanks again guys;
@ Didier; I left out a step (damn) after;
3 copy/paste current kernel config file from /boot to /usr/src/ubuntu-quantal/usr as a template for make oldconfig
I did cd /usr/src/ubuntu-Quantal/usr
Then make oldconfig.
This was a sugestion I got from searching online so the make would use the config file as a template for the new one without influence from any other config file in /boot
Seemed to make sense at the time, but it could be a red herring
I think this is a red herring. Anyhow we did know the exact wording of the commands you typed at the terminal, e.g. did you write
Code:
cp /boot/configxxx /usr/src/ubuntu-quantal/usr
or
Code:
cp /boot/configxxx /usr/src/ubuntu-quantal/usr/.config
So please copy/paste here the exact sequence of all the commands you typed in the terminal.

Last edited by Didier Spaier; 05-22-2012 at 06:26 PM.
 
Old 05-22-2012, 06:48 PM   #14
miykle
LQ Newbie
 
Registered: Mar 2008
Posts: 27

Original Poster
Rep: Reputation: 0
G'Day I didn't move the file by terminal I just copied the config file from /boot and pasted it into ubuntu-quantal/usr
but first chown.....ubuntu-quantal/usr
to allow me to paste into it
then cd /usr/src/ubuntu-quanatl/usr
then ran sudo make oldconfig.
one thing though I can never find where the oldconfig is stored after it makes it
although the terminal says it has done it ????
( scarey when the terminal refers to it's self in the first person...Hal revisited...lol. )
I hope this helps
Regards Miykel
 
Old 05-22-2012, 07:17 PM   #15
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,014

Rep: Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962
Miykle,

to compile the kernel you should do everything using the terminal.

The way you have copied the file it was certainly not renamed .config in the process, hence "make oldconfig" didn't consider it.

In short do what follows (I suppose that configxxx is the name of your current config file and you already stored the new kernel source file, named linux-3.4-02.tar.bz2, in /usr/src; else adapt the commands accordingly)
- open a terminal
- become root typing "sudo su"
- then type in sequence:
Code:
cd /usr/src/
tar xf linux-3.4-02.tar.bz2
cd linux-3.4-02
cp /boot/configxxx /usr/src/linux-3.4-02/.config
make oldconfig
At this point you will be asked a bunch of questions; accept the default answers proposed unless you have a good reason not to.
Then continue typing in sequence:
Code:
make
make modules_install
Then you will have to install the new kernel in /boot and update grub (I guess, as I don't have Ubuntu installed and Slackware uses lilo instead of grub).
Waiting to hear from you.

Last edited by Didier Spaier; 05-23-2012 at 12:41 AM. Reason: mistyping corrected: /homesrc should have read /usr/src
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Good but sorta easy guide to Kernel compiling/Re-Compiling? linus72 Linux - General 1 07-13-2009 01:37 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
/lib/modules/2.4.33.3/kernel/sound folder is missing after compiling kernel Paulo Gˇes Slackware - Installation 2 04-15-2007 08:42 PM
compiling kernel problem --- Kernel panic: unable to mount root fs ........ anthonymts123 Linux - General 5 07-31-2006 02:29 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM


All times are GMT -5. The time now is 07:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration