LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 08-29-2003, 10:44 PM   #1
LeechBot
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat 9
Posts: 25

Rep: Reputation: 15
where is version.h in 2.4.20-20.9 kernel?


the file /usr/src/linux-2.4/include/linux:/version.h is missing from my fully updated kernel 2.4.20-20.9, and i am unable to make a package that needs it. isn't this file standard? all the other .h files are there. can someone post a copy of the latest version.h? i tried hacking one up from a machine with an older kernel, but can't seem to configure it correctly.
 
Old 08-30-2003, 08:58 AM   #2
r00tnuke
Member
 
Registered: Aug 2003
Location: /earth/usa/texas/houston
Distribution: Fedora C2
Posts: 64

Rep: Reputation: 15
try in terminal...

slocate version.h | less

r00tnuke
 
Old 08-30-2003, 09:55 AM   #3
LeechBot
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat 9
Posts: 25

Original Poster
Rep: Reputation: 15
thanks. i found a copy of version.h in an unexpected location, at /usr/include/linux/version.h. it contains:

#define UTS_RELEASE "2.4.20"
#define LINUX_VERSION_CODE 132116
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

howerver, i get "Invalid kernel header" errors all over the place when i try to make a package that i was using with the last kernel. i'm re-making it cleanly, by the way.

the version.h from the previous kernel contains

#include <linux/rhconfig.h>
#if defined(__module__smp)
#define UTS_RELEASE "2.4.20-6smp"
#elif defined(__module__BOOT)
#define UTS_RELEASE "2.4.20-6BOOT"
#elif defined(__module__bigmem)
#define UTS_RELEASE "2.4.20-6bigmem"
#else
#define UTS_RELEASE "2.4.20-6"
#endif
#define LINUX_VERSION_CODE 132116
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

so I tried hacking up my own /usr/src/linux-2.4/include/linux/version.h as follows:

#include <linux/rhconfig.h>
#if defined(__module__smp)
#define UTS_RELEASE "2.4.20-20smp"
#elif defined(__module__BOOT)
#define UTS_RELEASE "2.4.20-20BOOT"
#elif defined(__module__bigmem)
#define UTS_RELEASE "2.4.20-20bigmem"
#else
#define UTS_RELEASE "2.4.20-20"
#endif
#define LINUX_VERSION_CODE 132116
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

but i still get "invalid kernel header" errrors when compiling this third party package. any clues? why did rh's version.h suddenly changel location and format?
 
Old 08-30-2003, 10:23 AM   #4
r00tnuke
Member
 
Registered: Aug 2003
Location: /earth/usa/texas/houston
Distribution: Fedora C2
Posts: 64

Rep: Reputation: 15
Here's my little kernel cheat sheet for RedHat. Hope this helps.

Upgrade & recompile a kernel steps
download
extract
linux
deps
menuconfig
mdcbmm
system
bzImage
mkinitrd
grub

Where to get the kernel source, http://www.kernel.org. Select F (which stands for Full source)
Then uncompress and extract the kernel source into /usr/src on your system:
cd /usr/src
bzcat linux-2.4.20.tar.bz2 | tar xvf -
Check for dependencies for and install as needed:

kernel-source-*
glibc-kernelheaders-*
cpp-*
ncurses
ncurses-devel-*
binutils-*
gcc-*
rpm -qa | grep “kernel-source”
Then create a symbolic link where linux-2.4.2x was the old link and linux-2.4.2x will be the new.

rm linux-2.4
ln -s linux-2.4.21 linux-2.4



If this is the first time you're building a kernel, start with the kernel configuration template that your system was built with:

cd /boot
ls config*
config-2.4.20-8
cp config-2.4.20-8 /usr/src/linux-2.4/.config

Then you can customize your kernel configuration by typing:

cd /usr/src/linux-2.4
make menuconfig

After customizing the kernel, you can build it:
make dep clean bzImage modules modules_install

