You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
661 B

#!/bin/bash
# Create a virtualbox modules tarball from a VirtualBox binary package.
# We cannot download the package by this script because of the unpredictable
# build number being in the filename.
#
# usage: create_vbox_modules_tarball.sh VirtualBox-4.1.18-78361-Linux_amd64.run
[ -f "$1" ] || exit 1
VBOX_PACKAGE="$1"
VBOX_VER="$(echo ${VBOX_PACKAGE} | sed 's@.*VirtualBox-\([[:digit:]\.]\+\).*@\1@')"
sh ${VBOX_PACKAGE} --noexec --keep --nox11 || exit 2
cd install || exit 3
tar -xaf VirtualBox.tar.bz2 || exit 4
cd src/vboxhost || exit 5
tar -cvJf ../../../vbox-kernel-module-src-${VBOX_VER}.tar.xz . || exit 6
cd ../../.. && rm install -rf
exit 0