Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tip: Building virtualbox-5.1.6 guest packages in a ~amd64 VM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
marsclic
n00b
n00b


Joined: 02 Mar 2003
Posts: 74

PostPosted: Wed Oct 19, 2016 9:21 pm    Post subject: Tip: Building virtualbox-5.1.6 guest packages in a ~amd64 VM Reply with quote

This is a quick tip for anyone trying to build xf86-video-virtualbox 5.1.6 and virtualbox-guest-additions-5.1.6 on a Gentoo ~amd64 environment.

Since the portage ebuilds stopped at 5.0.20 for some time, I decided to try 5.1.6 from the Sabayon Overlay. I ran into a problem right after configuration ended, just before compile: the "environment" script that the ebuild generated was crashing with a message about too many args for pushd, as below:

Code:

# emerge -1av xf86-video-virtualbox

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-drivers/xf86-video-virtualbox-5.1.6::sabayon  USE="dri" PYTHON_TARGETS="python2_7" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) x11-drivers/xf86-video-virtualbox-5.1.6::sabayon
 * VirtualBox-5.1.6.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.8.2-gentoo/build
 * Found sources for kernel version:
 *     4.8.2-gentoo
 * Checking for suitable kernel configuration options...                                        [ ok ]
>>> Unpacking source...
>>> Unpacking VirtualBox-5.1.6.tar.bz2 to /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work
>>> Source unpacked in /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work
>>> Preparing source in /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6 ...
 * Applying xf86-video-virtualbox-5.1.4-Makefile.module.kms.patch ...                           [ ok ]
 * Applying xf86-video-virtualbox-2.2.0-enable-opengl.patch ...                                 [ ok ]
 * Applying xf86-video-virtualbox-5.0.0_beta3-configure_checks.patch ...                        [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6 ...
./configure --nofatal --disable-xpcom --disable-sdl-ttf --disable-pulse --disable-alsa --with-gcc=x86_64-pc-linux-gnu-gcc --with-g++=x86_64-pc-linux-gnu-g++ --target-arch=amd64 --with-linux=/lib/modules/4.8.2-gentoo/build --build-headless
Checking for environment: Determined build machine: linux.amd64, target machine: linux.amd64, OK.
Checking for kBuild: found, OK.
Checking for gcc: found version 6.2.0, OK.
Checking for Open Watcom:
  ** Open Watcom was not found!
Checking for iasl: found version 20160729, OK.
Checking for xslt: found, OK.
Checking for pthread: found, OK.
Checking for libxml2: found version 2.9.4, OK.
Checking for libIDL:
  ** libIDL-config (variable libIDL-config) not found!
Checking for ssl: found version OpenSSL 1.0.2j  26 Sep 2016, OK.
Checking for libcurl: found version 7.50.3, OK.
Checking for libvpx:
  vpx not found at -lvpx  or vpx headers not found
  Check the file /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6/configure.log for detailed error information.
Checking for zlib: found version 1.2.8, OK.
Checking for libpng: found version 1.6.25+apng, OK.
Checking for X libraries: Checking for Xcursor: found, OK.
Checking for Xinerama:
  Xinerama not found at -L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11 -lXinerama -I/usr/local/include or Xinerama headers not found
  Check the file /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6/configure.log for detailed error information.
Checking for Xrandr: found, OK.
Checking for Xmu: found, OK.
Checking for Mesa / GLU: Checking for Python support: found version 2.7.12, OK.
Checking for Java support: OK.
Checking for static stc++ library: found, OK.
Checking for Linux kernel sources: found version 4.8.2, OK.
Checking for libdevmapper:
  libdevmapper not found at -ldevmapper  or libdevmapper headers not found
  Check the file /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6/configure.log for detailed error information.
Checking for libcap library: found, OK.
Checking for compiler.h: compiler.h not found, OK.
Checking for 32-bit support: OK.

Successfully generated '/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6/AutoConfig.kmk' and '/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6/env.sh'.
Source '/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6/env.sh' once before you start to build VBox:

  source /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6/env.sh
  kmk

To compile the kernel modules, do:

  cd ./out/linux.amd64/release/bin/src
  make


  +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++
  Hardening is enabled which means that the VBox binaries will not run from
  the binary directory. The binaries have to be installed suid root and some
  more prerequisites have to be fulfilled which is normally done by installing
  the final package. For development, the hardening feature can be disabled
  by specifying the --disable-hardening parameter. Please never disable that
  feature for the final distribution!
  +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++

Enjoy!
>>> Source configured.
>>> Compiling source in /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6 ...
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/temp/environment: line 4140: pushd: too many arguments
 * ERROR: x11-drivers/xf86-video-virtualbox-5.1.6::sabayon failed (compile phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line 115:  Called src_compile
 *   environment, line 4140:  Called die
 * The specific snippet of code:
 *           pushd "${S}"/src/VBox/${each} $ > /dev/null || die;
 *
 * If you need support, post the output of `emerge --info '=x11-drivers/xf86-video-virtualbox-5.1.6::sabayon'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/xf86-video-virtualbox-5.1.6::sabayon'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6'
 * S: '/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.6/work/VirtualBox-5.1.6'

>>> Failed to emerge x11-drivers/xf86-video-virtualbox-5.1.6, Log file:


After some thought and much frustrated experimentation, I tried downgrading bash from 4.4-r1 to 4.3_p42-r2 and it all worked fine. There is some bug there but I don't have time to pursue it, so this is just a workaround.

The xf86-video-virtualbox-5.1.6 package builds fine with gcc-6.2.0, but virtualbox-guest-additions-5.1.6 needs to be built with gcc-4.9.3. This setup seems to be running fine now on my VM.

Good Luck!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14071

PostPosted: Thu Oct 20, 2016 1:32 am    Post subject: Reply with quote

That use of a bare $ looks odd to me. As an initial test, I would try adding, just before the pushd, a line reading (set -x; : args-of-pushd). That should cause bash to print out the arguments it will use when it processes pushd, which may give you a hint about why the list is considered to be too long.
Back to top
View user's profile Send private message
marsclic
n00b
n00b


Joined: 02 Mar 2003
Posts: 74

PostPosted: Thu Oct 20, 2016 11:17 pm    Post subject: Reply with quote

I'm not sure what's causing it but my guess is that when the "environment" file is generated on configure, the latest bash is causing a malformed expansion of that pushd line. :roll:
Back to top
View user's profile Send private message
wfdawson
n00b
n00b


Joined: 05 Aug 2010
Posts: 16

PostPosted: Mon Oct 31, 2016 1:52 am    Post subject: Reply with quote

"Since the portage ebuilds stopped at 5.0.20"

And, what's the reason for that? Why has support for Virtualbox seemingly dried up?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum