2

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?

  • ls -l /usr/src/linux-3.3.38-gentoo/kernel/irq/Kconfig? – quanta Oct 25 '12 at 5:01
4

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.

|improve this answer|||||
  • 2
    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
2

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).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy