export_modules revision 73e8df2e481cb3697372a3cf4acffd068a7f1296
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Create a tar archive containing the sources of the vboxdrv kernel module
17d67aeb3722c094c6493a3e9a9d0cdfb9453ecdvboxsync# Copyright (C) 2007 Oracle Corporation
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# available from http://www.virtualbox.org. This file is free software;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# you can redistribute it and/or modify it under the terms of the GNU
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# General Public License (GPL) as published by the Free Software
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncif [ -z "$1" ]; then
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync echo "Usage: $0 <filename.tar.gz> [--without-hardening]"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync echo " Export VirtualBox kernel modules to <filename.tar.gz>"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncPATH_VBOXDRV="$PATH_ROOT/src/VBox/HostDrivers/Support"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncPATH_VBOXNET="$PATH_ROOT/src/VBox/HostDrivers/VBoxNetFlt"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncPATH_VBOXADP="$PATH_ROOT/src/VBox/HostDrivers/VBoxNetAdp"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncPATH_VBOXPCI="$PATH_ROOT/src/VBox/HostDrivers/VBoxPci"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncVBOX_VERSION_MAJOR=`sed -e "s/^ *VBOX_VERSION_MAJOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncVBOX_VERSION_MINOR=`sed -e "s/^ *VBOX_VERSION_MINOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncVBOX_VERSION_BUILD=`sed -e "s/^ *VBOX_VERSION_BUILD *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncVBOX_VERSION_STRING=$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncVBOX_SVN_REV=`sed -e 's/^ *VBOX_SVN_REV_FALLBACK *:= \+\$(patsubst *%:,, *\$Rev: *\([0-9]\+\) *\$ *) */\1/;t;d' $PATH_ROOT/Config.kmk` VBOX_VENDOR=`sed -e 's/^ *VBOX_VENDOR *= \+\(.\+\)/\1/;t;d' $PATH_ROOT/Config.kmk` VBOX_VENDOR_SHORT=`sed -e 's/^ *VBOX_VENDOR_SHORT *= \+\(.\+\)/\1/;t;d' $PATH_ROOT/Config.kmk` VBOX_PRODUCT=`sed -e 's/^ *VBOX_PRODUCT *= \+\(.\+\)/\1/;t;d' $PATH_ROOT/Config.kmk` VBOX_C_YEAR=`date +%Y`
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Temporary path for creating the modules, will be removed later
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Create auto-generated version file, needed by all modules
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#ifndef __version_generated_h__" > $PATH_TMP/version-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define __version_generated_h__" >> $PATH_TMP/version-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define VBOX_VERSION_MAJOR $VBOX_VERSION_MAJOR" >> $PATH_TMP/version-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define VBOX_VERSION_MINOR $VBOX_VERSION_MINOR" >> $PATH_TMP/version-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define VBOX_VERSION_BUILD $VBOX_VERSION_BUILD" >> $PATH_TMP/version-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define VBOX_VERSION_STRING \"$VBOX_VERSION_STRING\"" >> $PATH_TMP/version-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Create auto-generated revision file, needed by all modules
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#ifndef __revision_generated_h__" > $PATH_TMP/revision-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define __revision_generated_h__" >> $PATH_TMP/revision-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define VBOX_SVN_REV $VBOX_SVN_REV" >> $PATH_TMP/revision-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Create auto-generated product file, needed by all modules
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#ifndef __product_generated_h__" > $PATH_TMP/product-generated.h
c6adb272ec43d5eaadb1493cb2bf45f2f8adf588vboxsyncecho "#define __product_generated_h__" >> $PATH_TMP/product-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define VBOX_VENDOR \"$VBOX_VENDOR\"" >> $PATH_TMP/product-generated.h
58b7773f17a933ab8d53f450bed0afcf2f003508vboxsyncecho "#define VBOX_VENDOR_SHORT \"$VBOX_VENDOR_SHORT\"" >> $PATH_TMP/product-generated.h
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsyncecho "#define VBOX_PRODUCT \"$VBOX_PRODUCT\"" >> $PATH_TMP/product-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncecho "#define VBOX_C_YEAR \"$VBOX_C_YEAR\"" >> $PATH_TMP/product-generated.h
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# vboxdrv (VirtualBox host kernel module)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncsed -e "s;_VERSION_;$VBOX_VERSION_STRING;g" < $PATH_VBOXDRV/linux/dkms.conf > $PATH_TMP/vboxdrv/dkms.conf
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync cat $PATH_VBOXDRV/linux/Makefile > $PATH_TMP/vboxdrv/Makefile
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXDRV/linux/Makefile > $PATH_TMP/vboxdrv/Makefile
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# vboxnetflt (VirtualBox netfilter kernel module)
c6adb272ec43d5eaadb1493cb2bf45f2f8adf588vboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxnetflt/`echo $f|cut -d'>' -f2`"
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsyncsed -e "s;_VERSION_;$VBOX_VERSION_STRING;g" < $PATH_VBOXNET/linux/dkms.conf > $PATH_TMP/vboxnetflt/dkms.conf
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
257927abbaa6d9774427049fcbea552cda362281vboxsync cat $PATH_VBOXNET/linux/Makefile > $PATH_TMP/vboxnetflt/Makefile
257927abbaa6d9774427049fcbea552cda362281vboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXNET/linux/Makefile > $PATH_TMP/vboxnetflt/Makefile
3c49234930c10a52368b992781dae0306a72b5f5vboxsync# vboxnetadp (VirtualBox network adapter kernel module)
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxnetadp/`echo $f|cut -d'>' -f2`"
1d17a5f9688f3622ffe088b664588629b1e95801vboxsyncsed -e "s;_VERSION_;$VBOX_VERSION_STRING;g" < $PATH_VBOXADP/linux/dkms.conf > $PATH_TMP/vboxnetadp/dkms.conf
17d67aeb3722c094c6493a3e9a9d0cdfb9453ecdvboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync cat $PATH_VBOXADP/linux/Makefile > $PATH_TMP/vboxnetadp/Makefile
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXADP/linux/Makefile > $PATH_TMP/vboxnetadp/Makefile
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# vboxpci (VirtualBox host PCI access kernel module)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxpci/`echo $f|cut -d'>' -f2`"
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncsed -e "s;_VERSION_;$VBOX_VERSION_STRING;g" < $PATH_VBOXPCI/linux/dkms.conf > $PATH_TMP/vboxpci/dkms.conf
254365851c06fac7efeae0a0bf727ed6c6940611vboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync cat $PATH_VBOXPCI/linux/Makefile > $PATH_TMP/vboxpci/Makefile
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXPCI/linux/Makefile > $PATH_TMP/vboxpci/Makefile
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncinstall -D -m 0644 $PATH_LINUX/Makefile $PATH_TMP/Makefile
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncinstall -D -m 0755 $PATH_LINUX/build_in_tmp $PATH_TMP/build_in_tmp
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync# Only temporary, omit from archive
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Create the archive
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Remove the temporary directory