VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/linux/build_in_tmp@ 32611

Last change on this file since 32611 was 32183, checked in by vboxsync, 14 years ago

Linux Installer/Additions: attempt to properly register the host/guest kernel modules at DKMS and use the setup function of the service script to compile the modules instead of doing this separately in the installer scripts

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 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. Not for DKMS!
6#
7# Copyright (C) 2007-2010 Oracle Corporation
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 (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18# Set the build type
19export BUILD_TYPE=_BUILDTYPE_
20
21# find a unique temp directory
22num=0
23while true; do
24 tmpdir="/tmp/vbox.$num"
25 if mkdir -m 0755 "$tmpdir" 2> /dev/null; then
26 break
27 fi
28 num=`expr $num + 1`
29 if [ $num -gt 200 ]; then
30 echo "Could not find a valid tmp directory"
31 exit 1
32 fi
33done
34
35if [ "$1" = "--save-module-symvers" ]; then
36 shift
37 SAVE_MOD_SYMVERS="$1"
38 shift
39fi
40
41if [ "$1" = "--use-module-symvers" ]; then
42 shift
43 USE_MOD_SYMVERS="$1"
44 shift
45fi
46
47# copy
48cp -a ${0%/*}/* $tmpdir/
49if [ -n "$USE_MOD_SYMVERS" ]; then
50 cp $USE_MOD_SYMVERS $tmpdir/Module.symvers
51fi
52
53# make, cleanup if success
54cd "$tmpdir"
55if make "$@"; then
56 if [ -n "$SAVE_MOD_SYMVERS" ]; then
57 if [ -f Module.symvers ]; then
58 cp -f Module.symvers $SAVE_MOD_SYMVERS
59 else
60 cat /dev/null > $SAVE_MOD_SYMVERS
61 fi
62 fi
63 rm -rf $tmpdir
64 exit 0
65fi
66
67# failure
68rm -rf $tmpdir
69exit 1
Note: See TracBrowser for help on using the repository browser.

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