From fbcfb9041ac7c1f9bc2c788734105aebf3a9840f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 12 Jun 2011 15:56:01 -0400 Subject: [PATCH] VM: uff -- nasty workaround to get VB guest additions be built for 686 --- vm/d-i/tools/initial_setup | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/vm/d-i/tools/initial_setup b/vm/d-i/tools/initial_setup index 164a05a..602d073 100755 --- a/vm/d-i/tools/initial_setup +++ b/vm/d-i/tools/initial_setup @@ -68,12 +68,44 @@ apt-get update -y # to cheat the VM check touch /dev/vboxguest + +# Assure that corresponding linux headers are installed since otherwise they +# might not be. There is also a dichotomy between target 686 and installer +# using 486 build of the kernel. It requires manual build/installation +# of guest additions for 686 at this point. Hence all the ugly logic below +cunamer=`uname -r` +cdarch=${cunamer##*-} +# We carry 686 only +[ $cdarch = '486' ] && darch='686' || darch=$cdarch +apt-get install -y linux-headers-2.6-$cdarch + # Forcefully install guest additions from backports so we are # compatible with VirtualBox 4.x series -apt-get install -y -t squeeze-backports virtualbox-ose-guest-dkms +apt-get install -y -t squeeze-backports virtualbox-ose-guest-dkms \ + >| /var/log/initial_setup-dkms.log 2>&1 + # to get all the rest stuff in recommends apt-get install -y dkms neurodebian-guest-additions +if [ "$darch" != "$cdarch" ] ; then + # Because DKMS builds for currently running kernel, which during + # installation might be a more generic 486, lets force building for 686 + # and also install necessary headers (will be purged later on anyways) + apt-get install -y linux-headers-2.6-$darch + + unamer=${cunamer//$cdarch/$darch} + # First collect information about installed vb additions + vbg=( `dkms status | grep virtualbox | head -n 1 | tr ',' ' '` ) + echo "I: forcing build and install of guest additions for 686" + dkms build -m ${vbg[0]} -v ${vbg[1]} -a i686 -k $unamer \ + >| /var/log/initial_setup-dkms-686-build.log 2>&1 + dkms install -m ${vbg[0]} -v ${vbg[1]} -a i686 -k $unamer \ + >| /var/log/initial_setup-dkms-686-install.log 2>&1 +fi + +# assure at the end that we got right modules build in the right location +find /lib/modules/*$darch -iname vboxsf.ko | grep -q . + apt-get install --no-install-recommends -y \ gnome-core mc evince bash-completion ntpdate file-roller gnome-utils \ gnome-themes eog vim reportbug \ -- 2.39.5