how to start configuring the kernel when compling.
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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:
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.
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)
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.