# [Solved] Missing Makefile in kernel source

## Langest

Hello!

I have successfully installed gentoo for the first time. Coming from Arch it felt pretty easy when you had the terrific handbook as assistance.

However, I have run into trouble now that I have been using gentoo for a while. For some reason the Makefile for the kernel has gone missing. I have been able to build it previously so I know it has existed at some point in time. I have tried to search for similar or the same problem and it seems like 

```
$emerge --depclean
```

 is a potential culprit. But I have not been able to fix it. I have tried to reinstall the sources but with no luck.

Any suggestions to what I can try? Or do you need more information?

This is 

```
$ pwd

/usr/src/linux

$ ls -a

.      certs     fs       kernel  scripts        usr         .config.old          modules.builtin  .tmp_kallsyms1.o  .tmp_System.map  vmlinux

..     crypto    include  lib     security       virt        kernelConfig         modules.order    .tmp_kallsyms1.S  .tmp_vmlinux1    .vmlinux.cmd

arch   drivers   init     mm      sound          built-in.o  kernelConfig2        Module.symvers   .tmp_kallsyms2.o  .tmp_vmlinux2    vmlinux.o

block  firmware  ipc      net     .tmp_versions  .config     .missing-syscalls.d  System.map       .tmp_kallsyms2.S  .version

```

Thank you!

LangestLast edited by Langest on Sat Jan 20, 2018 6:38 pm; edited 1 time in total

----------

## NeddySeagoon

Langest,

Welcome to gentoo.  

As  --depclean removed your kernel makefile, you have a newer kernel in /usr/src that has not yet been installed.

You should upgrade your kernel.

----------

## Langest

Thank you for the fast reply!

You are correct that there exists another kernel version, but to me it does not look like a newer version.

```
$ ls -l /usr/src/

total 8.0K

drwxr-xr-x 22 root root 4.0K Jan 10 17:57 linux-4.14.7-gentoo

drwxr-xr-x 25 root root 4.0K Jan 19 23:39 linux-4.9.76-gentoo-r1

lrwxrwxrwx  1 root root   20 Jan 12 09:49 linux -> linux-4.14.7-gentoo/

```

4.14.7 is the kernel I currently run on which is missing the make file and 4.9.76 is the newer? I thought 4.14.7 > 4.9.76-r. But as you say, it seems like 4.9.76-r has a Makefile.

When I look at https://packages.gentoo.org/packages/sys-kernel/gentoo-sources 4.14.7 is missing. Was it pulled because of something (meltdown & spectre maybe?) and that is the reason for me getting confused over the matter?

Thank you!

----------

## Jaglover

```
emerge --ask --depclean
```

And look at the output before committing.  :Smile: 

----------

## NeddySeagoon

Langest,

Ah. 4.14.7 got masked for bugs that that only affected hardened profile users.

That wasn't known at the time in was masked. Its now been removed from the repository.

```
$ eix gentoo-sources

[?] sys-kernel/gentoo-sources

     (4.14.8-r1) [M](~)4.14.8-r1^bs{tbz2}

     (4.14.9) [M](~)4.14.9^bs

     (4.14.10) [M](~)4.14.10^bs

     (4.14.10-r1) [M](~)4.14.10-r1^bs

     (4.14.11) [M](~)4.14.11^bs

     (4.14.11-r1) (~)4.14.11-r1^bs

     (4.14.11-r2) (~)4.14.11-r2^bs

     (4.14.12) (~)4.14.12^bs{tbz2}

     (4.14.13) (~)4.14.13^bs{tbz2}
```

All the 4.14 versions in the repository are either masked [M] or testing (~)

If you want to try a testing kernel, use at least 4.14.11-r2 as that is the first one with the Spectre and Meltdown patches.

There is no reason to avoid 4.14.13, other than its still in Gentoo testing.

----------

## pjp

 *NeddySeagoon wrote:*   

> If you want to try a testing kernel, use at least 4.14.11-r2 as that is the first one with the Spectre and Meltdown patches.
> 
> There is no reason to avoid 4.14.13, other than its still in Gentoo testing.

   Project:Security/Vulnerabilities/Meltdown and Spectre changed their "recommended / stabilization candidate" version from 4.14.13 to 4.14.14.

I had no problems using 'make olddefconfig' to upgrade from .13 to .14.

----------

## krinn

https://forums.gentoo.org/viewtopic-t-1074552.html

may answer some of your questions.

----------

## Langest

Wow, plenty of thanks!

That is a lot of useful information and I feel you covered all of my questions.

----------

