Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

trouble everywhere

3 views
Skip to first unread message

Jack

unread,
Jan 21, 2004, 2:07:06 PM1/21/04
to
Please forgive me if I am asking this in the wrong forum. It seems
logical to me to ask here, but, hey, I seem to think a little
differently than most people.

Problem:
I am desperately trying to download and install the kernel sources for
my kernel

[jack@server SOURCES]# uname -a
Linux server 2.4.20-28.8 #1 Thu Dec 18 12:53:39 EST 2003 i686 i686
i386 GNU/Linux

I have retrieved the kernel source package from
http://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS/kernel-2.4.18-14.src.rpm
http://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS/kernel-utils-2.4-8.13.src.rpm
and patches up to 20-28 (I think)
I then ran "rpm -ivh" against everything

when I look in my /usr/src directory, I am expecting to see a
directory named linux-x.x.x.x or possibly a softlink labelled linux
but instead all I have is "redhat", when I navigate down into that
directory, then into a directory named SOURCES, I can't find any
source code, just loads of files which end in ".patch" or ".gz", Am I
suppossed to unzip/tar them myself ?

What is going on, what haven't I done, or what have I done wrong ?

If you want to simply redirect me to a web page which discusses the
procedure that would be fine as well, I can't seem to find any
sensible instructions that relate to RedHat kernel packages.

Thanks in advance

Kasper Dupont

unread,
Jan 21, 2004, 2:54:40 PM1/21/04
to
Jack wrote:
>
> Please forgive me if I am asking this in the wrong forum. It seems
> logical to me to ask here, but, hey, I seem to think a little
> differently than most people.
>
> Problem:
> I am desperately trying to download and install the kernel sources for
> my kernel
>
> [jack@server SOURCES]# uname -a
> Linux server 2.4.20-28.8 #1 Thu Dec 18 12:53:39 EST 2003 i686 i686
> i386 GNU/Linux
>
> I have retrieved the kernel source package from
> http://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS/kernel-2.4.18-14.src.rpm
> http://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS/kernel-utils-2.4-8.13.src.rpm
> and patches up to 20-28 (I think)
> I then ran "rpm -ivh" against everything

You need to know the difference between the kernel-source
rpm and the kernel source-rpm. I understand this can seem
a litle tricky at first, but I hope I can explain it so
you will understand.

A source-rpm is the package from which the rpm file is
build. So all this source-rpm files are normally named
%{name}-%{version}-%{release}.src.rpm (where %{something}
is replaced by the name and version of the package).

A source-rpm is basically just an archive with a few
files. Typically it contains the original .tar.gz file
which you would download from for example http://kernel.org/

In addition to the .tar.gz file it may contain a bunch
of patches and a .spec file. All these files are by
default installed in /usr/src/redhat/SOURCE except from
the spec file installed in /usr/src/redhat/SPECS. The
directories under /usr/src/redhat belongs to the
rpm-build package, which contains the tools that will
allow you to build a .rpm file.

The .src.rpm file may also contain a description of the
package, which is really originally generated from the
.spec file. The .src.rpm may also carry a digital
signature. Vendor packages normally do carry a digital
signature (always should).

The .spec file tells which files are needed to build
the package, and how to build the package. The rpmbuild
command is used to do this.

Given the .spec file rpmbuild can build either a .src.rpm
file, or one or more .rpm files. The .src.rpm is just a
package made up from the required files. While to create
the .rpm files rpmbuild must run configure, make, etc.
to end up with the compiled files, which are then put
into one or more .rpm files. It is quite normal that a
single .src.rpm file is used to build many .rpm files.
Often you will for example see both name-version.rpm and
name-devel-version.rpm where the later contains header
files and other files required to build programs against
a library, while the first one contains only the library
itself to use with compiled programs.

The kernel source-rpm is maybe the one resulting in the
largest number of different rpm files. It builds
different kernels for BOOT (to use on install disks),
uni processor, multi processor, big memory systems, and
also different architectures, i386, i586, i686, and
this actually gives a large number of possible combination
(though not every combination makes sense). One special
package build from the kernel source-rpm is the
kernel-source rpm, which is in some ways similar to a
-devel package. Though the kernel-source rpm contains the
full source where -devel packages normally only contains
header files. The kernel-source rpm is the one from
which /usr/src/linux* comes. It can be used if you want
to build your own kernel from the same sources, but with
a different configuration. It can also be used if you
just want to build modules for the installed kernel.

And I guess I should add this to the FAQ
http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#findsource

--
Kasper Dupont -- der bruger for meget tid paa usenet.
For sending spam use mailto:aaa...@daimi.au.dk
/* Would you like fries with that? */

Markku Kolkka

unread,
Jan 21, 2004, 6:41:58 PM1/21/04
to
Jack wrote:
> I am desperately trying to download and install the kernel sources for
> my kernel
>
> [jack@server SOURCES]# uname -a
> Linux server 2.4.20-28.8 #1 Thu Dec 18 12:53:39 EST 2003 i686 i686
> i386 GNU/Linux
>
> I have retrieved the kernel source package from
>
http://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS/kernel-2.4.18-14.src.rpm
>
http://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS/kernel-utils-2.4-8.13.src.rpm

Those are wrong pagckages. you need
http://updates.redhat.com/8.0/en/os/i386/kernel-source-2.4.20-28.8.i386.rpm

--
Markku Kolkka
markku...@iki.fi

Jack

unread,
Jan 22, 2004, 3:22:50 AM1/22/04
to
Ahaa !

Many thanks to both of you.

Seems strange that a directory with a name of SOURCE would not contain
'source code'.

The thing is, I am a developer - although most of my experience is
with Solaris and Win32, not Linux - and if I find this confusing, I
have no doubt many others are turned off by it completely.

Kasper Dupont

unread,
Jan 22, 2004, 6:24:24 AM1/22/04
to
Jack wrote:
>
> Ahaa !
>
> Many thanks to both of you.
>
> Seems strange that a directory with a name of SOURCE would not contain
> 'source code'.

Well, it does. The source code in SOURCE is just in
.tar.gz files and patches. And it of course only
contains those .src.rpm files you installed. And
you can build a kernel from the files in SOURCE,
but using /usr/src/linux* is easier.

0 new messages