# [SOLVED] gentoo-sources-4.19.66 and nvidia-drivers-430.40

## jacktoo

Hello,

The nvidia-drivers-430.40 fail to compile with gentoo-sources-4.19.66 with no explicable reason (to me).

I have emerged the gentoo-sources-4.19.66 recently (default configuration generated by genkernel all) and used genkernel for building the kernel. The kernel works perfectly after reboot but as soon as I run:

```
emerge --ask @module-rebuild
```

For rebuilding the nvidia-drivers the compilation fails.

Build Output:

```
 * Package:    x11-drivers/nvidia-drivers-430.40

 * Repository: gentoo

 * Maintainer: jer@gentoo.org

 * USE:        X abi_x86_32 abi_x86_64 acpi amd64 driver elibc_glibc kernel_linux kms multilib tools userland_GNU uvm

 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     4.19.66-gentoo

 * Checking for suitable kernel configuration options...

 [ ok ]

 * Checking for suitable kernel configuration options...

 [ ok ]

>>> Unpacking source...

>>> Unpacking NVIDIA-Linux-x86_64-430.40.run to /var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work

>>> Unpacking nvidia-settings-430.40.tar.bz2 to /var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work

>>> Source unpacked in /var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work

>>> Preparing source in /var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work ...

 * Applying nvidia-settings-linker.patch ...

 [ ok ]

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work ...

>>> Source configured.

>>> Compiling source in /var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work ...

 * Preparing nvidia module

make -j4 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' ARCH=x86_64 IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/usr/src/linux CC=x86_64-pc-linux-gnu-gcc NV_VERBOSE=1 module 

make[1]: Entering directory '/usr/src/linux-4.19.66-gentoo'

test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \

echo >&2;                                                       \

echo >&2 "  ERROR: Kernel configuration is invalid.";           \

echo >&2 ;                                                      \

/bin/false)

>>> Source prepared.

  ERROR: Kernel configuration is invalid.e/x11-drivers/nvidia-drivers-430.40/work ...

         include/generated/autoconf.h or include/config/auto.conf are missing.

         Run 'make oldconfig && make prepare' on kernel src to fix it.0.40/work ...

 * Preparing nvidia module

make[1]: *** [Makefile:641: include/config/auto.conf] Error 1pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' ARCH=x8make[1]: Leaving directory '/usr/src/linux-4.19.66-gentoo'UT=/usr/src/linux CC=x86_64-pc-linux-gnu-gcc NV_make: *** [Makefile:81: modules] Error 2

 * ERROR: x11-drivers/nvidia-drivers-430.40::gentoo failed (compile phase):

 *   emake failedenerated/autoconf.h -a -e include/config/auto.conf || (                \

 * o >&2;                                                       \

 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-430.40::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-430.40::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-430.40/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-430.40/temp/environment'.

 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work/kernel'

 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-430.40/work/'
```

emerge -pqv '=x11-drivers/nvidia-drivers-430.40::gentoo':

```

[ebuild   R   ] x11-drivers/nvidia-drivers-430.40  USE="X acpi driver kms multilib tools uvm -compat -gtk3 -static-libs -wayland" ABI_X86="32 (64) (-x32)"

```

[/post]

I searched in the forum for similar issues and tried some proposed workaround but nothing seems to work.

I would really appreciate your support on this issue.

Thanks

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]Last edited by jacktoo on Tue Aug 27, 2019 5:17 pm; edited 1 time in total

----------

## fedeliallalinea

It seems that you /usr/src/linux is empty or there are missing files.

Post your uname -a, eselect kernel list, ls -l /usr/src/ and ls -l /usr/src/linux

----------

## jacktoo

 *fedeliallalinea wrote:*   

> It seems that you /usr/src/linux is empty or there are missing files.
> 
> Post your uname -a, eselect kernel list, ls -l /usr/src/ and ls -l /usr/src/linux

 

uname -a

```
Linux rschws006 4.19.66-gentoo #1 SMP Tue Aug 20 21:54:10 CEST 2019 x86_64 Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz GenuineIntel GNU/Linux
```

eselect kernel list

