Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I installed gentoo by the handbook from official site. When I got into the step 7.b. Installing the Sources, the book says:

Code Listing 2.2: Viewing the kernel source symlink

When you take a look in /usr/src you should see a symlink called linux pointing to your kernel source.

But in my VirtualBox, there is no such file, only a linux-3..3.38-gentoo directory in src. When I tried to use

cd  linux-3.3.38-gentoo
make menuconfig

this error occurred:

init/Kconfig:389: can't open file "kernel/irq/Kconfig" 

How can I solve the problem?

share|improve this question
    
ls -l /usr/src/linux-3.3.38-gentoo/kernel/irq/Kconfig? –  quanta Oct 25 '12 at 5:01
add comment

migrated from serverfault.com Oct 25 '12 at 17:04

This question came from our site for professional system and network administrators.

2 Answers

most of the kernel modules you will build expect /usr/src/linux to point to the sources of the kernel you want to build the module for, so the first thing to do here is to create that link:

ln -s /usr/src/linux-3.3.38-gentoo /usr/src/linux

Then try and configure your kernel the way you did it.

cd /usr/src/linux
make menuconfig

Note: Gentoo would have created this link for you if you had switched the USE flag symlink on for sys-kernel/gentoo-sources. You can tell Gentoo which USE flag should be turned on by package by adding an entry in the file /etc/portage/package.use.

share|improve this answer
1  
In alternative to manually using ln, one can also use eselect with the kernel module. eselect is part of the app-admin/eselect package. –  Francesco Turco Oct 26 '12 at 10:52
add comment

If you're using gentoo-source and already in gentoo environment, the app-admin/eselect tool will help you do this:

eselect kernel list

and

eselect kernel set

And if you are not familiar with kernel installation genkernel can be very helpful. You might want to use --config= and --menuconfig, which is not documented in HandBook(HandBook is just a step-by-step guide form some dev's perspective, many tools it mentioned are underestimated by fresh readers).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.