VirtualBox

source: vbox/trunk/debian/preinst.in@ 13373

Last change on this file since 13373 was 9190, checked in by vboxsync, 17 years ago

synced debian/, use vboxdrv and vboxnet from the Installer directory

File size: 2.0 KB
Line 
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
15db_version 2.0
16db_capb backup
17
18# check for upgrade, disable this check for now
19if 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
32fi
33
34# check for old installation
35if [ -r /etc/vbox/vbox.cfg ]; then
36 . /etc/vbox/vbox.cfg
37 if [ "x$INSTALL_DIR" != "x" -a -d "$INSTALL_DIR" ]; then
38 db_fset virtualbox/old-installation-found seen false || true
39 db_input high virtualbox/old-installation-found || true
40 db_go || true
41 exit 1
42 fi
43 # we will remove that file in postinst
44fi
45
46# check for old vboxdrv modules
47if find /lib/modules -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
48 # old modules found
49 db_get virtualbox-ose/delete-old-modules
50 if [ "$RET" = "false" ]; then
51 cat << EOF
52Old vboxdrv kernel modules found in
53EOF
54 find /lib/modules -name "vboxdrv\.*" 2>/dev/null|sed "s+\(.*\)+ \1+g"
55 cat << EOF
56Removing of these modules denied by debconf setting
57EOF
58 else
59 db_input critical virtualbox-ose/delete-old-modules || true
60 db_go || true
61 db_get virtualbox-ose/delete-old-modules
62 if [ "$RET" = "true" ]; then
63 find /lib/modules -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
64 fi
65 fi
66fi
67
68#DEBHELPER#
69
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