LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-06-2006, 05:51 AM   #1
Madley
LQ Newbie
 
Registered: Nov 2006
Location: Italy
Distribution: Ubuntu
Posts: 18

Rep: Reputation: 0
Kernel problem, quite simple for You ;)


Hi all,
i'm a new user of this fantastic forum, and even a new linux user

I've a little problem while installing kernel sources.. I try to explain (scuse me for my english, i'm italian):

- i've download linux kernel source from kernel official site
- i unpack the files to /usr/src/linux-2.6.9
- i run from console:

Code:
rm -rf asm linux scsi
	ln -s /usr/src/linux/include/asm-i386 asm
	ln -s /usr/src/linux/include/linux linux
	ln -s /usr/src/linux/include/scsi scsi
and now when I try to run "make menuconfig", i see these errors:

Code:
[root@localhost linux-2.6.9]# make menuconfig
  HOSTCC  scripts/basic/fixdep
In file included from /usr/include/bits/posix1_lim.h:153,
                 from /usr/include/limits.h:144,
                 from /usr/lib/gcc/i386-redhat-linux/3.4.5/include/limits.h:122,
                 from /usr/lib/gcc/i386-redhat-linux/3.4.5/include/syslimits.h:7,
                 from /usr/lib/gcc/i386-redhat-linux/3.4.5/include/limits.h:11,
                 from scripts/basic/fixdep.c:113:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
In file included from /usr/include/sys/socket.h:35,
                 from /usr/include/netinet/in.h:24,
                 from /usr/include/arpa/inet.h:23,
                 from scripts/basic/fixdep.c:115:
/usr/include/bits/socket.h:304:24: asm/socket.h: No such file or directory
scripts/basic/fixdep.c: In function `use_config':
scripts/basic/fixdep.c:201: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:201: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:201: error: for each function it appears in.)
scripts/basic/fixdep.c:201: warning: unused variable `s'
scripts/basic/fixdep.c: In function `parse_dep_file':
scripts/basic/fixdep.c:297: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:297: warning: unused variable `s'
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

Can You help me?

Thanks all...
 
Old 11-06-2006, 06:49 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Welcome to LQ!

Quote:
rm -rf asm linux scsi
ln -s /usr/src/linux/include/asm-i386 asm
ln -s /usr/src/linux/include/linux linux
ln -s /usr/src/linux/include/scsi scsi
Don't do this. Just unpack the source code, and in /usr/src create a symlink named linux pointing to the directory:

ln -s linux-2.6.9 linux

Then you drop into the linux directory and run make menuconfig.
 
Old 11-06-2006, 07:05 AM   #3
Madley
LQ Newbie
 
Registered: Nov 2006
Location: Italy
Distribution: Ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hangdog42
Don't do this.
The problem is that I already do that.... How can i fix now?


Quote:
Originally Posted by Hangdog42
Then you drop into the linux directory and run make menuconfig.
Must I enter in /usr/src/linux-X.X.X to run "make menuconfig"?
 
Old 11-06-2006, 07:11 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Originally Posted by Madley
The problem is that I already do that.... How can i fix now?
Part of the problem is that I don't know what directory you were in when you ran those commands. For the softlinks you put in, just use rm to remove them. However, for the rm -rf asm linux scsi command you ran, I don't know what it would have done. I would remove the entire linux-X.X.X directory and then re-extract the kernel source and try again.



Quote:
Originally Posted by Madley
Must I enter in /usr/src/linux-X.X.X to run "make menuconfig"?
Absolutely you must. If you weren't in /usr/src/linux-X.X.X before, go into that directory and try make menuconfig again.
 
Old 11-06-2006, 07:34 AM   #5
Madley
LQ Newbie
 
Registered: Nov 2006
Location: Italy
Distribution: Ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
Ok, I follow your advices and now, when I run make menuconfig from linux-2.6.9 directory i get this error:

Code:
[root@localhost linux-2.6.9]# make menuconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/split-include
In file included from /usr/include/linux/errno.h:4,
                 from /usr/include/bits/errno.h:25,
                 from /usr/include/errno.h:36,
                 from scripts/basic/split-include.c:26:
/usr/include/asm/errno.h:4:31: asm-generic/errno.h: No such file or directory
make[1]: *** [scripts/basic/split-include] Error 1
make: *** [scripts_basic] Error 2

What is this?

...i think that command: rm -rf asm linux scsi was not a good command for me...


Thanks for your precious help
 
