Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 643118 - app-emulation/virtualbox-guest-additions: Fail to compile The variable KERN_DIR must be a kernel build folder and end with /build
Summary: app-emulation/virtualbox-guest-additions: Fail to compile The variable KERN_D...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-02 14:24 UTC by Guillaume Seren
Modified: 2018-10-04 18:47 UTC (History)
2 users (show)

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


Attachments
ebuild patch (virtualbox-guest-additions-5.2.4-ebuild.patch,829 bytes, patch)
2018-01-12 15:04 UTC, tonich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Seren 2018-01-02 14:24:20 UTC
Hey,
I am trying to emerge app-emulation/virtualbox-guest-additions-5.2.4 and I got the following error:
```
 * Preparing vboxguest module
make -j5 -l4 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.4/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.4::gentoo failed (compile phase):
 *   emake failed
```

Not sure exactly it it my setup or the package itself.


Guillaume.

Portage 2.3.19 (python 2.7.14-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-6.4.0, glibc-2.25-r9, 4.14.8-gentoo-r1-t470 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.8-gentoo-r1-t470-x86_64-Intel-R-_Core-TM-_i7-7600U_CPU_@_2.80GHz-with-gentoo-2.4.1
KiB Mem:    32643572 total,   1546508 free
KiB Swap:   33554428 total,  33523712 free
Timestamp of repository gentoo: Tue, 02 Jan 2018 14:00:01 +0000
Head commit of repository gentoo: 8845fb86370df98660919bfad9445df896322356
Head commit of repository GuillaumeSeren: 3e08e637d35ce82b82ec9956e53c604aad77189f

Head commit of repository sakaki-tools: 5890d06cb31176594edb0aa3d10cc746684ab1aa

sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.5-r1::gentoo, 3.5.4-r1::gentoo, 3.6.3-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:

local
    location: /usr/local/portage/local
    masters: gentoo

GuillaumeSeren
    location: /usr/local/portage/guillaumeseren
    sync-type: git
    sync-uri: https://github.com/GuillaumeSeren/gentoo-overlay.git
    masters: gentoo
    priority: 50

palmer
    location: /var/lib/layman/palmer
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/user/palmer.git
    masters: gentoo
    priority: 50

pentoo
    location: /var/lib/layman/pentoo
    sync-type: laymansync
    sync-uri: https://github.com/pentoo/pentoo-overlay.git
    masters: gentoo
    priority: 50

raiagent
    location: /var/lib/layman/raiagent
    sync-type: laymansync
    sync-uri: https://github.com/leycec/raiagent
    masters: gentoo
    priority: 50

sakaki-tools
    location: /usr/local/portage/sakaki-tools
    sync-type: git
    sync-uri: https://github.com/sakaki-/sakaki-tools.git
    masters: gentoo
    priority: 50

telred
    location: /var/lib/layman/telred
    sync-type: laymansync
    sync-uri: git://github.com/telred/telred-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=broadwell -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.1/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=broadwell -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --jobs=4 --load-average=4"
FCFLAGS="-march=broadwell -O2 -pipe"
FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict network-sandbox news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-march=broadwell -O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.ovh.net/gentoo-distfiles http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5 -l4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi activities alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli cracklib crypt cryptsetup cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm gtk iconv icu ipv6 jpeg kde kipi kwallet lcms ldap libnotify lm_sensors mad mng modules mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf phonon php plasma plymouth png policykit ppds pulseaudio python qml qt3support qt5 readline sdl seccomp semantic-desktop session spell ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xcomposite xml xv xvid zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0 php7-1" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_4 python3_5" QEMU_SOFTMMU_TARGETS="arm x86_64 sparc" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby21 ruby22 ruby23 ruby24" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-01-02 16:36:05 UTC
Most likely the package. Might require a similar fix I had to do for app-emulation/virtualbox-modules
Comment 2 Guillaume Seren 2018-01-02 17:40:46 UTC
This one #598266 ?
Comment 3 Goeran Bruns 2018-01-11 06:35:04 UTC
I got the same issue.
My kernel souces have the following layout:

sudo ls -l /usr/src/
total 8
drwxr-xr-x 22 root root 4096 Jan 10 17:47 build-4.4.87-gentoo-r1
lrwxrwxrwx  1 root root   23 Sep 21 11:24 linux -> build-4.4.87-gentoo-r1/
drwxr-xr-x 25 root root 4096 Jan 10 11:06 linux-4.4.87-gentoo-r1

There error is caused by this check in /var/tmp/portage/app-emulation/virtualbox-guest-additions-5.2.4/work/vboxguest/Makefile.include.header

 ifdef KERN_DIR
  ifndef KERN_VER
   ifeq ($(filter %/build,$(KERN_DIR)),)
    $(error The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set)
   endif
  endif
 endif
Comment 4 tonich 2018-01-12 15:04:34 UTC
Created attachment 514488 [details, diff]
ebuild patch

compiles against gentoo-sources-4.14.13
Comment 5 Guillaume Seren 2018-01-15 14:16:06 UTC
Confirmed it compiles/install on 4.14.13
Comment 6 Dyweni 2018-05-21 15:37:05 UTC
The fix was never added to the ebuild.

=app-emulation/virtualbox-guest-additions-5.2.12 has the same issue.

Adding 'KERN_VER=${KV_FULL}' to the BUILD_PARAMS (as described in the patch from 2018-01-12) fixed the issue.

I'm using '=sys-kernel/gentoo-sources-4.16.9'.

----
# l /usr/src/
total 16
drwxr-xr-x  4 root root 4096 May 21 09:01 ./
drwxr-xr-x 13 root root 4096 Jan 29 11:29 ../
-rw-r--r--  1 root root    0 Jan 16 15:55 .keep
lrwxrwxrwx  1 root root   19 May 21 09:01 linux -> linux-4.16.9-gentoo/
drwxr-xr-x 27 root root 4096 May 21 09:29 linux-4.16.9-gentoo/
----


Can we get this patch included in the ebuild please?
Comment 7 P.B. Lecavalier 2018-10-04 18:47:15 UTC
Sorry, but this **absolutely not** fixed. I just ran into the very same issue. It only worked once I patched the Makefile.header.include which causes the farcical "KERN_DIR" issue. The solution that is enclosed here (dated from last JANUARY) is nowhere to be seen.