LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-29-2005, 12:58 PM   #1
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Rep: Reputation: 35
how to start configuring the kernel when compling.


hi i am trying to compile a kernel and im following a linux admin book as a guide. this is what i have done so far.
1. downloaded the kernel source
2. made a directory for the source named linux-2.6 in /usr/src and unpacked it there.
3. made a symlink as /usr/src/linux-2.6 as the target and linux as the link name.

now it is saying i need to do make xconfig but when i do that i get this error message.

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

so i assume i need to tell it what to target. Do i have to say something like make xconfig /usr/src/linux?

i also want to know if this is a good guide to follow as it said there would be a dir named linux in /usr/src but my current dir was named specific to the version. thanks for any help in advance. I appreciate it.
 
Old 04-29-2005, 01:05 PM   #2
kimx
Member
 
Registered: Dec 2004
Location: Denmark
Distribution: Yoper 2.2, Source Mage, Ubuntu 5.04, Slackware 10.1
Posts: 70

Rep: Reputation: 16
You need to be in the direktory /usr/src/linux-2.6 when you try to do
Code:
make xconfig
the direktory your guide talks about is normally a link to the the direktory were you got the kernel sources that you are currently using, in you system you could make the link point to /usr/src/linux-2.6.
 
Old 04-30-2005, 11:21 AM   #3
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
ok i was able to compile the kernel successfully and install it but now im having trouble with the initrd img. i created it using /sbin/mkinitrd and it is in my /boot dir. when i configured grub i just copied and pasted the entry for my old kernel and changed the name of the kernel and initrd file because they are in the same place. but when i try to boot it i get the error 15: file not found for the initrd img. here is my grub.conf file

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda2
default=0
timeout=30
splashimage=(hd0,1)/grub/splash.xpm.gz
title Fedora Core (2.6.10-1.771_FC2)
root (hd0,1)
kernel /vmlinuz-2.6.10-1.771_FC2 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.10-1.771_FC2.img
title Fedora Core (2.6.10-1.770_FC2)
root (hd0,1)
kernel /vmlinuz-2.6.10-1.770_FC2 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.10-1.770_FC2.img
title Fedora Core (2.6.5-1.358)
root (hd0,1)
kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.5-1.358.img
title Windows XP Pro
rootnoverify (hd0,0)
chainloader +1
title Fedora Core 2 original
root (hd1,0)
kernel (hd1,0)/boot/vmlinuz-2.6.5-1.358 ro root=/dev/hdb1 rhgb quiet
initrd (hd1,0)/boot/initrd-2.6.5-1.358.img
title Fedora Core 2 custom
root (hd0,1)
kernel (hd0,1)/boot/vmlinuz-custom ro root=LABEL=/ rhgb quiet
initrd (hd0,1)/boot/initrd-2.6.0.img
note: i tried the absolute path last and even the kernel was not found.

The Fedora Core 2 custom entry is the one i am trying to get to boot. first what i tried was copying the (2.6.5-1.358) entry and just editing the kernel and initrd line so the new kernel and initrd were reflected. Im not entirely sure why it can't find the initrd file. here is what is in my /boot dir:

. initrd-2.6.10-1.770_FC2.img System.map-custom
.. initrd-2.6.10-1.771_FC2.img vmlinuz-2.6.10-1.770_FC2
config-2.6.10-1.770_FC2 initrd-2.6.5-1.358.img vmlinuz-2.6.10-1.771_FC2
config-2.6.10-1.771_FC2 lost+found vmlinuz-2.6.5-1.358
config-2.6.5-1.358 System.map-2.6.10-1.770_FC2 vmlinuz-custom
grub System.map-2.6.10-1.771_FC2
initrd.2.6.0.img System.map-2.6.5-1.358

and the output of df in case it helps:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 22639260 9572328 11916908 45% /
/dev/hda2 47584 13198 31917 30% /boot
none 128568 0 128568 0% /dev/shm

i noticed there is not a config-2.6.0 for my new kernel. Is that why it is not finding the initrd? if so how do i create that file? thanks for any help in advance. i appreciate it.
 
Old 04-30-2005, 01:19 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
you just got it pointed in the wrong direction

you got

title Fedora Core 2 original
root (hd1,0)

title Fedora Core 2 custom
root (hd0,1)

if those two thing are suposed to be the same place they are not

then there is
title Fedora Core (2.6.10-1.771_FC2)
root (hd0,1)
kernel /vmlinuz-2.6.10-1.771_FC2 ro root=LABEL=/ rhgb quiet

title Fedora Core 2 custom
root (hd0,1)
kernel (hd0,1)/boot/vmlinuz-custom ro root=LABEL=/ rhgb quiet


if those two things are suposed to be the same they are also not
 