Copy the system map and make symbolic link.

cd /usr/src/linux-2.4
cp -p System.map /boot/Sytem.map-2.4.21
rm System.map
ln -s System.map-2.4.21 System.map
What to do after you build a kernel. Copy the resulting kernel to the /boot directory with any name you'd like for it:

cp /usr/src/linux/arch/i386/boot/bzImage /boot/mynewkernel
Create your initrd image, where 2.4.21 is your /lib/2.4.21 directory:
mkinitrd /boot/mynewkernelimage.img 2.4.21

If your machine is configured to boot with lilo then edit /etc/lilo.conf, and add a reference to your new kernel. Look at other entries in /etc/lilo.conf to determine what disk shoud be used, etc. Here is a sample of what one might add to /etc/lilo.conf:
image=/boot/mynewkernel
label=mynewlabel
read-only
root=/dev/hda8
Then type: lilo
If your machine is configured to boot with grub then modify /boot/grub/menu.lst file. Here is an example for the /boot/grub/menu.lst file:
title Linux 2.4.20 with all my new configuration
root (hd0,0)
kernel /mynewkernel ro root=LABEL=/
initrd /initrdmnk.img

r00tnuke
 
Old 08-30-2003, 10:41 AM   #5
r00tnuke
Member
 
Registered: Aug 2003
Location: /earth/usa/texas/houston
Distribution: Fedora C2
Posts: 64

Rep: Reputation: 15
Cool I posted a kernel help for u

on another post here...
 
Old 08-30-2003, 02:39 PM   #6
LeechBot
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat 9
Posts: 25

Original Poster
Rep: Reputation: 15
hey, i'm not trying to recompile the kernel here. i'm just trying to reinstall the driver for my audio card under my working updated kernel. The recipe for the sound card's installation has been failing because it can't find this "version.h" file where that file used to be, and in the format the recipe's make expects. I just thought if i could hack up a new version.h file and toss it in the right dir, then linux wouldn't care and my sound driver installation recipe could complete. until i can create a functional version.h file in /usr/src/linux-2.4/include/linux/, the computer is soundless.

amazingly, though, i'm in the process of recompiling my kernel in order to install a new Matrox graphics card, so your kernel cheat sheet will be a big help with that. were you reading my mind?
 
Old 08-30-2003, 02:43 PM   #7
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
You need a symbolic link (/usr/src/linux) that points to your /usr/src/linux-<kernel version here> and Red Hat doesn't make that for you.

# Compiling/installing kernel modules
You will need to have installed:
1. The developmental packages (compiler)
2. The kernel source code that matches your running kernel
3. The module source or install code

Check out your system and look under the hood and see if you installed the stuff you need to do the job. Open an x terminal and type in this sequence of commands to see what kernel we are running and see if you have the kernel source installed:
Code:
[fancy@tinwhistle fancy]$ su -
Password: 
[root@tinwhistle root]# uname -r
2.4.18-3
I am running kernel version 2.4.18-3. Do I have the proper source code?
Code:
[root@tinwhistle root]# cd /usr/src
[root@tinwhistle src]# ls -alc
total 3
drwxr-xr-x    4 root     root          136 Jun 12 14:53 .
drwxr-xr-x   16 root     root          424 Jun  4 12:04 ..
lrwxrwxrwx    1 root     root           14 Jun  4 12:11 linux-2.4 -> linux-2.4.18-3
drwxr-xr-x   16 root     root          584 Jun  4 12:11 linux-2.4.18-3
drwxr-xr-x    7 root     root          168 Jun  4 12:08 redhat
[root@tinwhistle src]#
I do have the same kernel version source code installed in the directory /usr/src/linux-2.4.18-3 and there is a symbolic link named linux-2.4 pointing to it.

If you don't see something similiar to this (but in color), you will need to install the kernel source.

