LinuxQuestions.org
Review your favorite Linux distribution.
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 08-28-2003, 04:15 PM   #1
Bullzeye
Member
 
Registered: Aug 2003
Location: Florida
Distribution: DEBIAN 3.x
Posts: 34

Rep: Reputation: 15
installig kernel source with debian


Does anyone know of a good place to find a "step by step" manual on how to install Kernel-source and all other developent pkgs needed to install drivers etc? I also am booting from floppy b-cuz I can't seem to get lilo to work right. I've tried the following but:

# Debian links
Installing Debian GNU/Linux 3.0 For Intel x86
The Very Verbose Debian 3.0 Installation Walkthrough
Debian Package Management HOWTO Version 1.1

# 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.

WHEN I GET HERE THE DIRECTORY IS EMPTY, I DID APT-GET INSTALL KERNEL-SOURCE-2.4.18 AND IT PUT THE TAR FILE HERE. THEN i UNTARRED IT WITH TAR -XVJF AND IT UNPACKED IT TO A DIRECTORY IN HERE. THEN, i DID MAKE OLDCONFIG THEN MAKE DEP THAT IS AS FAR AS i GET. i DONT KNOW WHAT TO DO NEXT (MUCH LESS IF I DID THAT RIGHT)


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.

Last edited by Bullzeye; 08-28-2003 at 04:16 PM.
 
Old 08-28-2003, 04:29 PM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
kernel-source is expected to be found in the directory /usr/src/linux-<kernel version number here>

Extract the tarball to /usr/src or move the directory /where/you/extracted/tarball/linux-<kernel version number here> to the proper place. Then as a result, you should have a directory /usr/src/linux-<kernel version number here> and you can do ln -s /usr/src/linux-<kernel version number here> /usr/src/linux

I would have thought that the command:
apt-get install kernel-source
should do all this stuff automatically.

It will in Red Hat.


Last edited by fancypiper; 08-28-2003 at 04:33 PM.
 
Old 08-28-2003, 05:44 PM   #3
vrooje
Member
 
Registered: Aug 2003
Posts: 32

Rep: Reputation: 15
I'm having problems with this also... definitely a linux (redhat) newbie. So far I just installed basically all the defaults on the install CDs and installed the /usr/local/ directory CD given to me by my department sysadmin (I'm a grad student).

Here's what uname -a gives me:
Linux dhcppc2 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 unknown

Anyway, I want to install my sound card -- an Aureal au8830 -- but the "make install" command keeps giving me compiler errors, the first few lines of which are:

gcc -D__KERNEL__ -DMODULE -DAU8830 -O -Wall -pipe -m486 -I/lib/modules/2.4.18-3/build/include -O2 -fomit-frame-pointer -c -o vortex.o vortex.c
In file included from vortex.c:45:
/lib/modules/2.4.18-3/build/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace
In file included from vortex.c:57:
/lib/modules/2.4.18-3/build/include/linux/string.h:8:2: warning: #warning Using kernel header
[root@dhcppc2 au88xx-1.0.5]# gcc -o vortex.o vortex.c
In file included from vortex.c:45:
/usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace
In file included from /usr/include/linux/timex.h:152,
from /usr/include/linux/sched.h:14,
from vortex.c:59:
/usr/include/asm/timex.h:10:21: asm/msr.h: No such file or directory
In file included from vortex.c:60:
/usr/include/linux/delay.h:13:23: asm/delay.h: No such file or directory
vortex.c:68:25: asm/uaccess.h: No such file or directory
[root@dhcppc2 au88xx-1.0.5]# make install
cc -D__KERNEL__ -DMODULE -DAU8830 -O -Wall -pipe -m486 -I/lib/modules/2.4.18-3/build/include -O2 -fomit-frame-pointer -c -o vortex.o vortex.c
In file included from vortex.c:45:
/lib/modules/2.4.18-3/build/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace
In file included from vortex.c:57:
/lib/modules/2.4.18-3/build/include/linux/string.h:8:2: warning: #warning Using kernel header in userland!
In file included from vortex.c:53:
/lib/modules/2.4.18-3/build/include/linux/module.h:61: parse error before `atomic_t'

Anyway, /usr/src/ only had the directory redhat/ in it, which didn't seem that useful, so I made directories/links from /usr/src/linux/include and /usr/src/linux-2.4.18-3/include to /usr/include/ because that was the only place I found any include files.

From reading a bit around here, though, it seems that I shouldn't have had to make those directories (e.g. /usr/src/linus-2.4.18-3/) myself. So how do I get linux to install the kernel source and utils and whatever else I need?

Sorry, I'm just a complete newbie at this and would really appreciate the help.

Thank you!
-vrooje
 
Old 08-28-2003, 05:58 PM   #4
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Quote:
Originally posted by vrooje
I'm having problems with this also... definitely a linux (redhat) newbie. So far I just installed basically all the defaults on the install CDs and installed the /usr/local/ directory CD given to me by my department sysadmin (I'm a grad student).

<snip>

So how do I get linux to install the kernel source and utils and whatever else I need?
Have you tried the package management tool?

redhat-config-packages

If you can't figure it out with that, I recommend installing apt4rpm and then commanding:

apt-get install kernel-source

Or, install Red Carpet, subscribe to the Red Hat channel and install through that.

# 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
 
Old 08-28-2003, 06:33 PM   #5
vrooje
Member
 
Registered: Aug 2003
Posts: 32

Rep: Reputation: 15
I'm running KDE, so I went into the Package Manager (KPackage) and searched for "kernel" and found one match, the Linux Kernel, under Kernel/Kernel, which is installed. I searched for "source" and found nothing. I searched for just "kern" and also found glibc-kernheaders, which is also installed.

So I downloaded apt4rpm and ran ./configure, then make, then make install. I got one error during "make" which involved my not having installed "help2man," but it didn't look critical:

Making all in server
make[1]: Entering directory `/usr/local/apt4rpm-0.65.1/server'
Making all in methods
make[2]: Entering directory `/usr/local/apt4rpm-0.65.1/server/methods'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/apt4rpm-0.65.1/server/methods'
make[2]: Entering directory `/usr/local/apt4rpm-0.65.1/server'
/bin/sh /usr/local/apt4rpm-0.65.1/missing --run help2man -I aptate.x -N -s 8 ./aptate > aptate.8
/usr/local/apt4rpm-0.65.1/missing: help2man: command not found
WARNING: `help2man' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
`Help2man' package in order for those modifications to take
effect. You can get `Help2man' from any GNU archive site.
make[2]: *** [aptate.8] Error 1
make[2]: Leaving directory `/usr/local/apt4rpm-0.65.1/server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/apt4rpm-0.65.1/server'
make: *** [all-recursive] Error 1


Then again, what do I know? After installing, typing apt-get install kernel-source doesn't work; Linux can't find the command.

If I then go into the apt4rpm-##/client/ directory and just type apt, well, it pauses for a moment and then brings me back to the prompt. I then typed
apt -get install kernel-source
and it brought me back to the prompt, but then a minute or so later, I got the message
apt: apt-get: command not found

I can't find a straight command called apt-get anywhere in the directories installed when I "installed" apt4rpm.

It's just a freeking soundcard I want to install. Ach!

Any ideas?
-vrooje
 
Old 08-28-2003, 06:47 PM   #6
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
I wouldn't pick out source code until you get the stuff needed to handle it installed.

It would be much easier for you to download the two rpms for your Red Hat release version and install those.

Click the download link, and scroll down to:

Binary packages for RedHat can be found here (look for the called section: "How do I use the repository (RedHat 6.2 instructions)?")

Find 2 rpms for your release and put into /home/<user>/rpms,

Open an x terminal and type
su -
<give root password and press enter>
cd /home/<user>/rpms
rpm -Uvh *.rpm
apt-get install synaptic
Now you should have a pointy-clicky (GUI interface) to apt-get. Use that (it should show up on a menu somewhere, otherwise type synaptic in the x terminal)
or type
atp-get install kernel-source
 
Old 08-28-2003, 07:30 PM   #7
vrooje
Member
 
Registered: Aug 2003
Posts: 32

Rep: Reputation: 15
Ooh - definitely getting closer!

Sigh... but not there yet; here is what it does:

[dhcppc2 rpms]# apt-get install synaptic
Processing File Dependencies... Done
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package synaptic

[dhcppc2 rpms]# ls
apt-0.3.19cnc55-4sp_rh7x.i386.rpm apt-devel-0.3.19cnc55-4sp_rh7x.i386.rpm
apt-0.3.19cnc55-4sp_rh7x.src.rpm

[dhcppc2 rpms]# apt-get install kernel-source
Processing File Dependencies... Done
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package kernel-source

Unfortunately, since I have no idea how this works, I also have no idea how to make it find these packages.

...I have hope, though!

-vrooje the utter and complete newbie

 
Old 08-28-2003, 10:29 PM   #8
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
From the download page:
Quote:
Next, install the APT-RPM package on your system: get the binary RPM here. The source RPM package, should you need it, can be found here.

Next, edit /etc/apt/sources.list and add the relevant lines for your distribution. For example, my /etc/apt/sources.list contains:

rpm ftp://apt-rpm.tuxfamily.org/apt redhat-updates-6.2/redhat os powertools
rpm ftp://apt-rpm.tuxfamily.org/apt redhat-extra-6.2/redhat extra
rpm-src ftp://apt-rpm.tuxfamily.org/apt redhat-updates-6.2/redhat os powertools
rpm-src ftp://apt-rpm.tuxfamily.org/apt redhat-extra-6.2/redhat extra


Run apt-get update (two times because of a bug in apt), then apt-get dist-upgrade or apt-get install foo...
Did you

apt-get update

first?

Debian Package Management HOWTO Version 1.1

Last edited by fancypiper; 08-28-2003 at 10:38 PM.
 
Old 08-28-2003, 11:39 PM   #9
vrooje
Member
 
Registered: Aug 2003
Posts: 32

Rep: Reputation: 15
DOH! It is such bad form to fail to read the directions fully and then ask stupid questions about them. RTFM, silly vrooje.

Anyway, it apprears to be updating now and looks like it will be for some time to come.

Thank you so much!
-vrooje
 
  


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
Debian woody-wheres my kernel source ? da_zombie Linux - Software 1 10-17-2004 09:22 AM
how to link to kernel source for Debian ndiswrapper installation case1984 Linux - Newbie 0 09-10-2004 10:32 AM
how to properly install kernel source in Debian ? kix_vn Debian 8 03-20-2004 01:30 PM
Debian kernel source tenn_eric Linux - Hardware 2 05-29-2003 10:25 PM
Debian kernel source Jack Lord Linux - Distributions 4 11-10-2002 05:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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