Old 04-30-2005, 10:53 PM   #5
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
im sorry i should have been a little clearer. The fedora core original is on hdb so that is why those two are different. The rest of the entries are on hda. here is the contents of my boot dir. (easier to read this time)

config-2.6.10-1.770_FC2
config-2.6.10-1.771_FC2
config-2.6.5-1.358
grub
initrd.2.6.0.img
initrd-2.6.10-1.770_FC2.img
initrd-2.6.10-1.771_FC2.img
initrd-2.6.5-1.358.img
lost+found
System.map-2.6.10-1.770_FC2
System.map-2.6.10-1.771_FC2
System.map-2.6.5-1.358
System.map-custom
vmlinuz-2.6.10-1.770_FC2
vmlinuz-2.6.10-1.771_FC2
vmlinuz-2.6.5-1.358
vmlinuz-custom

kernel/initrd 2.6.5-1.358 is the kernel i currently use (the 2.6.10s are results of updates) The custom vmlinuz is the kernel i compiled and initrd.2.6.0.img is it's initrd. As you can see they are both in the same directory. So when i edited grub i just copied the entry for the 2.6.5-1.358 and changed the kernel and initrd to the newly compiled kernel so it looked like this.

title Fedora Core 2 custom
root (hd0,1)
kernel /vmlinuz-custom ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.0.img
This seemed logical to me because both kernels and initrd exist in the same path so it perplexes me that grub can find the initrd for my current kernel but not for my new one. That is what i need help understanding. At first i thought it was because of a spelling error but that didn't seem to be the case. I also noticed that all the other kernels have a corresponding config-version# file in the /boot/ dir. I didn't know if my new kernel not having one was causing the problem and if so how i'd go about creating a config file for it. thanks for any help.
 
Old 05-01-2005, 09:15 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The config-<version> files are a convenient place to backup the .config files for each kernel version. They aren't needed to boot up.

You could try booting from the grub shell. Use auto-completion to make sure that the spelling is correct.

Also, since you were configuring a new kernel, sometimes what is done is to copy the .conf file for a kernel you are using to the new source, and running "make oldconfig". It will copy the options from the old configuration and prompt you in areas where there are new options. After that you can fine tune it in 'make xconfig' or 'make gconfig'.

If you instead manually edit the .config file, running "make oldconfig" will validate the new configuration file for errors.
 
Old 05-02-2005, 01:29 AM   #7
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
ok i have been successful - some what... First off what i did was do make install in the source directory. That book i used never mentioned having to do that step. When i tried to boot it up it found both the kernel and initrd images, but i got a kernel panic message which reads as:

Kernel panic: VFS: unable to mount root fs on unknown-block(0,0)

so i googled it and found a forum discussing the topic because someone was having a similar error message. One replier suggested changing the kernel line so instead of root=LABLEL to root=/dev/hdpartionofroot

i did that and the kernel loaded up. However i clicked the tab to show details of the booting process and no details were shown. I got into fedora and opened a terminal cuz i was going to do uname to see if it was indeed the new kernel but the terminal prompt user@localhost$ (or however it is shown can't see it for reference) is not there and it is just a blinking cursor.

(SituationA - note for later reference) Here is what i think happened. Something happened with the initrd image so that it didn't load up my stuff. To me this would explain why no details were shown during boot because no services were being started or if they were not verbosely. (i'd do ps to see if there were services running but hard to do with no prompt at the shell - although i assume network services were started if im able to post and web browse in the new kernel?) And it would explain why my shell isn't working because it didn't load my default shell. (But i don't know the boot process forward and backwards so i am more then likely wrong - correct me if i am)

here is what i was thinking of doing. my goal of recompiling is because i wanted to enable ieee34 (think that is the number for firewire) support so i could plug my camcorder in and capture footage with kino. Googling about the config files i learned they are like a template for the kernels. So i was thinking i should recompile using one of the templates and then just modify the configuration to include firewire support. But if SituationA is the case there is a good chance when i recompile the initrd could get messed up again and recompiling would have just been a waste of time. So what do people with a little more knowledge base think of the recompiling idea? Or does anyone know why i don't get a prompt and know details are shown at boot time and it is just a simple fix i could do? Any help would be appreciated. thanks in advanced.
 
  


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
compling kernel using gcc4 linuxmandrake Debian 7 09-30-2005 02:01 PM
Compling A New Kernel mullet Slackware 7 08-26-2004 05:04 PM
problem in compling kernel 2.6.6 rexhack Linux - Software 0 05-25-2004 02:21 AM
kernel compling examples deneme1984 Linux From Scratch 3 09-15-2003 03:51 AM
When compling kernel... nutshell Linux - General 1 03-09-2002 08:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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