Old 11-06-2006, 07:44 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Do you remember what directory you were in when you ran that rm command? I'm starting to wonder if you didn't cause some significant damage. My main cause for concern is this:

Quote:
/usr/include/asm/errno.h:4:31: asm-generic/errno.h: No such file or directory
The /usr/include/asm directory really shouldn't have been touched by the kernel source install. Does the /usr/include/asm directory even exist on your system?

I really, really hate to suggest this, but you may be looking at a system re-install here.
 
Old 11-06-2006, 07:53 AM   #7
Madley
LQ Newbie
 
Registered: Nov 2006
Location: Italy
Distribution: Ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
I launch this two command:

Code:
cd /usr/include
rm -rf asm linux scsi
so I was in /usr/include directory.

The /usr/include/asm is still existing in my system. I look at the propriety of that directory and I see that it is a link to a folder..

Any ideas?
 
Old 11-06-2006, 10:14 AM   #8
Madley
LQ Newbie
 
Registered: Nov 2006
Location: Italy
Distribution: Ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
Ok, i reinstalled my system, now my laptop look new

Before install new kernel I've another simple question....
If I do "uname -r", i get this

Code:
[root@localhost ~]# uname -r
2.6.9-34.EL
Can I install every kernel version, or only ones with EL word?
Example, can I install this source: linux-2.6.9 ?
 
Old 11-06-2006, 11:35 AM   #9
rick.2g
Member
 
Registered: Sep 2005
Posts: 41

Rep: Reputation: 15
you can install as many kernels as you want, but you can only run one at a time. The EL version is just another tree off the main branch - there are dozens . Some of them are modified specifically for a certain machine or setup, but for the most part, the "official" main tree is fine. If you don't already know why you'd need a different tree, you probably don't.

For the kernel compile, like Hangdog said, you don't need to do the links yourself. The config does it automatically.

It's probably best to just completely replace the directory you unpacked, and start over fresh - it sounds like you may have accidentally erased some necessary stuff:

unpack the tarball (sounds like you already go this):
> tar -xzvf linux-2.6.9.tar.gz
enter the directory, and start up menuconfig :
> cd linux-2.6.9
> make menuconfig
This creates the symlinks automatically after you specify an architecture - probably i386, but it depends on the machine. Then go through, choose your configs, and exit the menuconfig.

> make dep
> make bzImage


There are quite a few tutorials out there about installing a new kernel - it would help to read 2 or 3 tutorials first, but it sounds like the mistake you made was that you were trying to do too much - once you get it installed, I think you'll find it's much easier than you thought it would be.
 
Old 11-06-2006, 02:19 PM   #10
Madley
LQ Newbie
 
Registered: Nov 2006
Location: Italy
Distribution: Ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
Thank you rick for your answer.

I noticed that i was following the steps for 2.4 kernels, so probabily i made something wrong.

Now i want to install another kernel on my laptop because the one i have isn't configured correctly for laptop pc. Another question, is there a particulare kernel prepared for laptop or every kernel is good (obviously if configured in a correct way ) ?
 
Old 11-06-2006, 03:34 PM   #11
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
There isn't a particular kernel for laptops, it is more a case of configuring it to fit your specific hardware. In most cases, the stock kernel that comes with a distro is fine for a laptop, provided that they have compiled most features as modules. Then, only the modules in use are actually loaded. About the only reason you have to compile your own kernel is if you have some bit of hardware that isn't supported by a stock kernel. Of course compiling a kernel because you just want to is a good reason as well!
 
Old 11-07-2006, 08:23 AM   #12
Madley
LQ Newbie
 
Registered: Nov 2006
Location: Italy
Distribution: Ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hangdog42
About the only reason you have to compile your own kernel is if you have some bit of hardware that isn't supported by a stock kernel. Of course compiling a kernel because you just want to is a good reason as well!
I have to recompile it because there isn't support for battery, and even the second reason is good... If I want to learn something about linux I think the best way is only trying trying....
 
  


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
Simple Linux Kernel Module Problem for 2.4.31 KneeLess Programming 3 08-19-2005 09:59 PM
a simple kernel module hari_sasidharan Programming 3 01-15-2005 01:11 AM
Problems building a simple kernel module for kernel 2.6.7 atticman Linux - Software 2 12-13-2004 03:35 PM
Problem adding a simple kernel moduel in 2.6 palbox2003 Fedora 1 07-14-2004 01:24 PM
Problem adding a simple kernel module in 2.6 palbox2003 Linux - Software 2 07-14-2004 03:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:12 AM.

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