Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Kernel source directory not found (SOLVED)

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

Kernel source directory not found (SOLVED)

  • Quote

Post by lokoalex » Fri Nov 02, 2007 2:06 pm

Im trying to
genkernel --menuconfig all
and this is what I get:

Code: Select all

* Gentoo Linux Genkernel; Version 3.4.8
* Running with options: all

* ERROR: kernel source directory "/usr/src/linux" was not found!

* -- Grepping log... --


* Gentoo Linux Genkernel; Version 3.4.8
* Running with options: all

* ERROR: kernel source directory "/usr/src/linux" was not found!

* -- End log... --

* Please consult /var/log/genkernel.log for more information and any
* errors that were reported above.

* Report any genkernel bugs to bugs.gentoo.org and
* assign your bug to genkernel@gentoo.org. Please include
* as much information as you can in your bug report; attaching
* /var/log/genkernel.log so that your issue can be dealt with effectively.
*
* Please do *not* report compilation failures as genkernel bugs!
*

So I tried upgrading the kernel and I still get the same problems.
Any suggestions?
Last edited by lokoalex on Tue Nov 06, 2007 8:03 pm, edited 1 time in total.
Gentoo and I have an On-Off relationship....
Top
Kwark
Tux's lil' helper
Tux's lil' helper
Posts: 121
Joined: Mon May 21, 2007 9:03 am

  • Quote

Post by Kwark » Fri Nov 02, 2007 2:22 pm

Is there a symlink /usr/src/linux to one of the real /usr/src/ kernel source directories?
If not, make one yourself.
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Fri Nov 02, 2007 2:33 pm

Yes I have a symlink. Here is what I have:

Code: Select all

#ls -l /usr/src/linux
lrwxrwxrwx 1 root root 15 Nov  2 10:18 /usr/src/linux -> linux-2.6.22-r8
Gentoo and I have an On-Off relationship....
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Sat Nov 03, 2007 2:24 am

Still having the same problems. Is there anyone who can help?
Gentoo and I have an On-Off relationship....
Top
tarpman
Veteran
Veteran
User avatar
Posts: 1083
Joined: Thu Nov 04, 2004 2:55 am
Location: Victoria, BC, Canada

  • Quote

Post by tarpman » Sat Nov 03, 2007 3:04 am

Does /usr/src/linux/linux-2.6.22-r8 exist? There is no sys-kernel/vanilla-sources-2.6.22-r8; the closest one to that is sys-kernel/gentoo-sources-2.6.22-r8, which would result in a target for the symlink of /usr/src/linux-2.6.22-gentoo-r8.
Saving the world, one kilobyte at a time.
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Sat Nov 03, 2007 2:45 pm

Here is what I have:

Code: Select all

cd /usr/src/linux
bash: cd: /usr/src/linux: No such file or directory
But:

Code: Select all

ls /usr/src
linux  linux-2.6.22-gentoo-r8  linux-2.6.22-gentoo-r9
And:

Code: Select all

ls /usr/src/linux
/usr/src/linux
But the output is blinking for some reason.
Gentoo and I have an On-Off relationship....
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Nov 03, 2007 4:50 pm

The blinking is an indication that ls considers the symlink to be broken. In this case, the link is dangling. According to your output, you have linux-2.6.22-gentoo-r8 and linux-2.6.22-gentoo-r9 as available kernel source directories. However, your symlink points to linux-2.6.22-r8. Notice that the kernel directories have a gentoo- that your symlink does not. To fix it, remove the symlink named linux and recreate it, this time pointing it to a directory that exists. You can use the shell's tab completion feature to ensure that you do not misspell the name.
Top
Lemmens
n00b
n00b
User avatar
Posts: 21
Joined: Thu Aug 23, 2007 12:44 pm
Location: European Union (BE)

  • Quote

Post by Lemmens » Sat Nov 03, 2007 9:22 pm

lokoalex wrote: But:

Code: Select all

