Commit eeb9a66a authored by amnesia's avatar amnesia
Browse files

build virtualbox-ose kernel modules at image build time

parent 4ff6dbbc
Package: dkms
Pin: release a=lenny-backports
Pin-Priority: 999
Package: firmware-linux
Pin: release a=lenny-backports
Pin-Priority: 999
......@@ -34,6 +38,10 @@ Package: virtualbox-ose-guest-x11
Pin: release a=lenny-backports
Pin-Priority: 999
Package: virtualbox-ose-guest-source
Pin: release a=lenny-backports
Pin-Priority: 999
Package: *
Pin: release a=stable
Pin-Priority: 900
......
#!/bin/sh
# Including common functions
. "${LH_BASE:-/usr/share/live-helper}"/functions.sh
# Setting static variables
DESCRIPTION="$(Echo 'building VirtualBox guest modules')"
HELP=""
USAGE="${PROGRAM}"
# Reading configuration files
Read_conffiles config/all config/common config/chroot
Set_defaults
MODULE=virtualbox-ose-guest
Echo_message "Building VirtualBox guest modules"
# the -source package must be installed *after* dkms to be properly registered
apt-get install --yes build-essential dkms dpatch
apt-get install --yes virtualbox-ose-guest-source
for KERNEL in /boot/vmlinuz-*
do
KERNEL_VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')"
KERNEL_ARCH="$(basename ${KERNEL} | sed -e 's|.*-||')"
VBOX_VERSION=`dpkg-query -W -f='${Version}' virtualbox-ose-guest-source | awk -F "-" '{print $1}' | cut -d\: -f2`
apt-get install --yes linux-headers-2.6-${KERNEL_ARCH}
dkms build -m virtualbox-ose-guest -v ${VBOX_VERSION} -m ${MODULE} -k ${KERNEL_VERSION}
dkms install -m virtualbox-ose-guest -v ${VBOX_VERSION} -m ${MODULE} -k ${KERNEL_VERSION}
done
# clean the build directory
rm -rf /var/lib/dkms/virtualbox-ose-guest/
# virtualbox-ose-guest-source's postrm script deletes any previously
# built binary module; let's delete it before purging the package.
rm -f /var/lib/dpkg/info/virtualbox-ose-guest-source.prerm
# use aptitude to remove the dependencies, as Lenny's APT lacks the
# autoremove action
aptitude --assume-yes purge \
build-essential dkms dpatch dpkg-dev \
cpp-4.1 \
gcc gcc-4.1 gcc-4.1-base gcc-4.2-base \
g++ \
virtualbox-ose-guest-source
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment