LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-13-2003, 09:29 PM   #1
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Kernel compile questions


Sorry to have double-posted, but I'm not really sure what to do or where to ask.

Linux isn't running too well on my machine right now, and among other things, I am wanting to recompile my kernel.

Someone gave me some detailed instructions in another thread, but I can't seem to do what they suggested. Maybe because they're using Slack, as I am running RedHat 9. Or maybe not. Here's what I get following their instructions in the first couple of lines.

[root@Penguine CD_Burn]# cd /usr/src
[root@Penguine src]# ls -1
debug
linux-2.4
linux-2.4.20-8
redhat
[root@Penguine src]# cd /usr/src/linux
bash: cd: /usr/src/linux: No such file or directory

Does this mean I don't have a kernel installed? If so, how could it even run? And what should I do? I have downloaded linux-2.4.21-tar.bz2, but don't know what to do with it.

My objective is to remove services, or packages, or whatever that aren't needed. I'm at the point of reinstalling and choosing everything again, also to change my bootloader to use Grub to choose - right now I have to change boot devices in bios.

TIA for any help, or redirection.
 
Old 07-13-2003, 09:48 PM   #2
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Rep: Reputation: 30
Slackware has a link to the kernel source directory, red hat may not. /usr/src/linux is only a link to the actual directory, for example, here,

linux -> linux-2.4.18

Chuck your 2.4.21 tarball in /usr/src, de-tar it, and there's your "linux" directory there. Make your own link if you want to.
 
Old 07-13-2003, 09:49 PM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
You may not have the kernel sources but you've definitely got the kernal. *g* And, yeah, to recompile, you need the source. Just unzip that massive tarball in /usr/src and it'll create a Linux-blah-blah directory. 'cd' into that and have fun.

Oh yeah - and make a symlink called 'Linux' to the Linux-blah-blah in /usr/src. (I think I remember that right.)
 
Old 07-13-2003, 11:12 PM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Original Poster
Rep: Reputation: 129Reputation: 129
I did it and got an error message:

[root@Penguine src]# bunzip2 linux-2.4.21.tar.bz2

bunzip2: Data integrity error when decompressing.
Input file = linux-2.4.21.tar.bz2, output file = linux-2.4.21.tar

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

bunzip2: Deleting output file linux-2.4.21.tar, if it exists.


Do I need to download it again?

I have many *little problems* now. Too many procs running, too slow on boot, too slow running in Linux, some packages (such as pico) that I had before are gone, sound plays only through mic jack, I don't have dual boot setup in Grub (but change boot dev in bios to switch between RH & doze).

I am ready to format this hdd (Linux on one, Windoze on another) and do a new installation.

When this is done, I want to use the i686 version instead of i386, but can't find that anywhere.

TIA
 
Old 07-14-2003, 03:44 AM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Original Poster
Rep: Reputation: 129Reputation: 129
Hey guys,

There's actually 4 other dir in /usr/src/
debug, linux-2.4 (in italics with one green refresh type arrow), linux-2.4.20-8, and redhat.
The debug dir is empty.

The redhat dir has BUILD, RPMS, SOURCES, SPECS and SRPMS.
RPMS has athlon, i386, i486, i586, i686 and noarch. These last 6 are all empty.

I downloaded linux-2.4.21.tar.gz

Any suggestions?

Last edited by Bruce Hill; 07-14-2003 at 03:46 AM.
 
Old 07-14-2003, 03:52 AM   #6
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Did you download the kernel source in Windoze? If so, what browser? Often that can corrupt the file you are downloading, or at least decompress it.

Compare the size of your linux-2.4.21.tar.bz2 file with the stated size on the download site. Or better yet, go here: http://www.kernel.org/signature.html for information about verifying the kernel source files.

When or if you have the correct file, use the command:

tar -xjvf linux-2.4.21.tar.bz2

to decompress it. That will do the bunzip2 and untar in one operation and it will preserve the original file.

Oh, one other thing, in the command 'ls -l' the option is a lower case L, not a one. 1 is the number of columns in the listing, l (lower-case L) is for Long listing, and will give you more info about the files in the directory.

Enjoy!
--- Cerbere
 
Old 07-14-2003, 04:07 AM   #7
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
That's weird. I don't know why it couldn't find the directory if it was there. Either the symlink's screwed or the directory has root-only permissions or something. If you want to use the newer kernel, just unpack it and make sure the symlink points to it. f you want to use the source you've already got, make sure the symlink is pointing to it, instead, and make sure /usr/src/linux/etc. all has the right permissions. You wouldn't be allowed to cd if you didn't have execute permissions and would be told it didn't exist even though it does. Or you might be told 'permission denied'. And if, say, make couldn't find it, it would be because the symlink was pointing at, say, kernel 2.4.16 or something. *g* Of course, it could be something else, but those two seem the likeliest to me. As long as you unpack the new one as user and create the symlink, the new one should be correct.
 
