Trouble compiling kernel, file locations?

New to Debian (Or Linux in general)? Ask your questions here!

Trouble compiling kernel, file locations?

Postby keithostertag » 2011-08-01 15:32

Hi-

I am completely new to compiling the kernel. Trying to compile on an old Dell C610 laptop that has Debian 6.01 installed and working. Here is what I have done so far:

Downloaded linux-3.0.tar.bz2 to home directory
Also downloaded patch-3.0-git13 to home directory

tar xjfv linux-3.0.tar.bz2 which uncompressed the tar ball in the created the linux-3.0 directory in my home directory

mv patch-3.0-git13.bz2 linux-3.0
cd linux-3.0
bunzip2 patch-3.0-13
patch -p1 < patch-3.0-git13

make mrproper

So far, everything seemed to go well with no error messages. But next I do: make menuconfig and I get the following errors:

keith@EVE:~/linux-3.0$ make menuconfig
HOSTCC scripts/basic/fixdep
In file included from /usr/include/bits/posix1_lim.h:157,
from /usr/include/limits.h:145,
from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/limits.h:122,
from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/syslimits.h:7,
from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/limits.h:11,
from scripts/basic/fixdep.c:114:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory
In file included from /usr/include/sys/socket.h:40,
from /usr/include/netinet/in.h:25,
from /usr/include/arpa/inet.h:23,
from scripts/basic/fixdep.c:116:
/usr/include/bits/socket.h:366:24: error: asm/socket.h: No such file or directory
scripts/basic/fixdep.c: In function ‘parse_dep_file’:
scripts/basic/fixdep.c:322: error: ‘PATH_MAX’ undeclared (first use in this function)
scripts/basic/fixdep.c:322: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:322: error: for each function it appears in.)
scripts/basic/fixdep.c:322: warning: unused variable ‘s’
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

I have been reading as many instructions as I can find and I don't see anything that suggests that I need to create links, or that I am putting things in the wrong directory. I don't see anything in the .README or Makefile that is appropriate. I have tried this several times, with and without the patch, and using different directories (such as /usr/src). but to no avail. I am using the [kernelnewbies.org] page as well as the Kernel Rebuild Guide at [www.digitalhermit.com] page for guidance.

I don't understand why the compiler is using the /usr/ tree path anyway... when all the sources have been installed in the linux-3.0 directory under my home directory...

Can someone help me figure out what I am doing wrong?

Thanks,
Keith
keithostertag
 
Posts: 22
Joined: 2011-07-29 18:29

Re: Trouble compiling kernel, file locations?

Postby Polaris96 » 2011-08-01 16:02

ok the problem is most likely that you didn't copy the source file (tarball) into a subdirectory called '/kernel' before you compiled it. There's a line in the makefile that looks for a kernel directory.

Try using this How to http://forums.debian.net/viewtopic.php?f=16&t=36525 it works very well. Post more if you're still having issues.

Remember to keep your first custom kernel fairly close to plain vanilla.
for as long as the world remains. for as long as time remains. so, too, will I remain. To serve. To help. And to make my contribution. Also, never forget our family at debianuserforums.org If we can't solve your problem, they probably can.
Polaris96
 
Posts: 555
Joined: 2009-06-17 18:37

Re: Trouble compiling kernel, file locations?

Postby bugsbunny » 2011-08-01 20:23

make sure you have build-essential installed. I suspect that you're missing at least libc6-dev, which is one of the packages that build-essential pulls in. Also make sure you have fakeroot.

No need to run make mrproper either (although it shouldn't hurt)

I'd also suggest forgetting about patching the kernel the first time around, make sure you can build a pure vanilla kernel first (although you do appear to have applied the patch correctly).

Easy method of building the kernel. Once you've run make menuconfig simply run
Code: Select all
make deb-pkg
. Or you can run
Code: Select all
make-kpkg --rootcmd fakeroot --initrd kernel_headers kernel_image

You'll need kernel-package installed for that. I also suggest reading the information in:
/usr/share/doc/kernel-package/
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Trouble compiling kernel, file locations?

Postby keithostertag » 2011-08-01 21:51

Hi Bugsbunny and Polaris96-

Thanks so much for responding!

I double-checked and I already do have those packages correctly installed: build-essential, fakeroot, and libc6-dev. So those are not the problem.

I don't yet have the kernel-package installed, but if I understand you correctly I don't need that yet.

Polaris96- your statement puzzles me: "ok the problem is most likely that you didn't copy the source file (tarball) into a subdirectory called '/kernel' before you compiled it. There's a line in the makefile that looks for a kernel directory." I looked through the Makefile and don't see any indication that the Makefile requires the tar ball to be installed under a /kernel subdirectory. Can you explain?

I am also having problems getting Debian to connect to my wireless network, which should be unrelated, but it slows down my progress. Using a different computer I will be reading the thread on debian forum that you recommended an will report back if and when I found out more.

Thanks again,
Keith
keithostertag
 
Posts: 22
Joined: 2011-07-29 18:29

Re: Trouble compiling kernel, file locations?

Postby keithostertag » 2011-08-02 01:01

I was able to download a few additional packages that were suggested: kernel-package and ncurses-dev, but I still get the same error messages. It doesn't matter whether I use make menuconfig or make xconfig, the error messages are the same.

I find this very weird. All the online tutorials that I see just say untar the src files, cd to that directory and start with make menuconfig ... there doesn't seem to be any other prerequisites (assuming you have the compiler and libraries).

What are these error messages trying to tell me? For instance the first section:

In file included from /usr/include/bits/posix1_lim.h:157,
from /usr/include/limits.h:145,
from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/limits.h:122,
from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/syslimits.h:7,
from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/limits.h:11,
from scripts/basic/fixdep.c:114:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory

Is it saying that
/usr/include/bits/local_lim.h
can't be found? It does exist exactly there.
Or is it saying that
linux/limits.h
can't be found? That file is at ~/linux-3.0/include/linux.limits.h

In fact I checked and every file in that error message exists, AFAIK, where it is supposed to exist. My only doubt is the linux/limits.h since that is a relative path.

Any ideas?

Thanks,
Keith Ostertag
keithostertag
 
Posts: 22
Joined: 2011-07-29 18:29

Re: Trouble compiling kernel, file locations?

Postby keithostertag » 2011-08-02 01:38

In case it helps, I've looked through all the errors in the first section and copied down the line from the code at that line number.

In file included from /usr/include/bits/posix1_lim.h:157 #include <bits/local_lim.h>

from /usr/include/limits.h:145 #include <bits/posix1_lim.h>

from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/limits.h:122 #include_next <limits.h>

from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/syslimits.h:7 #include_next <limits.h>

from /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed/limits.h:11 #include "syslimits.h"

from scripts/basic/fixdep.c:114 #include <limits.h>

/usr/include/bits/local_lim.h:39 #include <linux/limits.h>

/usr/include/bits/local_lim.h:26 #define _undef_NR_OPEN

error: linux/limits.h: No such file or directory
keithostertag
 
Posts: 22
Joined: 2011-07-29 18:29

Re: Trouble compiling kernel, file locations?

Postby bugsbunny » 2011-08-02 17:39

/usr/include/bits/local_lim.h:39 #include <linux/limits.h>

error: linux/limits.h: No such file or directory

So it's saying it can't find that file. It should be at /usr/include/linux/limits.h
That file should be included as part of the package linux-libc-dev, which should be a dependency of libc6-dev, which should be pulled in by build-essential
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Trouble compiling kernel, file locations?

Postby keithostertag » 2011-08-02 18:23

Hi Bugsbunny-

Yea, and that file (limits.h) has always been there. Evidently there is some problem/confusion with the 3.0 dependency trees.

So after several more hours of Internet searching reading other people's ideas and problems, and downloading header files and upgraded gcc libraries, etc, I still got nowhere. So I decided to start over clean.

This time I downloaded the 2.6.32-5-686 tar ball, the last before the switch to 3.0.

Bingo, no problem! The make xconfig is working as it should with no errors.

Thanks for responding and your help, and if I have further problems I will start a new thread.

Keith Ostertag
keithostertag
 
Posts: 22
Joined: 2011-07-29 18:29

Re: Trouble compiling kernel, file locations?

Postby bugsbunny » 2011-08-04 18:50

All I can say is that I've had no problems compiling 3.0 kernels
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Trouble compiling kernel, file locations?

Postby Muhv » 2011-08-08 19:00

It's not my first time installing vanilla kernel, but at the moment I am stuck. Getting the following error after compiling modules:

Code: Select all
/usr/bin/make  EXTRAVERSION=-custom  ARCH=i386 \
              -C Documentation/lguest
make: *** Documentation/lguest: No such file or directory.  Stop.
make: *** [debian/stamp/build/kernel] Error 2
Muhv
 
Posts: 20
Joined: 2011-02-19 07:55
Location: Estonia, Tallinn

Re: Trouble compiling kernel, file locations?

Postby grapok » 2011-09-13 11:24

/usr/bin/make EXTRAVERSION=-custom ARCH=i386 \
-C Documentation/lguest
make: *** Documentation/lguest: No such file or directory. Stop.
make: *** [debian/stamp/build/kernel] Error 2


you can try thiz.

edit your .config file. if you make symlink, the file locate at /usr/src/linux
and change this (don’t appears ordered):

CONFIG_LGUEST_GUEST=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_LGUEST=y

for this

# CONFIG_LGUEST_GUEST is not set
# CONFIG_PARAVIRT_SPINLOCKS is not set
# CONFIG_LGUEST is not set
8)

choose Load Alternate Configuration
then compile again.
grapok
 
Posts: 2
Joined: 2011-09-11 11:18
Location: mambang

Re: Trouble compiling kernel, file locations?

Postby grapok » 2011-09-13 11:26

This is because lguest is not anymore in folder ./Documentation,
but now it is in ./Documentation/virtual

8)
grapok
 
Posts: 2
Joined: 2011-09-11 11:18
Location: mambang

Re: Trouble compiling kernel, file locations?

Postby Teufel » 2012-04-01 23:56

grapok wrote:This is because lguest is not anymore in folder ./Documentation,
but now it is in ./Documentation/virtual


I've got the same error when tried to compile a kernel.
How to fix it?
Teufel
 
Posts: 72
Joined: 2012-02-20 06:14

Re: Trouble compiling kernel, file locations?

Postby vbrummond » 2012-04-01 23:57

Disable paravirtualization. You probably do not need it anyway unless you are running the kernel under a virtual machine.
Always on Debian Testing
vbrummond
 
Posts: 4468
Joined: 2010-03-02 01:42

Re: Trouble compiling kernel, file locations?

Postby Teufel » 2012-04-04 14:08

virtualization disabling does nothing.
Symlink can helps. Patches also can helps.
Teufel
 
Posts: 72
Joined: 2012-02-20 06:14

Next

Return to Beginners Questions

Who is online

Users browsing this forum: pcalvert and 5 guests

fashionable