VirtualBox

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

Last change on this file since 10258 was 8155, checked in by vboxsync, 17 years ago

The Big Sun Rebranding Header Change

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 3.5 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 Sun Microsystems, Inc.
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 (GPL) as published by the Free Software
12# Foundation, in version 2 as it comes in the "COPYING" file of the
13# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16# The contents of this file may alternatively be used under the terms
17# of the Common Development and Distribution License Version 1.0
18# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19# VirtualBox OSE distribution, in which case the provisions of the
20# CDDL are applicable instead of those of the GPL.
21#
22# You may elect to license modified versions of this file under the
23# terms and conditions of either the GPL or the CDDL or both.
24#
25# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26# Clara, CA 95054 USA or visit http://www.sun.com if you need
27# additional information or have any questions.
28#
29
30if [ -z "$1" ]; then
31 echo "Usage: $0 <filename.tar.gz>"
32 echo " Export VirtualBox kernel modules to <filename.tar.gz>"
33 exit 1
34fi
35
36PATH_TMP="`cd \`dirname $1\`; pwd`/.vbox_modules"
37PATH_OUT=$PATH_TMP
38FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"
39PATH_ROOT="`cd \`dirname $0\`/../../../../..; pwd`"
40PATH_VBOXDRV="$PATH_ROOT/src/VBox/HostDrivers/Support"
41
42VBOX_VERSION_MAJOR=`sed -e "s/^ *VBOX_VERSION_MAJOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
43VBOX_VERSION_MINOR=`sed -e "s/^ *VBOX_VERSION_MINOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
44VBOX_VERSION_BUILD=`sed -e "s/^ *VBOX_VERSION_BUILD *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
45VBOX_VERSION_STRING=$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD
46
47. $PATH_VBOXDRV/linux/files_vboxdrv
48
49# Temporary path for creating the modules, will be removed later
50mkdir $PATH_TMP || exit 1
51
52# Create auto-generated version file, needed by all modules
53echo "#ifndef __version_generated_h__" > $PATH_TMP/version-generated.h
54echo "#define __version_generated_h__" >> $PATH_TMP/version-generated.h
55echo "" >> $PATH_TMP/version-generated.h
56echo "#define VBOX_VERSION_MAJOR $VBOX_VERSION_MAJOR" >> $PATH_TMP/version-generated.h
57echo "#define VBOX_VERSION_MINOR $VBOX_VERSION_MINOR" >> $PATH_TMP/version-generated.h
58echo "#define VBOX_VERSION_BUILD $VBOX_VERSION_BUILD" >> $PATH_TMP/version-generated.h
59echo "#define VBOX_VERSION_STRING \"$VBOX_VERSION_STRING\"" >> $PATH_TMP/version-generated.h
60echo "" >> $PATH_TMP/version-generated.h
61echo "#endif" >> $PATH_TMP/version-generated.h
62
63# vboxdrv (VirtualBox host kernel module)
64mkdir $PATH_TMP/vboxdrv || exit 1
65for f in $FILES_VBOXDRV_NOBIN; do
66 install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
67done
68for f in $FILES_VBOXDRV_BIN; do
69 install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
70done
71sed -e "s;_VERSION_;$VBOX_VERSION_STRING;g" < $PATH_VBOXDRV/linux/build_in_tmp > $PATH_TMP/vboxdrv/build_in_tmp
72chmod 0755 $PATH_TMP/vboxdrv/build_in_tmp
73sed -e "s;_VERSION_;$VBOX_VERSION_STRING;g" < $PATH_VBOXDRV/linux/dkms.conf > $PATH_TMP/vboxdrv/dkms.conf
74
75# Only temporary, omit from archive
76rm $PATH_TMP/version-generated.h
77
78# Create the archive
79tar -czf $FILE_OUT -C $PATH_TMP . || exit 1
80
81# Remove the temporary directory
82rm -r $PATH_TMP
83
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