~ubuntu-branches/ubuntu/natty/virtualbox-ose/natty-updates

« back to all changes in this revision

Viewing changes to src/VBox/HostDrivers/linux/build_in_tmp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-10-15 02:12:28 UTC
  • mfrom: (0.3.10 upstream) (0.4.19 sid)
  • Revision ID: james.westby@ubuntu.com-20101015021228-5e6vbxgtes8mg189
Tags: 3.2.10-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - VirtualBox should go in Accessories, not in System tools.
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Add ubuntu-01-fix-build-gcc45.patch to fix FTBFS due to uninitalized
  variables. Thanks to Lubomir Rintel <lkundrak@v3.sk> for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
#
4
4
# Script to build a kernel module in /tmp. Useful if the module sources
5
 
# are installed in read-only directory.
 
5
# are installed in read-only directory. Not for DKMS!
6
6
#
7
 
# Copyright (C) 2007 Oracle Corporation
 
7
# Copyright (C) 2007-2010 Oracle Corporation
8
8
#
9
9
# This file is part of VirtualBox Open Source Edition (OSE), as
10
10
# available from http://www.virtualbox.org. This file is free software;
18
18
# Set the build type
19
19
export BUILD_TYPE=_BUILDTYPE_
20
20
 
21
 
# Attempt to build using DKMS first
22
 
DKMS=`which dkms 2>/dev/null` 
23
 
if [ "$1" = "--no-dkms" ]; then
24
 
  shift
25
 
  DKMS=""
26
 
fi
27
 
if [ -n "$DKMS" ]
28
 
then
29
 
    echo "Attempting to install using DKMS"
30
 
    $DKMS status -m _MODULE_ | while read line
31
 
    # first, remove _any_ old module
32
 
    do
33
 
        if echo "$line" | grep -q added > /dev/null ||
34
 
           echo "$line" | grep -q built > /dev/null ||
35
 
           echo "$line" | grep -q installed > /dev/null; then
36
 
            # either 'vboxvideo, <version>: added' or 'vboxvideo, <version>, ...: installed'
37
 
            version=`echo "$line" | sed "s/_MODULE_,\([^,]*\)[,:].*/\1/;t;d"`
38
 
            echo "  removing old DKMS module _MODULE_ version $version"
39
 
            $DKMS remove -m _MODULE_ -v $version --all
40
 
        fi
41
 
    done
42
 
    # there should not be any more matches
43
 
    status=`$DKMS status -m _MODULE_ -v _VERSION_`
44
 
    if echo $status | grep added > /dev/null ||
45
 
        echo $status | grep built > /dev/null ||
46
 
        echo $status | grep installed > /dev/null
47
 
    then
48
 
        $DKMS remove -m _MODULE_ -v _VERSION_ --all
49
 
    fi
50
 
    # finally install the module
51
 
    if $DKMS add -m _MODULE_ -v _VERSION_ &&
52
 
        $DKMS build -m _MODULE_ -v _VERSION_ &&
53
 
        $DKMS install -m _MODULE_ -v _VERSION_ --force
54
 
    then
55
 
        exit 0
56
 
    fi
57
 
    echo "Failed to install using DKMS, attempting to install without"
58
 
fi
59
 
 
60
21
# find a unique temp directory
61
22
num=0
62
23
while true; do