LinuxQuestions.org
Visit Jeremy's Blog.
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 11-04-2003, 03:59 PM   #1
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Rep: Reputation: 30
Angry Why cant I compile my kernel?


So I just finished up a fresh install of Linux, and I was going to compile a new kernel with ACPI and I2C sensors in it. I download the full source of the 2.4.22 kernel. Mandrake comes with the 2.4.21-0.13mdk. I unzipped and untared the kernel, which is still in my home directory. I cd'ed into the linux-2.4.22 directory and started with "make mrproper" and it spit out something like

No target for "make mrproper" Stop.

What does this mean? I looked in usr/src and there is no folder labeled linux in there either. I dont get it. What am I doing wrong?
 
Old 11-04-2003, 04:08 PM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
No target for "make mrproper" Stop.
Well, strictly speaking, make mrproper isn't absolutely required to compile your own kernel. You can safely skip that step, in fact I always do. Now if you get that when you try "make menuconfig" or "make xconfig" (if you're in X) you've got a problem.

Quote:
I looked in usr/src and there is no folder labeled linux in there either
Well, if you unpacked the source code in your home directory, you aren't going to find anything in /usr/src. And usually the /usr/src/linux directory is a symlink to whereever you do have the source code. So in your case, if you unpacked the source code in your home directory, and you plan on leaving it there, you could create the link in /usr/src like this:

ln -s /home/username/linux-2.4.22 linux
 
Old 11-04-2003, 05:00 PM   #3
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
I cant do "make xconfig" or anything else. I dont know why.
 
Old 11-04-2003, 05:20 PM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Well, the good news is that there really is only a couple of explanations: Something went wrong with the kernel source download or something went wrong with the untarring.....So lets take it from the top.

1)What file did you download?

2) How did you unpack it?

3) What happened when you unpacked it?

4) What is the result of ls in the linux-2.4.22 directory?
 
Old 11-04-2003, 05:34 PM   #5
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
I downloaded the 2.4.22 full source. I bunzip2 the zipped file, then tar -xvf the tarball. All went well. Ill post the ls of the linux directory momentarily.
 
Old 11-04-2003, 05:39 PM   #6
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
arch/ Documentation/ init/ MAINTAINERS mm/ Rules.make
COPYING drivers/ ipc/ makefile net/ scripts/
CREDITS fs/ kernel/ Makefile README
crypto/ include/ lib/ Makefile~ REPORTING-BUGS

All that is in the file.
 
Old 11-04-2003, 05:41 PM   #7
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
make: *** No rule to make target `mrproper'. Stop.

make: *** No rule to make target `xconfig'. Stop.

Thats what I get when I try to do the other stuff.
 
Old 11-04-2003, 05:42 PM   #8
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
Now I cant get rid of that kernel source so I can start over either. It wont let me delete it.
 
Old 11-04-2003, 06:00 PM   #9
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Rep: Reputation: 15
You're running as root, correct?
If not, you'd better log in as root and try again from the top!
 
Old 11-04-2003, 06:04 PM   #10
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Now I cant get rid of that kernel source so I can start over either. It wont let me delete it.
That's probably a permissions issue. If you unpacked it as root, it could be that its owned by root and you have to be su or root to get rid of it. You can always ls -l to find out who owns the files.

Actually, your directory looks to be correct and since Makefile is present, I'm confused as to why you are getting the "No rule" error messages. If it was a permissions issue, you would get a permission denied error, not a No rule error. And just to ask the brutally obvious question, when you enter make mrproper or make xconfig you are in the linux-2.4.22 directory, right? Also, have you been able to compile programs from source before? If you are in the right directory and you have been able to compile, the only thing I can think is that your Makefile is hosed.

Here is a tip: to exatract and untar a .bz2 file, you can do it with one command tar -xjvf filename.bz2. tar -zxvf works on .tar.gz files.
 
Old 11-04-2003, 06:06 PM   #11
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
You're running as root, correct?
If you unpacked the tarball as a user, you shouldn't have to be root to compile a kernel. You would have to be root to install it though.
 