ls /usr/src
linux  linux-2.6.22-gentoo-r8  linux-2.6.22-gentoo-r9
But the output is blinking for some reason.
You can use app-admin/eselect to modify the symlink (#emerge eselect).
The command eselect kernel list outputs the different kernel sources on your system and shows which one is currently selected by the symlink:

Code: Select all

Available kernel symlink targets:
          [1]     linux-2.6.22-gentoo-r8  *
          [2]     linux-2.6.22-gentoo-r9
Then you can select the one to which the symlink has to point to: "eselect kernel set 1" or "eselect kernel set 2"
Who even knows the vastness, the strech and the reach of his ignorance?
By the mercy of God, we are lovers of the light.
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Tue Nov 06, 2007 7:01 pm

Still having the same issues.
Last edited by lokoalex on Tue Nov 06, 2007 7:05 pm, edited 2 times in total.
Gentoo and I have an On-Off relationship....
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Tue Nov 06, 2007 7:03 pm

Ok so I checked my kernel version:

Code: Select all

# eselect kernel list
Available kernel symlink targets:
  [1]   linux-2.6.22-gentoo-r8 
  [2]   linux-2.6.22-gentoo-r9

And I selected the one i use:

Code: Select all

src # eselect kernel set linux-2.6.22-gentoo-r8
Then I checked to make sure it worked:

Code: Select all

# eselect kernel list
Available kernel symlink targets:
  [1]   linux-2.6.22-gentoo-r8* 
  [2]   linux-2.6.22-gentoo-r9
Then I created the new link:

Code: Select all

src # ln -sfn linux-2.6.22-gentoo-r8
Then I tried to:

Code: Select all

genkernel --menuconfig all 
And this is what I get which is the same as before:

Code: Select all

src # genkernel --menuconfig all
* Gentoo Linux Genkernel; Version 3.4.8
* Running with options: --menuconfig all

grep: /usr/src/linux/Makefile: No such file or directory
grep: /usr/src/linux/Makefile: No such file or directory
grep: /usr/src/linux/Makefile: No such file or directory
grep: /usr/src/linux/Makefile: No such file or directory
/usr/share/genkernel/gen_determineargs.sh: line 35: [: : integer expression expected
* Linux Kernel .. for x86...
* ERROR: Error: No kernel .config specified, or file not found!

* -- Grepping log... --


* Linux Kernel .. for x86...
* Gentoo Linux Genkernel; Version 3.4.8
* Running with options: --menuconfig all

* ERROR: Error: No kernel .config specified, or file not found!

* -- End log... --

* Please consult /var/log/genkernel.log for more information and any
* errors that were reported above.

* Report any genkernel bugs to bugs.gentoo.org and
* assign your bug to genkernel@gentoo.org. Please include
* as much information as you can in your bug report; attaching
* /var/log/genkernel.log so that your issue can be dealt with effectively.
*
* Please do *not* report compilation failures as genkernel bugs!
*
So I decided to check my symlink and its correct:

Code: Select all

src # ls -l /usr/src/linux
lrwxrwxrwx 1 root root 22 Nov  6 12:45 /usr/src/linux -> linux-2.6.22-gentoo-r8
And the output of this wasnt blinking anymore:

Code: Select all

 src # ls /usr/src/linux
Module.symvers  block    fs       ipc     mm       security  vmlinux
System.map      crypto   include  kernel  net      sound
arch            drivers  init     lib     scripts  usr
So again if anyone can help it would be great.
Gentoo and I have an On-Off relationship....
Top
gerard27
Advocate
Advocate
Posts: 2377
Joined: Sun Jan 04, 2004 3:30 pm
Location: Netherlands

  • Quote

Post by gerard27 » Tue Nov 06, 2007 7:19 pm

lokoalex,
Your kernel (2.6.22-gentoo-r8 ) apparently is not complete or otherwise damaged I think.
Try re-emergeing that kernel.
To make live easier you might want to install "mc".

Code: Select all

emerge -pv mc
and check if you agree with the dependencies it might want to install.
mc is a great console browser.It would have shown your dangling symlink in red.
Gerard.
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Tue Nov 06, 2007 7:35 pm

How can I re-emerge 2.6.22-gentoo-r8 if they are up to 2.6.22-gentoo-r9?
Gentoo and I have an On-Off relationship....
Top
gerard27
Advocate
Advocate
Posts: 2377
Joined: Sun Jan 04, 2004 3:30 pm
Location: Netherlands

  • Quote

Post by gerard27 » Tue Nov 06, 2007 7:55 pm

Code: Select all

emerge =gentoo-sources-2.6.22-r8
Read man emerge man ebuild etc.
Gerard.
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Tue Nov 06, 2007 8:03 pm

You are awesome. Im still a little rusty with using the man pages thats why I asked for help. But im working my way there.
Gentoo and I have an On-Off relationship....
Top
gerard27
Advocate
Advocate
Posts: 2377
Joined: Sun Jan 04, 2004 3:30 pm
Location: Netherlands

  • Quote

Post by gerard27 » Tue Nov 06, 2007 8:26 pm

No I'm 80.
Did this solve your problem?
Gerard.
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Top
lokoalex
Apprentice
Apprentice
User avatar
Posts: 200
Joined: Thu Dec 02, 2004 3:52 pm
Location: Jersey

  • Quote

Post by lokoalex » Wed Nov 07, 2007 12:44 am

You completely solved my problem. Thanks for all the help!!!
Gentoo and I have an On-Off relationship....
Top
haf1zoglu
n00b
n00b
User avatar
Posts: 12
Joined: Mon Nov 28, 2022 11:58 am

  • Quote

Post by haf1zoglu » Wed Feb 08, 2023 9:36 pm

i had the same issue as ERROR: kernel source directory "/usr/src/linux" was not found!

yet what i have found was that i had just missed the step where we select the kernel and when i put command below and try "genkernell all" again, it worked like a charm.

eselect set kernel 1

(in my case it is 1, in your case it might be sth else, check via "eselect kernel list"

Code: Select all

root #eselect kernel list
Available kernel symlink targets:
  [1]   linux-5.15.52-gentoo
Top
Post Reply

17 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic