VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/linux/export_modules@ 3393

Last change on this file since 3393 was 2988, checked in by vboxsync, 18 years ago

InnoTek -> innotek part 4: more miscellaneous files.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 2.8 KB
Line 
1#!/bin/sh
2
3#
4# Create a tar archive containing the sources of the vboxdrv kernel module
5#
6# Copyright (C) 2007 innotek GmbH
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License as published by the Free Software Foundation,
12# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13# distribution. VirtualBox OSE is distributed in the hope that it will
14# be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16# If you received this file as part of a commercial VirtualBox
17# distribution, then only the terms of your commercial VirtualBox
18# license agreement apply instead of the previous paragraph.
19#
20
21if [ -z "$1" ]; then
22 echo "Usage: $0 <filename.tar.gz>"
23 echo " Export VirtualBox kernel modules to <filename.tar.gz>"
24 exit 1
25fi
26
27PATH_TMP="`cd \`dirname $1\`; pwd`/.vbox_modules"
28PATH_OUT=$PATH_TMP
29FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"
30PATH_ROOT="`cd \`dirname $0\`/../../../../..; pwd`"
31PATH_VBOXDRV="$PATH_ROOT/src/VBox/HostDrivers/Support"
32
33VBOX_VERSION_MAJOR=`sed -e "s/^ *VBOX_VERSION_MAJOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
34VBOX_VERSION_MINOR=`sed -e "s/^ *VBOX_VERSION_MINOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
35VBOX_VERSION_BUILD=`sed -e "s/^ *VBOX_VERSION_BUILD *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
36
37. $PATH_VBOXDRV/linux/files_vboxdrv
38
39# Temporary path for creating the modules, will be removed later
40mkdir $PATH_TMP || exit 1
41
42# Create auto-generated version file, needed by all modules
43echo "#ifndef __version_generated_h__" > $PATH_TMP/version-generated.h
44echo "#define __version_generated_h__" >> $PATH_TMP/version-generated.h
45echo "" >> $PATH_TMP/version-generated.h
46echo "#define VBOX_VERSION_MAJOR $VBOX_VERSION_MAJOR" >> $PATH_TMP/version-generated.h
47echo "#define VBOX_VERSION_MINOR $VBOX_VERSION_MINOR" >> $PATH_TMP/version-generated.h
48echo "#define VBOX_VERSION_BUILD $VBOX_VERSION_BUILD" >> $PATH_TMP/version-generated.h
49echo "#define VBOX_VERSION_STRING \"$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD\"" >> $PATH_TMP/version-generated.h
50echo "" >> $PATH_TMP/version-generated.h
51echo "#endif" >> $PATH_TMP/version-generated.h
52
53# vboxdrv (VirtualBox host kernel module)
54mkdir $PATH_TMP/vboxdrv || exit 1
55for f in $FILES_VBOXDRV_NOBIN; do
56 install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
57done
58for f in $FILES_VBOXDRV_BIN; do
59 install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
60done
61
62# Only temporary, omit from archive
63rm $PATH_TMP/version-generated.h
64
65# Create the archive
66tar -czf $FILE_OUT -C $PATH_TMP . || exit 1
67
68# Remove the temporary directory
69rm -r $PATH_TMP
70
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette