build_in_tmp revision de8e40551b020624bc0683e5905f06b51f3ceebe
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# Script to build a kernel module in /tmp. Useful if the module sources
9bff67898d55cddfcec9ce30cc2b1bb6211ec691David Lawrence# are installed in read-only directory.
9bff67898d55cddfcec9ce30cc2b1bb6211ec691David Lawrence# Copyright (C) 2007 innotek GmbH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# This file is part of VirtualBox Open Source Edition (OSE), as
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# available from http://www.virtualbox.org. This file is free software;
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# you can redistribute it and/or modify it under the terms of the GNU
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# General Public License as published by the Free Software Foundation,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# distribution. VirtualBox OSE is distributed in the hope that it will
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# be useful, but WITHOUT ANY WARRANTY of any kind.
9bff67898d55cddfcec9ce30cc2b1bb6211ec691David Lawrence# If you received this file as part of a commercial VirtualBox
69f08f8ae4980678911fa2d81323a0930708db4aMark Andrews# distribution, then only the terms of your commercial VirtualBox
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence# license agreement apply instead of the previous paragraph.
767d29c43d98bae8ea95f0ccd2b9653cbcd43310Bob Halley# find a unique temp directory
767d29c43d98bae8ea95f0ccd2b9653cbcd43310Bob Halleywhile true; do
767d29c43d98bae8ea95f0ccd2b9653cbcd43310Bob Halley echo "Could not find a valid tmp directory"
e1747e09e7cc6771dca1a1702e42e6401dbeebedDavid Lawrence# make, cleanup if success
e1747e09e7cc6771dca1a1702e42e6401dbeebedDavid Lawrence if [ -n "$SAVE_MOD_SYMVERS" ]; then
e1747e09e7cc6771dca1a1702e42e6401dbeebedDavid Lawrence if [ -f Module.symvers ]; then