Stop Microsoft

Operating Systems => Linux and UNIX => Topic started by: cymon on 15 June 2006, 04:43

Title: Error compiling kernel 2.6.16
Post by: cymon on 15 June 2006, 04:43
After unpacking the sources into /usr/src/linux-2.6.16 and cleaning up the build directory with make mrproper, I get this error message when I go to configure it with make menuconfig.  This also comes up with make xconfig and make config. Sadly, xterm doesn't allow cut and paste.

make: *** [scripts_basic] Error 2

I don't know what that means, but if it's fixable, I'd like to try and fix it.
Title: Re: Error compiling kernel 2.6.16
Post by: piratePenguin on 15 June 2006, 17:54
You can copy and paste with xterm. Select the text and it'll be copied, then middle click to paste.
If you could give us the whole output we'd probably have a better chance of knowing what's up..
Title: Re: Error compiling kernel 2.6.16
Post by: cymon on 15 June 2006, 19:22
Code: [Select]
statenburg:/home/ben# cd /usr/src/linux-2.6.16
statenburg:/usr/src/linux-2.6.16# 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-lib/i486-linux-gnu/3.3.6/include/limits.h:122,
                 from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/syslimits.h:7,
                 from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/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:214: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:214: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:214: error: for each function it appears in.)
scripts/basic/fixdep.c:214: warning: unused variable `s'
scripts/basic/fixdep.c: In function `parse_dep_file':
scripts/basic/fixdep.c:310: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:310: warning: unused variable `s'
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2


There it is.
Title: Re: Error compiling kernel 2.6.16
Post by: piratePenguin on 15 June 2006, 23:46
Install linux-kernel-headers, I think.

EDIT: http://kernel.org/
You might prefer to use 2.6.16.20, it'll have ALOT of bugfixes (not all will apply to your system/setup, obviously) - you could download the patch (http://www.kernel.org/diff/diffview.cgi?file=%2Fpub%2Flinux%2Fkernel%2Fv2.6%2Fpatch-2.6.16.20.bz2), uncompress it and run 'sudo patch -p1 < /path/to/patch-2.6.16.20' (IIRC), if you want.
Title: Re: Error compiling kernel 2.6.16
Post by: cymon on 16 June 2006, 05:08
I got the tarball of the source directly from kernel.org.  Also, this is my first kernel compile, so I'd like to keep this simple, without a lot of patching.

Apt has linux-kernel-headers at latest version.
Title: Re: Error compiling kernel 2.6.16
Post by: piratePenguin on 16 June 2006, 20:52
The kernel headers are installed?
Maybe something in this thread will help: http://www.linuxforums.org/forum/linux-kernel/22858-make-xconfig-error.html (try making the link)
Title: Re: Error compiling kernel 2.6.16
Post by: Master of Reality on 18 June 2006, 00:05
Your using debian eh?

Why not just use apt to upgrade your kernel.

Anyways...when i compiled a kernel in debian, I couldnt get menuconfig or xconfig to work either. I ended up copying my config file from my fedora machine and using "make config" to configure anything that i wanted different.

Although i had a completely different error i think.


EDIT: actually, yea that wont work.

Erm... there is some files the error says it cant find... try to locate them...
# locate limits.h
Title: Re: Error compiling kernel 2.6.16
Post by: H_TeXMeX_H on 18 June 2006, 04:20
Why compile anything when you don't have to ... especially a kernel
Title: Re: Error compiling kernel 2.6.16
Post by: Orethrius on 18 June 2006, 05:50
Quote from: H_TeXMeX_H
Why compile anything when you don't have to ... especially a kernel

 Performance gains?  Smaller kernel?
Title: Re: Error compiling kernel 2.6.16
Post by: cymon on 18 June 2006, 06:54
Quote from: H_TeXMeX_H
Why compile anything when you don't have to ... especially a kernel


Mainly because I'd like to know how to do it.  Unless you'd like me to go back to Windows?
Title: Re: Error compiling kernel 2.6.16
Post by: pofnlice on 18 June 2006, 13:20
I found that when I was fuckering up my suse distro with all the extras to put on, a kernel recompile fixed a lot of what I was fuckin up. I even got step by step help from Voidmain. I bet worker201 remembers that! I had fuckered Suse up so much, I actually had to reinstall it...Void was impressed, he said he had never seen that before! Worker201 couldn't  believe it either..
Title: Re: Error compiling kernel 2.6.16
Post by: H_TeXMeX_H on 18 June 2006, 18:32
Quote from: cymon
Mainly because I'd like to know how to do it.  Unless you'd like me to go back to Windows?

That's respectable ... but don't be too flustered if it don't work. You'll probably need someone to take you through step by step like pofnlice :)

I don't quite see what this has to do with Window$ ... I never compiled my kernel ... nor would I want to ... it's a pain in the ass
Title: Re: Error compiling kernel 2.6.16
Post by: mobrien_12 on 18 June 2006, 22:40
Building a kernel is a really good thing to do even just for the experience.  

The first thing i'd suggest is to build a kernel  from the stock kernel sources that come with the distro.   Then you can make sure you have all the dependencies and the method right.  Just get it, and the modules, built.... you don't have to use it.

Then try the latest kernel.org sources.

Also, make sure to check the readme from kernel.org.  They sometimes require you to update parts of your system before it will build.
Title: Re: Error compiling kernel 2.6.16
Post by: mobrien_12 on 18 June 2006, 22:44
By the way, 2.6.17 came out today :)
Title: Re: Error compiling kernel 2.6.16
Post by: worker201 on 19 June 2006, 03:54
A quick Google search suggests that your glibc is not up to date:
http://www.google.com/search?q=%2Fusr%2Finclude%2Fbits%2Fsocket.h&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

I can see how this might be a problem.  Fortunately, once things work properly, building a kernel is really not that hard.  I learned how to do it from Slackware:
http://www.slackbook.org/html/system-configuration-kernel.html#SYSTEM-CONFIGURATION-KERNEL-COMPILE

Should be similar on your system.
Title: Re: Error compiling kernel 2.6.16
Post by: mobrien_12 on 20 June 2006, 03:17
[mobrien@hariel ~]$ rpm -qf /usr/include/bits/socket.h
glibc-headers-2.3.6-3


Do you have your glibc headers installed?
Title: Re: Error compiling kernel 2.6.16
Post by: cymon on 20 June 2006, 04:27
output from locate limits.h

Code: [Select]
/root/linux-2.6.8/include/asm-arm26/limits.h
/root/linux-2.6.8/include/asm-arm/limits.h
/root/linux-2.6.8/include/asm-i386/mach-default/irq_vectors_limits.h
/root/linux-2.6.8/include/asm-i386/mach-generic/irq_vectors_limits.h
/root/linux-2.6.8/include/asm-i386/mach-summit/irq_vectors_limits.h
/root/linux-2.6.8/include/linux/limits.h
/usr/include/asm-i486/mach-default/irq_vectors_limits.h
/usr/include/asm-i486/mach-generic/irq_vectors_limits.h
/usr/include/asm-i486/mach-summit/irq_vectors_limits.h
/usr/include/limits.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/limits.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/syslimits.h
/usr/src/linux-2.6.16/include/asm-arm26/limits.h
/usr/src/linux-2.6.16/include/asm-arm/limits.h
/usr/src/linux-2.6.16/include/asm-i386/mach-default/irq_vectors_limits.h
/usr/src/linux-2.6.16/include/asm-i386/mach-generic/irq_vectors_limits.h
/usr/src/linux-2.6.16/include/asm-i386/mach-summit/irq_vectors_limits.h
/usr/src/linux-2.6.16/include/linux/limits.h
Title: Re: Error compiling kernel 2.6.16
Post by: piratePenguin on 20 June 2006, 05:24
Quote from: cymon
output from locate limits.h

Code: [Select]
/root/linux-2.6.8/include/asm-arm26/limits.h
/root/linux-2.6.8/include/asm-arm/limits.h
/root/linux-2.6.8/include/asm-i386/mach-default/irq_vectors_limits.h
/root/linux-2.6.8/include/asm-i386/mach-generic/irq_vectors_limits.h
/root/linux-2.6.8/include/asm-i386/mach-summit/irq_vectors_limits.h
/root/linux-2.6.8/include/linux/limits.h
/usr/include/asm-i486/mach-default/irq_vectors_limits.h
/usr/include/asm-i486/mach-generic/irq_vectors_limits.h
/usr/include/asm-i486/mach-summit/irq_vectors_limits.h
/usr/include/limits.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/limits.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/syslimits.h
/usr/src/linux-2.6.16/include/asm-arm26/limits.h
/usr/src/linux-2.6.16/include/asm-arm/limits.h
/usr/src/linux-2.6.16/include/asm-i386/mach-default/irq_vectors_limits.h
/usr/src/linux-2.6.16/include/asm-i386/mach-generic/irq_vectors_limits.h
/usr/src/linux-2.6.16/include/asm-i386/mach-summit/irq_vectors_limits.h
/usr/src/linux-2.6.16/include/linux/limits.h
Try running this:
Code: [Select]
CFLAGS="-I/usr/src/linux-2.6.16/include/" make menuconfig

BTW, I have the same glibc on Ubuntu and I compiled 2.6.17 yesterday (it has alot of cool new stuff, including a driver for Airport Extreme). If you're using menuconfig you'll need to have the ncurses5-dev package installed too.

If, like me, you need some non-standard kernel modules e.g. for your wireless card, you'll need to compile/install them yourself when you boot up into your new kernel. The Debian ones won't work.
Title: Re: Error compiling kernel 2.6.16
Post by: solemnwarning on 23 June 2006, 15:37
Also, make sure you have got the libc6-dev installed, looks like you might be missing it
Title: Re: Error compiling kernel 2.6.16
Post by: cymon on 25 June 2006, 00:56
Crap, now I'm getting errors with apt.

After running the cflags, then I try make menuconfig.
statenburg:/home/ben# cd /usr/src/linux-2.6.16
statenburg:/usr/src/linux-2.6.16# 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-lib/i486-linux-gnu/3.3.6/include/limits.h:122
,
                 from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/syslimits.h:
7,
                 from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/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:214: error: `PATH_MAX' undeclared (first use in this func
tion)
scripts/basic/fixdep.c:214: error: (Each undeclared identifier is reported only
once
scripts/basic/fixdep.c:214: error: for each function it appears in.)
scripts/basic/fixdep.c:214: warning: unused variable `s'
scripts/basic/fixdep.c: In function `parse_dep_file':
scripts/basic/fixdep.c:310: error: `PATH_MAX' undeclared (first use in this func
tion)
scripts/basic/fixdep.c:310: warning: unused variable `s'
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
[/code]

Apt gives me a bunch of connection refused errors when I do apt-get update.
Title: Re: Error compiling kernel 2.6.16
Post by: piratePenguin on 25 June 2006, 00:59
is libc6-dev installed?
the connection refused errors could be temporary problems on the server-side..
Title: Re: Error compiling kernel 2.6.16
Post by: cymon on 25 June 2006, 01:03
libc6-dev is at the latest version.

Damn it, all this just for the nVidia drivers.  But it says there's no kernel interface for my kernel, it needed the 2.6.8 source, I downloaded that and it said it needed to be configured.  Tried configuring it, that didn't work.
Title: Re: Error compiling kernel 2.6.16
Post by: piratePenguin on 25 June 2006, 01:12
Quote from: cymon
libc6-dev is at the latest version.

Damn it, all this just for the nVidia drivers.  But it says there's no kernel interface for my kernel, it needed the 2.6.8 source, I downloaded that and it said it needed to be configured.  Tried configuring it, that didn't work.
Doesn't it work with linux-kernel-headers installed?

If you need the source code I think it looks for it in /lib/modules/`uname -r`/source - which you should setup to be a symlink to the kernel source directory.
Code: [Select]
ln -s /path/to/kernel/sourcecode /lib/modules/`uname -r`/source
Title: Re: Error compiling kernel 2.6.16
Post by: piratePenguin on 25 June 2006, 01:15
In fact I think you might want to look into the linux-restricted-modules package...
Title: Re: Error compiling kernel 2.6.16
Post by: H_TeXMeX_H on 28 July 2006, 20:15
Well I recently compiled my own kernel, but it was pretty easy cuz I used an src.rpm version ... all I had to do is

rpmbuild --rebuild kernel-version###-src.rpm

or if you need to make changes (like I had to) you could make an rpm out of a tgz of the kernel with:

rpmbuild -ta --target=i686 kernel-version####.tar.gz

of course you may need a spec file for it unless you get an rpm version of it and extract it, then repackage it as tgz

more on rpm stuff:

http://www.linux.com/howtos/Font-HOWTO/rpm.shtml