VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/linux/build_in_tmp@ 2676

Last change on this file since 2676 was 2641, checked in by vboxsync, 17 years ago

export to OSE, added proper license

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1#!/bin/sh
2
3#
4# Script to build a kernel module in /tmp. Useful if the module sources
5# are installed in read-only directory.
6#
7# Copyright (C) 2007 InnoTek Systemberatung 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#
17# If you received this file as part of a commercial VirtualBox
18# distribution, then only the terms of your commercial VirtualBox
19# license agreement apply instead of the previous paragraph.
20#
21
22# find a unique temp directory
23num=0
24while true; do
25 tmpdir="/tmp/vbox.$num"
26 if mkdir -m 0755 "$tmpdir" 2> /dev/null; then
27 break
28 fi
29 num=`expr $num + 1`
30 if [ $num -gt 200 ]; then
31 echo "Could not find a valid tmp directory"
32 exit 1
33 fi
34done
35
36# copy
37cp -a ${0%/*}/* $tmpdir/
38
39# make, cleanup if success
40cd "$tmpdir"
41if make "$@"; then
42 rm -rf $tmpdir
43 exit 0
44fi
45
46# failure
47exit 1
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use