1 | #!/bin/bash -e
|
---|
2 | #
|
---|
3 | # Copyright (C) 2006-2008 Sun Microsystems, Inc.
|
---|
4 | #
|
---|
5 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
6 | # available from http://www.virtualbox.org. This file is free software;
|
---|
7 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
8 | # General Public License as published by the Free Software Foundation,
|
---|
9 | # in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
10 | # distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
11 | # be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
12 | #
|
---|
13 |
|
---|
14 | . /usr/share/debconf/confmodule
|
---|
15 | db_version 2.0
|
---|
16 | db_capb backup
|
---|
17 |
|
---|
18 | # check for upgrade, disable this check for now
|
---|
19 | if false; then
|
---|
20 | ver_new=%VER%
|
---|
21 | ver_old=`echo $2 | cut -f1 -d"-"`
|
---|
22 | if [ -n "$ver_old" -a "$ver_new" == "$ver_old" ]; then
|
---|
23 | db_get virtualbox-ose/update_version_change
|
---|
24 | db_input critical virtualbox-ose/update_version_change || true
|
---|
25 | db_go || true
|
---|
26 | db_get virtualbox-ose/update_version_change || true
|
---|
27 | if [ "$RET" = false ]; then
|
---|
28 | db_stop
|
---|
29 | exit 1
|
---|
30 | fi
|
---|
31 | fi
|
---|
32 | fi
|
---|
33 |
|
---|
34 | # check for old vboxdrv modules
|
---|
35 | if find /lib/modules -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
|
---|
36 | # old modules found
|
---|
37 | db_get virtualbox-ose/delete-old-modules
|
---|
38 | if [ "$RET" = "false" ]; then
|
---|
39 | cat << EOF
|
---|
40 | Old vboxdrv kernel modules found in
|
---|
41 | EOF
|
---|
42 | find /lib/modules -name "vboxdrv\.*" 2>/dev/null|sed "s+\(.*\)+ \1+g"
|
---|
43 | cat << EOF
|
---|
44 | Removing of these modules denied by debconf setting
|
---|
45 | EOF
|
---|
46 | else
|
---|
47 | db_input critical virtualbox-ose/delete-old-modules || true
|
---|
48 | db_go || true
|
---|
49 | db_get virtualbox-ose/delete-old-modules
|
---|
50 | if [ "$RET" = "true" ]; then
|
---|
51 | find /lib/modules -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
|
---|
52 | fi
|
---|
53 | fi
|
---|
54 | fi
|
---|
55 |
|
---|
56 | #DEBHELPER#
|
---|
57 |
|
---|