Old 11-04-2003, 06:09 PM   #12
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
Ok, heres what I have done. I unzipped the first one as root. Now I cant get rid of it, so i was resourceful, and moved it. Downloaded a new kernel source. Bunzip2, then tar -xvf while im still in my home directory. Im running all of this as root this time. So far no problems. I dont know what was wrong the first time, but that kernel source is sitting in my home directory, and I still cant get rid of it.

Also, to answer your questions, I am root, in the linux-2.4.22 directory, but I havent simlinked to usr/src yet. Should I do that now or after compile? Ive laredy started compiling again. Im on make dep now.
 
Old 11-04-2003, 06:31 PM   #13
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
Ok, it still booted onto my old kernel. the stock kernel. What am I doing wrong? this is so frustrating
 
Old 11-04-2003, 07:01 PM   #14
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Rep: Reputation: 15
Yeah, I wasted 2 days figuring out how to recompile the kernel, after about 10 attempts. I kept on leaving important things out of it like the ext3 file system and SCSI drivers etc... but I digress.

If you are root, you should be able to delete the kernel you stuck in your root directory... you are root, after all. just 'rm -rf /linux-2.4.22' or whatever.
There's no way you should be getting 'Permission Denied'.

Before running the 'make xconfig' or 'make dep', I usualy do 'make clean' 'make mrproper' 'make clean' inside the new kernel directory.... and that usually cleans out the crap.
After that I copy the old .config from the old kernel directory into this new one
Then I do 'make xconfig' and make sure I have all the important stuff in the kernel. If you're missing important things (like support for the ext3 file system, if you are using it), you'll get a Kernel panic when you try and start the new kernel... and you'll have a hell of a time trying to figure out what's not working from the kernel panic.

I'm assuming here than you backed up your old kernel configuration. I had MAJOR problems learning this. The old kernal configuration is in the old kernel directory as a hidden file (called '.config'). It helps if you copy that file into your new kernel directory AFTER you have done make clean, make mr proper, make clean. Then when you start make xconfig, most of the kernel features from your old kernel will be in your new kernel. You might also want to back up the .config file into the /boot directory as well for safekeeping.

When it comes time for 'make bzImage', the kernel howto wants you to do it with a no-hangups option (nohup) so you do 'nohup make bzImage &' and let that crank away for half an hour or so. You should get a log file in the new kernel directory (called 'nohup.out' I think) which details the progress of the make. You can watch it in a new window with the 'tail' command, eventually it will stop.

While it's doing that, let rip with "nohup make modules 1> modout 2> moderr &", and it will process all the bit you wanted as modules in the kernel (as opposed to bits that you wanted built-in to the kernel). Once the bzImage is done, and if there is no errors in the moderr file, then you do your make modules_install.

Keep trying. It took me forever to figure out how to do this, and it's one of the harder things to do in Linux.
 
Old 11-04-2003, 07:03 PM   #15
Kramer
Member
 
Registered: Aug 2003
Location: Somewhere south of sanity...
Distribution: Mandrake 9.1
Posts: 550

Original Poster
Rep: Reputation: 30
ok, everything is compiled, but when i try to point LILO at my new kernel, which is symlinked in /boot, and i run "lilo" in prompt it gives me
Fatal: Kernel /boot/vmlinux is too big

 
  


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
upgraded kernel, won't let me compile kernel once Suspend2 patches are applied microsoft/linux Linux - Laptop and Netbook 3 10-02-2005 02:37 PM
I want to compile 2.6 kernel and keep everything from 2.4 intact (dual kernel system) sina_kish Linux - Software 7 02-02-2005 09:01 AM
Kernel Problems. Howto Compile a new kernel from 4.2 with backwards compatibility ? ShoCkwave Linux - General 2 06-19-2004 06:02 AM
can i compile just one kernel module whithout recompiling the whole kernel? edman007 Linux - Software 3 02-17-2004 03:05 PM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 01:40 PM

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

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