LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2008, 02:08 AM   #1
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Rep: Reputation: 15
Installing Kernel Header files ?


Hello,

Can any one help me with installing the kernel header files ? My /usr/src is empty.

I want the following Note to be satisfied.

NOTE: The "make" process includes the kernel configuration
"/usr/src/linux/.config". In addition, the Linux file
rules.make is needed.

Best Regards.
 
Old 04-08-2008, 02:10 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Which system you're running on? And which is your exact kernel version? Try "uname -r" to find out.
 
Old 04-08-2008, 02:12 AM   #3
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Which system you're running on? And which is your exact kernel version? Try "uname -r" to find out.
I am running Kernel version 2.6.24.4-64.fc8 on Lenovo T61

Last edited by hemanth83_in; 04-08-2008 at 02:13 AM.
 
Old 04-08-2008, 02:26 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
On Fedora Core 8 you have to install the packages
Code:
kernel-devel-2.6.24.4-64.fc8.i686.rpm
kernel-headers-2.6.24.4-64.fc8.i386.rpm
that match exactly your kernel version. Please note that the first one is available for i586 and i686 architectures. Check the architecture of your currently installed kernel by issuing one (or both) of the following commands
Code:
uname -p
rpm -q kernel --qf "%{arch}\n"
 
Old 04-08-2008, 03:20 AM   #5
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Original Poster
Rep: Reputation: 15
I have installed the kernel header files but i dont understand the following:

1) How do i go to directory /usr/src
2) How do i create symbolic link that points the kernel sources by executing the command "ln -s <name header files> linux". A valid configuration for the system.
 
Old 04-08-2008, 03:50 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Open a terminal and issue the following commands as root
Code:
cd /usr/src
ls kernels
You will find a directory in kernels called 2.6.24.4-64.fc8-i586 (or something similar, depending on the architecture as I explained in my previous post). Anyway it should be the only one, after the installation of the kernel sources.

At this point you have to create a symbolic link to the kernel source directory in /usr/src and the link should be called linux, right? Do simply
Code:
ln -s kernels/2.6.24.4-64.fc8-i586 linux
again check the exact name of the source directory.
 
Old 04-08-2008, 04:07 AM   #7
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Original Poster
Rep: Reputation: 15
Thank you colucix. one more problem is im trying to install pcmcia module, I am finding problem in make KVER =2.6 comand. i opened the terminal logged in as root and had my installaion files in Root>>SRC>>and all the other files. At the end of this post you can see wat my system for "make KVER=2.6".




Installing the Linux WLAN Driver
-------------------------------------

NOTE: The installation instructions contain test specific and hardware
specific data. Therefore the described output may differ from that you
get.

The following prerequisites have to be met in order to install the Linux
WLAN driver:
- The CardBus-to-SDIO Adapter is not yet inserted in your system.
- Your Linux system has to be rebooted.

To compile the driver sources for kernel 2.4, proceed as follows:
1. Open a root-shell.
2. Go to the directory /src/.
3. Edit the .config file:
- KVER=2.4
- for 8385, please take config-8385 as example
- for 8686, please take config-8686 as example
4. Execute the command "make KVER=2.4".
You will then find the
- bus driver in the directory ./io/sdio/stdhost/mrvlsdio.o
- bus driver api in the directory ./io/sdio/sdioapi/sdioapi.o
- WLAN driver in the directory ./sd83xx.o
- The 3 drivers are finally duplicated in the directory /src/release2.4

To compile the driver sources for kernel 2.6, proceed as follows:
1. Open a root-shell.
2. Go to the directory /src/.
3. Edit the .config file:
- KVER=2.6
- for 8385, please take config-8385 as example
- for 8686, please take config-8686 as example
4. Execute the command "make KVER=2.6".
You will then find the
- bus driver in the directory ./src/release2.6/mrvlsdio.ko
- bus driver api in the directory ./src/release2.6/sdioapi.ko
- WLAN driver in the directory ./src/release2.6/sd83xx.ko

NOTE: The "make" process includes the kernel configuration
"/usr/src/linux/.config". In addition, the Linux file
rules.make is needed.

If the these files do not exist, proceed as follows:
1. Install the kernel header files.
2. Go to the directory /usr/src/.
3. Create a symbolic link that points to the kernel sources
by executing the command "ln -s <name header files> linux".
A valid configuration for your system is created.

To load the drivers, proceed as follows:
1. Open a root-shell.
2. Go to the directory /src/release2.4/ or /src/release2.6/.
3. Execute the "./up" script to load the drivers


%%%%%%%%%%%%%%i am confused when using command make KVER=2.6.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[root@wireless src]# make KVER=2.6
make -C M=/root/src modules
make: *** M=/root/src: No such file or directory. Stop.
make: *** [default] Error 2
[root@wireless src]#


Sorry for asking silly Questions and thanks for the patiance.

Last edited by hemanth83_in; 04-08-2008 at 04:09 AM.
 
Old 04-08-2008, 04:53 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Code:
[root@wireless src]# make KVER=2.6
make -C M=/root/src modules
make: *** M=/root/src: No such file or directory. Stop.
make: *** [default] Error 2
I think the problem is not about passing KVER=2.6 to make, but I suspect a mis-configuration of the makefile. The command
Code:
make -C M=/root/src modules
tries to change to directory "M=/root/src" not simply "/root/src" and obviously it is not found. You can look at the makefile and try to figure out where the "M=" comes from.

Just out of curiosity: which exact driver are you trying to install? Are you sure it is not already built in your kernel?
 
Old 04-08-2008, 05:20 AM   #9
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Original Poster
Rep: Reputation: 15
I am installing the Murata WI-FI module and the drivers are not built in the kernel, and i am using a PCMCIA card.
I checked the Makefile but i could not see where "M=" comes from. Do you have any other suggestions?

How about the file rules.make, does it make any difference?

Last edited by hemanth83_in; 04-08-2008 at 05:23 AM.
 
Old 04-08-2008, 07:50 AM   #10
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Original Poster
Rep: Reputation: 15
You could see my Makefile:
Quote:

# File: Makefile
# Copyright Marvell International Ltd. and/or its affiliates, 2003-2006


CONFIG_FILE := $(PWD)/.config
-include $(CONFIG_FILE)

TOOLPATH_MONAHANS= /usr/local/arm/3.3.2/bin
TOOLPATH_BULVERDE= /usr/local/arm/3.3.2/bin
TOOLPATH_iMX21= /usr/local/arm/3.3.2/bin
TOOLPATH_OMAP= /usr/local/arm/3.3.2/bin
TOOLPATH_MIPS= /opt/toolchain/mipsout/bin

BUILD_ENV_SCMA11= /usr/local/arm/3.4.3/v6_vfp_le
TOOLPATH_SCMA11= $(BUILD_ENV_SCMA11)/bin/





CFLAGS += -I$(PWD)/os/linux
CFLAGS += -I$(PWD)/wlan



# Otherwise we were called directly from the command line; invoke the kernel build system.
else

ifeq ($(KVER),2.6)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
@if [ ! -w $(PWD)/release2.6 ] ; \
then mkdir $(PWD)/release2.6 ; \
fi
mv *.ko $(PWD)/release2.6
@echo "----------------- WLAN modules kernel 2.6 built ----------------"
endif

endif

# End of file


dispconfig:
@echo CONFIG_FILE = $(CONFIG_FILE)


Its only a small part of Makefile.
There are some 4 lines in red where you could fine "M=". I think its actually finding the kernel directory.. wat is your suggestion???

Thank you again

Last edited by hemanth83_in; 04-08-2008 at 07:52 AM.
 
Old 04-08-2008, 08:12 AM   #11
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Are you trying to make something with an older version of GCC(3.3.2 vs 4.1.2)? The distro is pretty much tied to a specific version of GCC.
 
Old 04-08-2008, 08:54 AM   #12
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by lazlow View Post
Are you trying to make something with an older version of GCC(3.3.2 vs 4.1.2)? The distro is pretty much tied to a specific version of GCC.
I am using 4.1.2. Wat do ya say?
 
Old 04-08-2008, 09:08 AM   #13
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Quote:
TOOLPATH_MONAHANS= /usr/local/arm/3.3.2/bin
Would suggest GCC 3.3.2
 
Old 04-09-2008, 02:04 AM   #14
hemanth83_in
LQ Newbie
 
Registered: Feb 2008
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by lazlow View Post
Would suggest GCC 3.3.2

How do i get back to 3.3.2 version of GCC ?
 
Old 04-09-2008, 02:26 AM   #15
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Code:
ifeq ($(KVER),2.6)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
@if [ ! -w $(PWD)/release2.6 ] ; \
then mkdir $(PWD)/release2.6 ; \
fi
mv *.ko $(PWD)/release2.6 @echo "----------------- WLAN modules kernel 2.6 built ----------------"
endif
hemanth83_in, I think you've found where the problem comes from. It looks like the KERNELDIR variable is not properly assigned in the Makefile (and left empty). The resulting command line should be something like
Code:
make -C /usr/src/linux M=/root/src modules
but since the value of KERNELDIR is null, it generates a wrong make command. Try to investigate further.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing kernel header files for old kernel skibud2 Linux From Scratch 2 01-13-2008 11:31 PM
installing header files Svajje Linux - Newbie 4 04-10-2006 04:02 PM
Kernel Header Files apocolpse SUSE / openSUSE 3 11-19-2004 12:48 PM
What/where are kernel header files? Toker Linux - General 5 09-29-2003 11:16 PM
installing a VPN client - needs kernel header files mehlkelm Linux - Software 1 06-11-2003 03:01 AM


All times are GMT -5. The time now is 10:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration