Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 660942 - app-emulation/virtualbox-guest-additions-5.2.14 : /.../Makefile.include.header:99: *** The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set. Stop.
Summary: app-emulation/virtualbox-guest-additions-5.2.14 : /.../Makefile.include.heade...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Lars Wendler (Polynomial-C)
URL:
Whiteboard:
Keywords:
: 668678 (view as bug list)
Depends on: 671754
Blocks:
  Show dependency tree
 
Reported: 2018-07-11 17:10 UTC by Toralf Förster
Modified: 2018-11-27 09:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,17.16 KB, text/plain)
2018-07-11 17:10 UTC, Toralf Förster
Details
app-emulation:virtualbox-guest-additions-5.2.14:20180711-165148.log.bz2 (app-emulation:virtualbox-guest-additions-5.2.14:20180711-165148.log.bz2,77.42 KB, application/x-bzip)
2018-07-11 17:10 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,249.30 KB, text/plain)
2018-07-11 17:10 UTC, Toralf Förster
Details
environment (environment,143.53 KB, text/plain)
2018-07-11 17:10 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,21.16 KB, application/x-bzip)
2018-07-11 17:10 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,2.73 KB, application/x-bzip)
2018-07-11 17:10 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,110.58 KB, application/x-bzip)
2018-07-11 17:10 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2018-07-11 17:10:28 UTC
 * Preparing vboxguest module
make -j1 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' KERN_DIR=/usr/src/linux KERNOUT=/usr/src/linux all 
/var/tmp/portage/app-emulation/virtualbox-guest-additions-5.2.14/work/vboxguest/Makefile.include.header:99: *** The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set.  Stop.
 * ERROR: app-emulation/virtualbox-guest-additions-5.2.14::gentoo failed (compile phase):
 *   emake failed
 * 

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_libressl_20180705-093841

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.3.0 *

Available Python interpreters, in order of preference:
  [1]   python3.5
  [2]   python3.7 (fallback)
  [3]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby23 (with Rubygems) *
java-config:
The following VMs are available for generation-2:


emerge -qpv app-emulation/virtualbox-guest-additions
[ebuild  N    ] app-emulation/virtualbox-guest-additions-5.2.14  USE="-X"
Comment 1 Toralf Förster gentoo-dev 2018-07-11 17:10:31 UTC
Created attachment 539244 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2018-07-11 17:10:34 UTC
Created attachment 539246 [details]
app-emulation:virtualbox-guest-additions-5.2.14:20180711-165148.log.bz2
Comment 3 Toralf Förster gentoo-dev 2018-07-11 17:10:37 UTC
Created attachment 539248 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2018-07-11 17:10:40 UTC
Created attachment 539250 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2018-07-11 17:10:43 UTC
Created attachment 539252 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2018-07-11 17:10:46 UTC
Created attachment 539254 [details]
logs.tbz2
Comment 7 Toralf Förster gentoo-dev 2018-07-11 17:10:49 UTC
Created attachment 539256 [details]
temp.tbz2
Comment 8 LIsLinuxIsSogood 2018-07-24 07:33:53 UTC
Hi, not an experienced bug reported, but I am also experiencing this.  I wonder if the following attachment will help (it is the failed test build before portage tries to merge the package.)  Looks like something to do with the gentoo-sources Makefile not being in the expected place according to the package software.

https://paste.pount-python.org/show/jb0b575VJP8jPUU3RUGY/
Comment 9 Goeran Bruns 2018-08-09 07:57:37 UTC
Got this problem too.
 * Preparing vboxguest module
make -j2 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' KERN_DIR=/usr/src/linux KERNOUT=/usr/src/linux all
/var/tmp/portage/app-emulation/virtualbox-guest-additions-5.2.14/work/vboxguest/Makefile.include.header:99: *** The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set.  Stop.

Kernel layout is:
drwxr-xr-x 22 root root 4096 Apr 26 10:47 build-4.9.95-gentoo
lrwxrwxrwx  1 root root   19 Apr 26 10:34 linux -> build-4.9.95-gentoo
drwxr-xr-x 25 root root 4096 Apr 26 10:10 linux-4.9.95-gentoo

So build directory is separate from sources.
Comment 10 Goeran Bruns 2018-08-13 09:53:38 UTC
I looked into the problem.
In ebuild(/usr/portage/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.2.14.ebuild) in function pkg_setup var BUILD_PARAMS is set:

pkg_setup() {
        MODULE_NAMES="vboxguest(misc:${WORKDIR}/vboxguest:${WORKDIR}/vboxguest)
                vboxsf(misc:${WORKDIR}/vboxsf:${WORKDIR}/vboxsf)"
        use X && MODULE_NAMES+=" vboxvideo(misc:${WORKDIR}/vboxvideo::${WORKDIR}/vboxvideo)"

        linux-mod_pkg_setup
        BUILD_PARAMS="KERN_DIR=${KV_OUT_DIR} KERNOUT=${KV_OUT_DIR}"
        enewgroup vboxguest
        enewuser vboxguest -1 /bin/sh /dev/null vboxguest
        # automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
        enewgroup vboxsf
}

KERN_DIR is set to KV_OUT_DIR (see https://devmanual.gentoo.org/eclass-reference/linux-info.eclass/index.html for description).
Virtualbox requires it to be kernel build dir ending with build. (e.g. /lib/modules/4.9.95-gentoo/build) even so it is only a symlink.

As hotfix I changed the var via ebuild hook and it works.

#!/usr/bin/env bash
# /etc/portage/env/app-emulation/virtualbox-guest-additions-5.2.14

post_pkg_setup() {
        BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build KERNOUT=${KV_OUT_DIR}"
}
Comment 11 Travis Osterman 2018-10-04 17:20:41 UTC
This is still a bug in 5.2.18

For anyone finding this, Goeran Bruns' solution worked perfectly.  Here are the exact steps

1. mkdir -p /etc/portage/env/app-emulation
2. nano -w /etc/portage/env/app-emulation/virtualbox-guest-additions
#!/usr/bin/env bash
# /etc/portage/env/app-emulation/virtualbox-guest-additions-5.2.14

post_pkg_setup() {
        BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build KERNOUT=${KV_OUT_DIR}"
}
3. emerge --ask virtualbox-guest-additions
Comment 12 Joakim Tjernlund 2018-10-07 17:19:43 UTC
(In reply to Travis Osterman from comment #11)
> This is still a bug in 5.2.18
> 
> For anyone finding this, Goeran Bruns' solution worked perfectly.  Here are
> the exact steps
> 
> 1. mkdir -p /etc/portage/env/app-emulation
> 2. nano -w /etc/portage/env/app-emulation/virtualbox-guest-additions
> #!/usr/bin/env bash
> # /etc/portage/env/app-emulation/virtualbox-guest-additions-5.2.14
> 
> post_pkg_setup() {
>         BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build
> KERNOUT=${KV_OUT_DIR}"
> }
> 3. emerge --ask virtualbox-guest-additions

Yes, me too. The above workaround solved the build problem.
Comment 13 Lars Wendler (Polynomial-C) gentoo-dev 2018-10-17 12:28:53 UTC
*** Bug 668678 has been marked as a duplicate of this bug. ***
Comment 14 Larry the Git Cow gentoo-dev 2018-10-17 13:05:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eef6e72cdc8d4b329c3648466dcd5955a249a06f

commit eef6e72cdc8d4b329c3648466dcd5955a249a06f
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2018-10-17 12:46:34 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2018-10-17 13:05:22 +0000

    virtualbox packages: Bump to version 5.2.20
    
    Fixed KERN_DIR in virtualbox-guest-additions
    
    Closes: https://bugs.gentoo.org/660942
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 app-emulation/virtualbox-additions/Manifest        |   1 +
 .../virtualbox-additions-5.2.20.ebuild             |  33 ++
 app-emulation/virtualbox-bin/Manifest              |   4 +
 .../virtualbox-bin-5.2.20.125813.ebuild            | 287 +++++++++++++
 app-emulation/virtualbox-extpack-oracle/Manifest   |   1 +
 .../virtualbox-extpack-oracle-5.2.20.125813.ebuild |  42 ++
 app-emulation/virtualbox-guest-additions/Manifest  |   2 +
 .../virtualbox-guest-additions-5.2.20.ebuild       | 229 ++++++++++
 app-emulation/virtualbox-modules/Manifest          |   1 +
 .../virtualbox-modules-5.2.20.ebuild               |  51 +++
 app-emulation/virtualbox/Manifest                  |   1 +
 app-emulation/virtualbox/virtualbox-5.2.20.ebuild  | 473 +++++++++++++++++++++
 12 files changed, 1125 insertions(+)