VirtualBox

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

最後變更 在這個檔案從6574是 5999,由 vboxsync 提交於 17 年 前

The Giant CDDL Dual-License Header Change.

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
檔案大小: 3.0 KB
 
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.alldomusa.eu.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
26if [ -z "$1" ]; then
27 echo "Usage: $0 <filename.tar.gz>"
28 echo " Export VirtualBox kernel modules to <filename.tar.gz>"
29 exit 1
30fi
31
32PATH_TMP="`cd \`dirname $1\`; pwd`/.vbox_modules"
33PATH_OUT=$PATH_TMP
34FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"
35PATH_ROOT="`cd \`dirname $0\`/../../../../..; pwd`"
36PATH_VBOXDRV="$PATH_ROOT/src/VBox/HostDrivers/Support"
37
38VBOX_VERSION_MAJOR=`sed -e "s/^ *VBOX_VERSION_MAJOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
39VBOX_VERSION_MINOR=`sed -e "s/^ *VBOX_VERSION_MINOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
40VBOX_VERSION_BUILD=`sed -e "s/^ *VBOX_VERSION_BUILD *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
41
42. $PATH_VBOXDRV/linux/files_vboxdrv
43
44# Temporary path for creating the modules, will be removed later
45mkdir $PATH_TMP || exit 1
46
47# Create auto-generated version file, needed by all modules
48echo "#ifndef __version_generated_h__" > $PATH_TMP/version-generated.h
49echo "#define __version_generated_h__" >> $PATH_TMP/version-generated.h
50echo "" >> $PATH_TMP/version-generated.h
51echo "#define VBOX_VERSION_MAJOR $VBOX_VERSION_MAJOR" >> $PATH_TMP/version-generated.h
52echo "#define VBOX_VERSION_MINOR $VBOX_VERSION_MINOR" >> $PATH_TMP/version-generated.h
53echo "#define VBOX_VERSION_BUILD $VBOX_VERSION_BUILD" >> $PATH_TMP/version-generated.h
54echo "#define VBOX_VERSION_STRING \"$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD\"" >> $PATH_TMP/version-generated.h
55echo "" >> $PATH_TMP/version-generated.h
56echo "#endif" >> $PATH_TMP/version-generated.h
57
58# vboxdrv (VirtualBox host kernel module)
59mkdir $PATH_TMP/vboxdrv || exit 1
60for f in $FILES_VBOXDRV_NOBIN; do
61 install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
62done
63for f in $FILES_VBOXDRV_BIN; do
64 install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
65done
66
67# Only temporary, omit from archive
68rm $PATH_TMP/version-generated.h
69
70# Create the archive
71tar -czf $FILE_OUT -C $PATH_TMP . || exit 1
72
73# Remove the temporary directory
74rm -r $PATH_TMP
75
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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