NOTE: I noticed that Red Hat didn't make the symbolic link /usr/src/linux that all of the INSTALL files that I have read mentioned that I need, so I may as well make one now to save editing the files in the source code to install.So, I'll make it just now:
Code:
[root@tinwhistle src]# ln -s linux-2.4.18-3 linux         
[root@tinwhistle src]# ls -alc
total 3
drwxr-xr-x    4 root     root          160 Jun 12 15:46 .
drwxr-xr-x   16 root     root          424 Jun  4 12:04 ..
lrwxrwxrwx    1 root     root           14 Jun 12 15:46 linux -> linux-2.4.18-3
lrwxrwxrwx    1 root     root           14 Jun  4 12:11 linux-2.4 -> linux-2.4.18-3
drwxr-xr-x   16 root     root          584 Jun  4 12:11 linux-2.4.18-3
drwxr-xr-x    7 root     root          168 Jun  4 12:08 redhat
[root@tinwhistle src]#
Ah, there it is, so that's done.

Next, did I install the compiler?
Code:
[root@tinwhistle src]# gcc -v          
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
[root@tinwhistle src]#
Yes, I have a compiler installed.

If you don't have those two things installed, you have to install them first off your install CD.

If they are installed, download the source and happy comiling. Make sure you carefully read the README and INSTALL files after extracting and before compiling/installing.
 
Old 08-30-2003, 06:03 PM   #8
LeechBot
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat 9
Posts: 25

Original Poster
Rep: Reputation: 15
i have all the stuff and the dir and link structure you posted here. i've installed this driver before. the problem is that the file version.h is not in the directory /usr/src/linux-2.4/include/linux/ in the kernel source for 2.4.20-20.9, and the driver i'm trying to install expects it to be there. /usr/src/linux-2.4/include/linux/ contains over 580 include files, and it's strange that one, version.h, has had its location changed.

i'm simply asking if anyone with a 2.4.20-20.9 kernel can verify the relocation of version.h from /usr/src/linux-2.4/include/linux/ to /usr/include/linux/. Those two dirs are not symbolically linked, and have different contents. my aim is to take the latest version.h file, give it a format similar to the version.h of previous kernels, then copy it to its old location so that my driver installer will find what it wants.

Last edited by LeechBot; 08-30-2003 at 06:04 PM.
 
Old 08-31-2003, 12:31 PM   #9
jaem
Member
 
Registered: Jun 2003
Location: Philippines
Distribution: Red Hat Linux 9
Posts: 56

Rep: Reputation: 15
drwxr-xr-x 6 root root 4096 Sep 1 01:00 .
drwxr-xr-x 15 root root 4096 Jul 29 15:41 ..
drwxr-xr-x 2 root root 4096 Jul 29 15:40 debug
drwxr-xr-x 4 root root 4096 Aug 21 18:42 linux-2.4.20-19.9
drwxr-xr-x 14 573 573 4096 Sep 1 01:02 linux-2.4.21
-rw------- 1 jaem jaem 28533733 Sep 1 00:58 linux-2.4.21.tar.bz2
drwxr-xr-x 7 root root 4096 Jul 29 15:56 redhat



this is what mine gave me..
i having trouble with my nvidia driver too. it says the kernel source is not yet installed for my current version. what should i do?

btw i have jsut installed the kernel source. 2.4.21, did i do the right thing? i cant seem to find my rpm of the kernel source 2.4.20-19.9 but still my kernel i s 2.4.20-20.9 and redhat did not have in the option of up2date to dl the kernel source for 20.9.

what should i do? the nvidia installer fo rmy video card needs to have the correct kernel source installed coz it cant find a preconfigured package for my current kernel.

Last edited by jaem; 08-31-2003 at 12:40 PM.
 
Old 08-31-2003, 05:27 PM   #10
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
# What is the running kernel and compiler installed
cat /proc/version

Put your kernel source tree in /usr/src/linux-<version number> and make sure the link /usr/src/linux points to that directory.

