LinuxQuestions.org
Visit Jeremy's Blog.
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 01-27-2011, 12:25 PM   #1
gkasica
Member
 
Registered: Jan 2011
Location: Jackson WI
Distribution: Fedora Core/Generic
Posts: 116

Rep: Reputation: 0
Cannot build Linux Kernel 2.6.37 asm/socket.h: No such file or directory


Hello:

I'm trying to upgrade the kernel on a generic linux system here (Used to be an old Caldera 2x box long ago). Currently its running 2.6.23.12 and I can change and recomppile from that source tree at will with no issues just fine.

Any thing else I download later than that fails with the following error set (for example the latest kernel-2.6.37 here will not even get through the make silentoldconfig:

# make silentoldconfig
HOSTCC scripts/basic/fixdep
In file included from /usr/local/include/netinet/in.h:212,
from /usr/local/include/arpa/inet.h:23,
from scripts/basic/fixdep.c:116:
/usr/local/include/bits/socket.h:304:24: error: asm/socket.h: No such
file or directory
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

The process I'm using to build is as follows (and it has worked up though everything until now:

cd /usr/src
wget http://www.kernel.org/pub/linux/kern...-2.6.37.tar.gz
tar zxvf linux-2.6.37.tar.gz
chown -R root:root linux-2.6.37*
rm linux
ln -s /usr/src/linux-2.6.37 /usr/src/linux
cd /usr/src/linux
make clean
make mrproper
cp /usr/src/config-2.6.23.12 .config
make silentoldconfig
make
make modules_install
cp /boot/vmlinuz /boot/vmlinuz.old
cp /boot/System.map /boot/System.map.old
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz
cp /usr/src/linux/System.map /boot/System.map


I'm an IT guy by trade and work with Red Hat daily but this has got me stumped here...I can do an ls -la of
/usr/local/include/bits/socket.h and its there so I'm n ot sure what's broken or how to fix it...I'm not a kernel expert of programmer however.

Thanks in advance,
George
 
Old 01-27-2011, 12:55 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
I would think that the problem is that the .config that you are trying to adapt is just too old and different to work.

You could go to

http://www.kernel-seeds.org/

and you should be able to get a good base .config to start with.
 
Old 01-27-2011, 12:58 PM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,375

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Presuming your kernel headers were correctly installed,The problem is that you are missing an include file, which is probably in the kernel. Kernel headers can and do get out of synch with the kernel you're running. When it goes too far, you get errors like the above. You can install headers from the kernel top source with something like
make headers_check (IIRC)

The caveat is that these header files are part of the toolchain, which it is usually wise not to mess with. It's usually not fatal
 
Old 01-27-2011, 02:18 PM   #4
gkasica
Member
 
Registered: Jan 2011
Location: Jackson WI
Distribution: Fedora Core/Generic
Posts: 116

Original Poster
Rep: Reputation: 0
OK. business_kid and andrewthomas thanks for the replies:

I can't build even the next point release above 2.6.23.12 so I don't think too old is an issue.

When I try the following from the 2.6.37 tree

rm linux
ln -s /usr/src/linux-2.6.37 /usr/src/linux
cd /usr/src/linux
make clean
make mrproper
make headers_check

yet the same process from the 2.6.23.12 tree works perfectly.

See below for the 2.6.37 output - same as the other error:

CHK include/linux/version.h
UPD include/linux/version.h
HOSTCC scripts/basic/fixdep
In file included from /usr/local/include/netinet/in.h:212,
from /usr/local/include/arpa/inet.h:23,
from scripts/basic/fixdep.c:116:
/usr/local/include/bits/socket.h:304:24: error: asm/socket.h: No such
file or directory
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
 
Old 01-28-2011, 03:30 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,375

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Quote:
/usr/local/include/bits/socket.h:304:24: error: asm/socket.h: No such (etc).
Is there /usr/local/include/asm? Try this

ln -s /usr/include/asm /usr/local/include/asm
 
Old 01-28-2011, 05:48 AM   #6
saftar
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Rep: Reputation: 0
I had a similar problem and had to set up the symlink to the asm directory going to /usr/src/linux-2.6.37/arch/arm/include/asm because not all the headers were in the folder the readme specified.
 
Old 01-28-2011, 11:17 AM   #7
gkasica
Member
 
Registered: Jan 2011
Location: Jackson WI
Distribution: Fedora Core/Generic
Posts: 116

Original Poster
Rep: Reputation: 0
A combination of both of those symlinks has solved this issue:

]# ll /usr/include/asm
lrwxrwxrwx 1 root root 35 Jan 28 06:11 /usr/include/asm -> /usr/src/linux/arch/arm/include/asm

# ll /usr/local/include/asm
lrwxrwxrwx 1 root root 16 Jan 28 06:08 /usr/local/include/asm -> /usr/include/asm

I've sucessfully build and am running 2.6.37.

uname -a
Linux xxxx.xxxx.xxxx 2.6.37 #1 SMP Fri Jan 28 10:32:48 CST 2011 i686 unknown


Thank you all.
 
Old 01-28-2011, 12:10 PM   #8
saftar
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Rep: Reputation: 0
Do you mind posting in http://www.linuxquestions.org/questi...t-step-859120/ what you did after you compiled the kernel to get it working?
 
  


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
error: asm/bitops.h: No such file or directory chronickut Linux - Newbie 3 10-04-2010 04:19 PM
no /linux-2.6.32/include/asm-sh directory in kernel jvilla1983 Linux - Kernel 1 12-28-2009 01:13 AM
asm/posix_types.h: No such file or directory DiBosco Linux - Software 0 07-24-2009 05:34 AM
Which is the kernel build directory? I Can't find kernel build files crabsody Debian 7 01-09-2007 04:48 AM
wine: exists lstat socket : No such file or directory hisnumber666 Linux - Software 1 05-02-2006 02:35 AM

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

All times are GMT -5. The time now is 12:09 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
Open Source Consulting | Domain Registration