VirtualBox

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

Last change on this file since 4163 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 2.6 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
16if [ -z "$1" ]; then
17 echo "Usage: $0 <filename.tar.gz>"
18 echo " Export VirtualBox kernel modules to <filename.tar.gz>"
19 exit 1
20fi
21
22PATH_TMP="`cd \`dirname $1\`; pwd`/.vbox_modules"
23PATH_OUT=$PATH_TMP
24FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"
25PATH_ROOT="`cd \`dirname $0\`/../../../../..; pwd`"
26PATH_VBOXDRV="$PATH_ROOT/src/VBox/HostDrivers/Support"
27
28VBOX_VERSION_MAJOR=`sed -e "s/^ *VBOX_VERSION_MAJOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
29VBOX_VERSION_MINOR=`sed -e "s/^ *VBOX_VERSION_MINOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
30VBOX_VERSION_BUILD=`sed -e "s/^ *VBOX_VERSION_BUILD *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
31
32. $PATH_VBOXDRV/linux/files_vboxdrv
33
34# Temporary path for creating the modules, will be removed later
35mkdir $PATH_TMP || exit 1
36
37# Create auto-generated version file, needed by all modules
38echo "#ifndef __version_generated_h__" > $PATH_TMP/version-generated.h
39echo "#define __version_generated_h__" >> $PATH_TMP/version-generated.h
40echo "" >> $PATH_TMP/version-generated.h
41echo "#define VBOX_VERSION_MAJOR $VBOX_VERSION_MAJOR" >> $PATH_TMP/version-generated.h
42echo "#define VBOX_VERSION_MINOR $VBOX_VERSION_MINOR" >> $PATH_TMP/version-generated.h
43echo "#define VBOX_VERSION_BUILD $VBOX_VERSION_BUILD" >> $PATH_TMP/version-generated.h
44echo "#define VBOX_VERSION_STRING \"$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD\"" >> $PATH_TMP/version-generated.h
45echo "" >> $PATH_TMP/version-generated.h
46echo "#endif" >> $PATH_TMP/version-generated.h
47
48# vboxdrv (VirtualBox host kernel module)
49mkdir $PATH_TMP/vboxdrv || exit 1
50for f in $FILES_VBOXDRV_NOBIN; do
51 install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
52done
53for f in $FILES_VBOXDRV_BIN; do
54 install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
55done
56
57# Only temporary, omit from archive
58rm $PATH_TMP/version-generated.h
59
60# Create the archive
61tar -czf $FILE_OUT -C $PATH_TMP . || exit 1
62
63# Remove the temporary directory
64rm -r $PATH_TMP
65
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