VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/export_modules@ 7440

Last change on this file since 7440 was 5999, checked in by vboxsync, 17 years ago

The Giant CDDL Dual-License Header Change.

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