export_modules revision fcfca16ae0b575f4a0a8baf45928c6684c265de2
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Create a tar archive containing the sources of the vboxdrv kernel module
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync# Copyright (C) 2007-2012 Oracle Corporation
b2c3f5df103036986b56a7d5815b20d50399a372vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# available from http://www.virtualbox.org. This file is free software;
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# you can redistribute it and/or modify it under the terms of the GNU
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# General Public License (GPL) as published by the Free Software
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncif [ -z "$1" ]; then
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync echo "Usage: $0 <filename.tar.gz> [--without-hardening]"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync echo " Export VirtualBox kernel modules to <filename.tar.gz>"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncPATH_VBOXDRV="$PATH_ROOT/src/VBox/HostDrivers/Support"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncPATH_VBOXNET="$PATH_ROOT/src/VBox/HostDrivers/VBoxNetFlt"
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncPATH_VBOXADP="$PATH_ROOT/src/VBox/HostDrivers/VBoxNetAdp"
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncPATH_VBOXPCI="$PATH_ROOT/src/VBox/HostDrivers/VBoxPci"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncVBOX_VERSION_MAJOR=`sed -e "s/^ *VBOX_VERSION_MAJOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncVBOX_VERSION_MINOR=`sed -e "s/^ *VBOX_VERSION_MINOR *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncVBOX_VERSION_BUILD=`sed -e "s/^ *VBOX_VERSION_BUILD *= \+\([0-9]\+\)/\1/;t;d" $PATH_ROOT/Config.kmk`
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncVBOX_VERSION_STRING=$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncVBOX_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`
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Temporary path for creating the modules, will be removed later
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Create auto-generated version file, needed by all modules
fcfca16ae0b575f4a0a8baf45928c6684c265de2vboxsyncecho "#ifndef ___version_generated_h___" > $PATH_TMP/version-generated.h
fcfca16ae0b575f4a0a8baf45928c6684c265de2vboxsyncecho "#define ___version_generated_h___" >> $PATH_TMP/version-generated.h
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncecho "#define VBOX_VERSION_MAJOR $VBOX_VERSION_MAJOR" >> $PATH_TMP/version-generated.h
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncecho "#define VBOX_VERSION_MINOR $VBOX_VERSION_MINOR" >> $PATH_TMP/version-generated.h
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncecho "#define VBOX_VERSION_BUILD $VBOX_VERSION_BUILD" >> $PATH_TMP/version-generated.h
fcfca16ae0b575f4a0a8baf45928c6684c265de2vboxsyncecho "#define VBOX_VERSION_STRING_RAW \"$VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD\"" >> $PATH_TMP/version-generated.h
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncecho "#define VBOX_VERSION_STRING \"$VBOX_VERSION_STRING\"" >> $PATH_TMP/version-generated.h
fcfca16ae0b575f4a0a8baf45928c6684c265de2vboxsyncecho "#define VBOX_API_VERSION_STRING \"${VBOX_VERSION_MAJOR}_${VBOX_VERSION_MINOR}\"" >> $PATH_TMP/version-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# Create auto-generated revision file, needed by all modules
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncecho "#ifndef __revision_generated_h__" > $PATH_TMP/revision-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncecho "#define __revision_generated_h__" >> $PATH_TMP/revision-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncecho "#define VBOX_SVN_REV $VBOX_SVN_REV" >> $PATH_TMP/revision-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# Create auto-generated product file, needed by all modules
fcfca16ae0b575f4a0a8baf45928c6684c265de2vboxsyncecho "#ifndef ___product_generated_h___" > $PATH_TMP/product-generated.h
fcfca16ae0b575f4a0a8baf45928c6684c265de2vboxsyncecho "#define ___product_generated_h___" >> $PATH_TMP/product-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncecho "#define VBOX_VENDOR \"$VBOX_VENDOR\"" >> $PATH_TMP/product-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncecho "#define VBOX_VENDOR_SHORT \"$VBOX_VENDOR_SHORT\"" >> $PATH_TMP/product-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncecho "#define VBOX_PRODUCT \"$VBOX_PRODUCT\"" >> $PATH_TMP/product-generated.h
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncecho "#define VBOX_C_YEAR \"$VBOX_C_YEAR\"" >> $PATH_TMP/product-generated.h
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# vboxdrv (VirtualBox host kernel module)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync install -D -m 0755 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxdrv/`echo $f|cut -d'>' -f2`"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync cat $PATH_VBOXDRV/linux/Makefile > $PATH_TMP/vboxdrv/Makefile
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXDRV/linux/Makefile > $PATH_TMP/vboxdrv/Makefile
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# vboxnetflt (VirtualBox netfilter kernel module)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxnetflt/`echo $f|cut -d'>' -f2`"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync cat $PATH_VBOXNET/linux/Makefile > $PATH_TMP/vboxnetflt/Makefile
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXNET/linux/Makefile > $PATH_TMP/vboxnetflt/Makefile
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# vboxnetadp (VirtualBox network adapter kernel module)
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxnetadp/`echo $f|cut -d'>' -f2`"
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync cat $PATH_VBOXADP/linux/Makefile > $PATH_TMP/vboxnetadp/Makefile
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXADP/linux/Makefile > $PATH_TMP/vboxnetadp/Makefile
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync# vboxpci (VirtualBox host PCI access kernel module)
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync install -D -m 0644 `echo $f|cut -d'=' -f1` "$PATH_TMP/vboxpci/`echo $f|cut -d'>' -f2`"
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncif [ -n "$VBOX_WITH_HARDENING" ]; then
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync cat $PATH_VBOXPCI/linux/Makefile > $PATH_TMP/vboxpci/Makefile
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync sed -e "s;-DVBOX_WITH_HARDENING;;g" < $PATH_VBOXPCI/linux/Makefile > $PATH_TMP/vboxpci/Makefile
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncinstall -D -m 0644 $PATH_LINUX/Makefile $PATH_TMP/Makefile
73e8df2e481cb3697372a3cf4acffd068a7f1296vboxsyncinstall -D -m 0755 $PATH_LINUX/build_in_tmp $PATH_TMP/build_in_tmp
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Only temporary, omit from archive
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Create the archive
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Remove the temporary directory