# /usr/src/linux does not exist?

## vobrien310

I am sure this is a fairly stupid issue, me being a linux newbie, and it may have even been covered before, but none of my searches bring anything up.

I forgot to compile wireless support in my kernel when installing from the live cd.  The install is now done, and I can boot fine, but I realized I need to recompile that support into it.  When I try and browse to /usr/src/linux I get "No such file or directory"

Whenever I try "make menuconfig" from anywhere I get "make: *** No rule to make target "menuconfig;. Stop"

Can anyone suggest anything?

----------

## Hu

Traditionally, /usr/src/linux is a symbolic link to the source of the kernel.  Which kernel sources did you emerge?  Did you emerge them inside the chroot, so that they were installed to your hard disk?  If so, just use ln -s linux-`uname -r` linux in the directory /usr/src to create the appropriate symlink.  Note that this assumes you did not apply kernel patches or other configuration changes that would affect the output of uname -r.  If in doubt, look up the name of the directory that your kernel source was installed in, and use that as the second argument to ln.

The make error is because there is no Makefile present to provide that target.  The Makefile is in the directory where the kernel source was installed.

----------

## vobrien310

I did not emerge any sources manually.  This is a fresh networkless install from the live cd.  Where can I find the sources to emerge so that I can re-compile?

----------

## wynn

Since you don't have internet access (? no WiFi) then you will need NeddySeagoon's sneakernet.

What you want to emerge is sys-kernel/gentoo-sources. After you've been through the procedure described, you will probably have gentoo-sources-2.6.19-r5.

After the final emerge, you can create the symlink as Hu has described but, to use it to install a wifi driver and all the rest of it, you will have to have a .config.

You can use the config from the LiveCD kernel you have copied across (2.6.17-gentoo-r7)

```
cd /usr/src/linux-2.6.19-gentoo-r5

zcat /proc/config.gz > .config
```

If you have a SATA drive then you will have to use "menuconfig" to enable the SATA options as they have moved to another part of the kernel tree in 2.6.19 and later.

You may find [FAQ] KC13: I just installed a new kernel and it won't boot helpful in finding out what options you need to enable.

If you are puzzled as to which driver you need for your SATA controller, you can boot up the LiveCD again and look at "/sys/block"

```
ls -l /sys/block
```

you should see one (or, perhaps, more) entries "sda", "sdb".

To find the driver that the LiveCD uses for your SATA disk, run

```
udevinfo -a -p /sys/block/sda | grep DRIVER
```

which will give output like

```
    DRIVER==""

    DRIVERS=="sd"

    DRIVERS==""

    DRIVERS==""

    DRIVERS=="ahci"

    DRIVERS==""
```

"sd" is SCSI disk support which SATA requires (it's in KC13) and "ahci" is the SATA controller driver â your driver may be different, of course.

If you still can't work out how to enable this driver, post your "lspci" output â just the line (or lines) with "SATA" or "Serial ATA" will do.

Finally, you will have to compile and install the new kernel and then you can install the WiFi driver.

----------

