VirtualBox

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

Last change on this file since 4743 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: 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 as published by the Free Software Foundation,
13# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14# distribution. VirtualBox OSE is distributed in the hope that it will
15# be useful, but WITHOUT ANY WARRANTY of any kind.
16
17if [ -z "$1" ]; then
18 echo "Usage: $0 <filename.tar.gz>"
19 echo " Export VirtualBox kernel modules to <filename.tar.gz>"
20 exit 1
21fi
22
23PATH_TMP="`cd \`dirname $1\`; pwd`/.vbox_modules"
24PATH_OUT=$PATH_TMP
25FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"
26PATH_ROOT="`cd \`dirname $0\`/../../../..; pwd`"
27PATH_VBOXADD="$PATH_ROOT/src/VBox/Additions/linux/module"
28PATH_VBOXVFS="$PATH_ROOT/src/VBox/Additions/linux/sharedfolders"
29
30VBOX_VERSION_MAJOR=`sed -e "s/^ *VBOX_VERSION_MAJOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
31VBOX_VERSION_MINOR=`sed -e "s/^ *VBOX_VERSION_MINOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
32VBOX_VERSION_BUILD=`sed -e "s/^ *VBOX_VERSION_BUILD *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
33
34. $PATH_VBOXADD/files_vboxadd
35. $PATH_VBOXVFS/files_vboxvfs
36
37# Temporary path for creating the modules, will be removed later
38mkdir $PATH_TMP || exit 1
39
40# Create auto-generated version file, needed by all modules
41echo "#ifndef __version_generated_h__" > $PATH_TMP/version-generated.h
42echo "#define __version_generated_h__" >> $PATH_TMP/version-generated.h
43echo "" >> $PATH_TMP/version-generated.h
44echo "#define VBOX_VERSION_MAJOR $VBOX_VERSION_MAJOR" >> $PATH_TMP/version-generated.h
45echo "#define VBOX_VERSION_MINOR $VBOX_VERSION_MINOR" >> $PATH_TMP/version-generated.h
46echo "#define VBOX_VERSION_BUILD $VBOX_VERSION_BUILD" >> $PATH_TMP/version-generated.h
47echo "#define VBOX_VERSION_STRING \"$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD\"" >> $PATH_TMP/version-generated.h
48echo "" >> $PATH_TMP/version-generated.h
49echo "#endif" >> $PATH_TMP/version-generated.h
50
51# vboxadd (VirtualBox guest kernel module)
52mkdir $PATH_TMP/vboxadd || exit 1
53for f in $FILES_VBOXADD_NOBIN; do
54 install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxadd/`echo $f|cut -d'>' -f2`"
55done
56for f in $FILES_VBOXADD_BIN; do
57 install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxadd/`echo $f|cut -d'>' -f2`"
58done
59
60# vboxvfs (VirtualBox guest kernel module for shared folders)
61mkdir $PATH_TMP/vboxvfs || exit 1
62for f in $FILES_VBOXVFS_NOBIN; do
63 install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxvfs/`echo $f|cut -d'>' -f2`"
64done
65for f in $FILES_VBOXVFS_BIN; do
66 install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxvfs/`echo $f|cut -d'>' -f2`"
67done
68
69# Only temporary, omit from archive
70rm $PATH_TMP/version-generated.h
71
72# Create the archive
73tar -czf $FILE_OUT -C $PATH_TMP . || exit 1
74
75# Remove the temporary directory
76rm -r $PATH_TMP
77
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