```
Available kernel symlink targets:

  [1]   linux-4.19.44-gentoo

  [2]   linux-4.19.66-gentoo
```

ls -las /usr/src/linux

```
rschws006 ~ # ls -las /usr/src/linux

0 lrwxrwxrwx 1 root root 20 Aug 20 21:50 /usr/src/linux -> linux-4.19.66-gentoo

rschws006 ~ # ls -las /usr/src/linux/

total 180208

    4 drwxr-xr-x  27 root root     4096 Aug 21 19:19 .

    0 drwxr-xr-x   4 root root       88 Aug 20 21:50 ..

    4 drwxr-xr-x  27 root root     4096 Aug 20 21:57 arch

   12 drwxr-xr-x   3 root root     8192 Aug 20 21:58 block

  848 -rw-r-----   1 root root   867864 Aug 20 21:57 built-in.a

    4 drwxr-xr-x   2 root root     4096 Aug 20 21:57 certs

   16 -rw-r--r--   1 root root    13061 Oct 22  2018 .clang-format

    4 -rw-r--r--   1 root root       59 Oct 22  2018 .cocciconfig

  160 -rw-r-----   1 root root   163558 Aug 21 19:19 .config

  160 -rw-r-----   1 root root   163558 Aug 20 21:54 .config.old

    4 -rw-r--r--   1 root root      423 Oct 22  2018 COPYING

  100 -rw-r--r--   1 root root    98741 Oct 22  2018 CREDITS

   36 drwxr-xr-x   4 root root    20480 Aug 20 22:09 crypto

    0 drwxr-xr-x   2 root root       21 Aug 13 19:09 distro

   12 drwxr-xr-x 120 root root     8192 Aug 13 19:09 Documentation

    4 drwxr-xr-x 137 root root     4096 Aug 20 22:08 drivers

    0 drwxr-xr-x   2 root root      125 Aug 20 21:58 firmware

   16 drwxr-xr-x  73 root root    12288 Aug 20 22:09 fs

    4 -rw-r--r--   1 root root       31 Oct 22  2018 .get_maintainer.ignore

    4 -rw-r--r--   1 root root       30 Oct 22  2018 .gitattributes

    4 -rw-r--r--   1 root root     1498 Oct 22  2018 .gitignore

    4 drwxr-xr-x  29 root root     4096 Aug 20 21:51 include

    4 drwxr-xr-x   2 root root     4096 Aug 20 21:57 init

    4 drwxr-xr-x   2 root root     4096 Aug 20 21:57 ipc

    4 -rw-r--r--   1 root root     2245 Oct 22  2018 Kbuild

    4 -rw-r--r--   1 root root      588 Aug 13 19:09 Kconfig

   16 drwxr-xr-x  18 root root    12288 Aug 20 21:57 kernel

   36 drwxr-xr-x  13 root root    20480 Aug 20 22:09 lib

    0 drwxr-xr-x   5 root root       54 Aug 13 19:09 LICENSES

   12 -rw-r--r--   1 root root     9924 Oct 22  2018 .mailmap

  464 -rw-r--r--   1 root root   471057 Aug 13 19:08 MAINTAINERS

   60 -rw-r--r--   1 root root    60017 Aug 13 19:09 Makefile

    4 -rw-r-----   1 root root      548 Aug 21 19:19 .missing-syscalls.d

   16 drwxr-xr-x   3 root root    12288 Aug 20 22:09 mm

    8 -rw-r-----   1 root root     5288 Aug 20 22:03 modules.builtin

   72 -rw-r-----   1 root root    71281 Aug 20 22:08 modules.order

  984 -rw-r-----   1 root root  1006281 Aug 20 22:08 Module.symvers

    4 drwxr-xr-x  70 root root     4096 Aug 20 22:05 net

    4 -rw-r--r--   1 root root      800 Oct 22  2018 README

    4 drwxr-xr-x  27 root root     4096 Aug 13 19:09 samples

   12 drwxr-xr-x  14 root root     8192 Aug 20 21:57 scripts

    4 drwxr-xr-x  10 root root     4096 Aug 20 21:57 security

    4 drwxr-xr-x  26 root root     4096 Aug 20 22:09 sound

 3188 -rw-r-----   1 root root  3263653 Aug 20 21:57 System.map

 1280 -rw-r-----   1 root root  1307232 Aug 20 21:57 .tmp_kallsyms1.o

 7640 -rw-r-----   1 root root  7822602 Aug 20 21:57 .tmp_kallsyms1.S

 1280 -rw-r-----   1 root root  1307232 Aug 20 21:57 .tmp_kallsyms2.o

 7640 -rw-r-----   1 root root  7822602 Aug 20 21:57 .tmp_kallsyms2.S

 3188 -rw-r-----   1 root root  3263653 Aug 20 21:57 .tmp_System.map

   84 drwxr-x---   2 root root    57344 Aug 20 22:08 .tmp_versions

37348 -rwxr-x---   1 root root 44829560 Aug 20 21:57 .tmp_vmlinux1

38620 -rwxr-x---   1 root root 46926736 Aug 20 21:57 .tmp_vmlinux2

    4 drwxr-xr-x  32 root root     4096 Aug 13 19:09 tools

    4 drwxr-xr-x   3 root root     4096 Aug 20 21:57 usr

    4 -rw-r-----   1 root root        2 Aug 20 21:57 .version

    0 drwxr-xr-x   4 root root      129 Aug 20 22:02 virt

38620 -rwxr-x---   1 root root 46926736 Aug 20 21:57 vmlinux

    4 -rw-r-----   1 root root      140 Aug 20 21:57 .vmlinux.cmd

38184 -rw-r-----   1 root root 39098288 Aug 20 21:57 vmlinux.o
```

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]