Old 07-14-2003, 04:37 AM   #8
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Original Poster
Rep: Reputation: 129Reputation: 129
Quote:
Originally posted by digiot
That's weird. I don't know why it couldn't find the directory if it was there. Either the symlink's screwed or the directory has root-only permissions or something. If you want to use the newer kernel, just unpack it and make sure the symlink points to it.
That was one problem. Did this to fix the ownership problem, but I don't have a clue how to do anything about symlink, though I believe it's okay now.

[root@Penguine src]# chown -R servant.servant /usr
[root@Penguine src]# cd /usr/src
[root@Penguine src]# ls -l
total 62596
drwxr-xr-x 2 servant servant 4096 Jan 25 07:52 debug
lrwxrwxrwx 1 servant servant 14 Jun 29 07:44 linux-2.4 -> linux-2.4.20-8
drwxr-xr-x 16 servant servant 4096 Jun 29 07:43 linux-2.4.20-8
-rwxr-xr-x 1 servant servant 28533733 Jul 11 12:39 linux-2.4.21.tar.bz2
-rw------- 1 servant servant 35475346 Jul 14 15:36 linux-2.4.21.tar.gz
drwxr-xr-x 7 servant servant 4096 Jun 29 07:42 redhat

The bz2 was downloaded with windoze - and I was using the lower case L. I couldn't get to the site in either Mozilla or Knoqueror through Linux, or IE6 in Windoze. Finally, thinking it was blocked from here, I went behind a transparent proxy server in Windoze and got to the link - after 4 days of unsuccessful tries. That's why it was downloaded through doze - don't have stunnel setup in Linux - yet.

Okay. Now I will try again. But what I want to do is use the new kernel (linux-2.4.21.tar.gz) instead of the old one that's already there. I have a good set of instructions on building the kernel, but I am only guessing about how to use the new one versus the old one. Can you tell me how to do this, please?

TIA
 
Old 07-14-2003, 04:48 AM   #9
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
For a link, ln -s Linux-2.4.20-8 Linux should do it - or use mc, which is what I do beccause I can never remember which comes first. *g* That symlink is named Linux-2.4 and I think that's the problem. It should be just Linux.

To make a new one point to the new source, just do 'ln -s Linux-2.4.21 Linux. I'm not clear what other parts you need help with. I mean, you go through the configure process, compile, copy the kernel into boot, edit lilo.conf (if you use LILO) to point to the new kernel as default with the old one as a second choice (for backup), rerun LILO, reboot, and your new kernel should start. Precise details are fuzzy for me but should be in the docs.
 
Old 07-14-2003, 05:19 AM   #10
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Original Poster
Rep: Reputation: 129Reputation: 129
Thanks digiot. Who or what is SCO?

I will try and recompile now. Is renaming of the existing symlink to blah-blah.old necessary before I start, or will it be rewritten by the do 'ln -s Linux-2.4.21 Linux'? And isn't that file name case sensitive?
 
Old 07-14-2003, 05:30 AM   #11
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Maybe I should take that sig off. *g* If people don't know about them, they can be ignored like they should be. SCO is the Santa Cruz Operation (think that's what it stands for) which is the group claiming that IBM stole Unix code and stuck it in Linux and further claimed that Linux would suck if they hadn't done so. Which is pretty damned insulting to all the Linux hackers out here. There's a lot more to it than that, but that's one thing that particularly annoyed me.

I'm not sure - I believe the command will just replace the old symlink. If not, just delete the old one and make the new one. And, yeah, it's definitely case-sensitive. I don't have any kernel source on this particular system so I'm not sure but I think it's capitalized. Check the docs on that - the kernel source is *full* of documentation - and there should be something about that. Or maybe someone here can add to this. I'm about to wake up with keyboard face so I need to go get some sleep. Good luck!
 
Old 07-14-2003, 05:38 AM   #12
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Original Poster
Rep: Reputation: 129Reputation: 129
Thanks a million digiot.

I'm sitting down to dinner here, and will try it in a little bit. Afterwards, I'm going to reinstall, also. I got too many little things to iron out, and I want to get the bootloader right, too. But first, I will recompile so that when I do it right after the reinstall, I'll know what's going to happen.

Get some rest.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
2.6.10 kernel compile questions YBA^[x] Slackware 3 01-20-2005 02:54 PM
Several more questions about kernel compile? BajaNick Slackware 3 01-11-2005 07:59 AM
4 questions on a new 2.6.9 kernel compile? Slovak Linux - General 2 11-29-2004 06:08 AM
Kernel compile questions Alan Lakin Slackware 2 02-01-2004 10:05 PM
kernel compile questions e1000 Slackware 10 10-23-2003 11:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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