Last edited by fancypiper; 08-31-2003 at 05:29 PM.
 
Old 08-31-2003, 05:42 PM   #11
jaem
Member
 
Registered: Jun 2003
Location: Philippines
Distribution: Red Hat Linux 9
Posts: 56

Rep: Reputation: 15
Linux version 2.4.20-20.9 (bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Mon Aug 18 11:27:43 EDT 2003

"Put your kernel source tree in /usr/src/linux-<version number> and make sure the link /usr/src/linux points to that directory."

ammm how?? im a n00b.
 
Old 08-31-2003, 06:01 PM   #12
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Use your package manager and install the same kernel-source as you have running kernel.

redhat-config-packages
Chapter 33. Package Management Tool
Alternatives:
apt4rpm
Red Carpet

# Red Hat links
Red Hat Linux Manuals
Get your mp3 support here
Maximum RPM
rpmfind
Easier software management: apt4rpm - Red Carpet
Red Hat 8.0 Tips & Tricks

# Red Hat 7.3 down configuration commands
setup leads to several configuration tools

# Red Hat 7.3 up configuration commands
Configure soundcard:
redhat-config-soundcard
Configure X server:
redhat-config-xfree86
Configure network:
redhat-config-network
Manage software:
redhat-config-packages

# Handling NTFS
New Technology FileSystem (NTFS) HOWTOs
Linux NTFS project

Last edited by fancypiper; 08-31-2003 at 06:05 PM.
 
Old 08-31-2003, 06:51 PM   #13
LeechBot
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat 9
Posts: 25

Original Poster
Rep: Reputation: 15
uncle!

Gee, i'm in a bad spot here. a user posts multiple questions of his own about a separate problem in this thread, and a dialogue starts addressing that. Just when I was trying to get the focus back from instructions about recompiling kernels back to my original request for the contents, format, and location of the file version.h. I've never posted a "Why can't I get my question answered?" whine before, but if I just go ahead and ask my question again in a new thread, that looks bitchy too, but what other option is there?
 
Old 08-31-2003, 07:06 PM   #14
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
You never have mentioned your distro and I have never read about this problem with that kernel. Perhaps your distro's home page may have some info about stuff they change.

Quote:
Originally posted by LeechBot
i'm simply asking if anyone with a 2.4.20-20.9 kernel can verify the relocation of version.h from /usr/src/linux-2.4/include/linux/ to /usr/include/linux/. Those two dirs are not symbolically linked, and have different contents. my aim is to take the latest version.h file, give it a format similar to the version.h of previous kernels, then copy it to its old location so that my driver installer will find what it wants.
Apparently that didn't work, then.

I am out of ideas.

Basically, to install a driver module you will need to have installed:
1. The developmental packages (compiler)
2. The kernel-source code that matches your running kernel
3. The module source or install code
4. A symbolic link /usr/src/linux that points to /usr/src/kernel-<sourceversion>

Have you satisfied all 4 of these conditions?

Last edited by fancypiper; 08-31-2003 at 07:14 PM.
 
Old 08-31-2003, 07:18 PM   #15
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Thread hijack? Both questions are essentially, the same, installing of a kernel module.

Post the result of:

cd /usr/src
ls -a

and

cat /proc/version

Last edited by fancypiper; 08-31-2003 at 07:26 PM.
 
  


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
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
Kernel version Source Version mismatch after recompile chuckleberry Linux - Software 1 06-20-2005 06:37 PM
redhat fedora gcc version (compiled for 2.4.20) doesn't match kernel version 2.4.22 start1000 Linux - Software 0 03-16-2004 08:17 PM
Xfree prob radeon.o kernel module version is 1.1.1 but version 1.5.0 or newer needed. jimdaworm Slackware 0 10-01-2003 06:27 PM
Sample Driver Module incompatibility with Kernel version (or gcc version) jvs Linux - General 1 06-07-2002 01:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:47 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