----------

## fedeliallalinea

The /usr/src/linux/include/generated/autoconf.h and /usr/src/linux/include/config/auto.conf files exists?

If yes try to reselect kernel with eselect (eselect kernel set linux-4.19.66-gentoo), because your output not mark any setted kernel.

----------

## jacktoo

 *fedeliallalinea wrote:*   

> The /usr/src/linux/include/generated/autoconf.h and /usr/src/linux/include/config/auto.conf files exists?
> 
> If yes try to reselect kernel with eselect (eselect kernel set linux-4.19.66-gentoo), because your output not mark any setted kernel.

 

The kernel is indeed selected (must have lost the * during copy&paste).

```
Available kernel symlink targets:

  [1]   linux-4.19.44-gentoo

  [2]   linux-4.19.66-gentoo *
```

And both files exist

```
rschws006 ~ # ls -las /usr/src/linux/include/generated/autoconf.h 

124 -rw-r----- 1 root root 122988 Aug 21 21:18 /usr/src/linux/include/generated/autoconf.h

rschws006 ~ # ls -las /usr/src/linux/include/config/auto.conf

84 -rw-r----- 1 root root 83183 Aug 21 21:18 /usr/src/linux/include/config/auto.conf
```

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]

----------

## fedeliallalinea

I don't understand, what return command cd /usr/src/linux-4.19.66-gentoo && test -e include/generated/autoconf.h -a -e include/config/auto.conf || echo "Error"?

----------

## jacktoo

It returns nothing unfortunately...

```
rschws006 ~ # cd /usr/src/linux-4.19.66-gentoo && test -e include/generated/autoconf.h -a -e include/config/auto.conf || echo "Error"

rschws006 /usr/src/linux-4.19.66-gentoo #
```

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]

----------

## fedeliallalinea

Ok, this is weird because it's the test that cause emerge error but only when the test fails and return Error

----------

## jacktoo

That is what I thought too.

Is there a way to remove that check (for testing)?

----------

## krinn

 *jacktoo wrote:*   

> 
> 
> ```
> rschws006 ~ # ls -las /usr/src/linux/include/generated/autoconf.h 
> 
> ...

 

Only root user and root group could read them.

Something portage won't appreciate running as portage user

----------

## jacktoo

That was the issue to solve indeed. Not sure why those strange permissions were assigned.

Anyway, it works now thanks!

----------

## Hu

Most likely, you built the kernel as root (bad) with a umask that restricts files created by root (normally good, but a problem in this case).

----------

