aboutsummaryrefslogtreecommitdiff
path: root/system/virtualbox-kernel-addons/virtualbox-kernel-addons-mksrctarball.sh
blob: 251e24f1e2c1f9ab5b1a87f848fa4855a7bdfefc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# This script helps you to make the source package
# of the virtualbox guest additions kernel modules.
# IMPORTANT: The virtualbox-ose-addons version you want to use
# must already be installed!

# Based on the ffmpeg-mksrctarball.sh from the SlackBuilds.org repository

set -e

PRGNAM=virtualbox-kernel-addons
VERSION=$(VBoxControl --help 2>/dev/null | grep OSE | rev | cut -d " " -f 1 | rev | cut -d "_" -f 1)

mkdir $PRGNAM

echo "--> Copying sourcecode from /usr/src"
cp -rf /usr/src/vboxguest-$VERSION $PRGNAM/vboxguest
cp -rf /usr/src/vboxsf-$VERSION $PRGNAM/vboxsf
cp -rf /usr/src/vboxvideo-$VERSION $PRGNAM/vboxvideo

echo "--> Making the sourcecode tarball: $PRGNAM-src-$VERSION.tar.xz"
tar -cJf $PRGNAM-$VERSION.tar.xz $PRGNAM

echo "--> Erasing the sourcecode directory: $PRGNAM/"
rm -rf $PRGNAM/

echo "--> Sourcecode tarball for $PRGNAM: $PRGNAM-$VERSION.tar.xz"