VirtualBox

Changeset 13353 in vbox


Ignore:
Timestamp:
Oct 16, 2008 5:42:14 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38053
Message:

Solaris/installer: Fail badly if any of the kernel stuff does not unload properly.

Location:
trunk/src/VBox/Installer/solaris
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/solaris/postinstall.sh

    r13231 r13353  
    3131currentzone=`zonename`
    3232if test "$currentzone" = "global"; then
    33     echo "Configuring VirtualBox Host kernel module(s)..."
     33    echo "Configuring VirtualBox kernel module(s)..."
    3434    /opt/VirtualBox/vboxdrv.sh stopall silentunload
    35     /opt/VirtualBox/vboxdrv.sh start
    3635    rc=$?
    37     if test "$rc" -ne 0; then
    38         echo "## Kernel module configuration failed! Aborting installation..."
    39         exit 2
     36    if test "$rc" -eq 0; then
     37        /opt/VirtualBox/vboxdrv.sh start
     38        rc=$?
     39        if test "$rc" -eq 0; then
     40            if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then
     41                /opt/VirtualBox/vboxdrv.sh fltstart
     42                rc=$?           
     43            fi
     44        fi
    4045    fi
    4146
    42     if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then
    43         /opt/VirtualBox/vboxdrv.sh fltstart
     47    # Fail on any errors while unloading previous modules because it makes it very hard to
     48    # track problems when older vboxdrv is hanging about in memory and add_drv of the new
     49    # one suceeds and it appears as though the new one is being used.
     50    if test "$rc" -ne 0; then
     51        echo "## Configuration failed. Aborting installation."
     52        exit 2
    4453    fi
    4554fi
  • trunk/src/VBox/Installer/solaris/vboxdrv.sh

    r12858 r13353  
    1818#
    1919
     20STOPPING=""
    2021SILENTUNLOAD=""
    2122MODNAME="vboxdrv"
     
    4647    fi
    4748
    48     # Let us go a step further and check if user has mixed up x86/amd64
    49     # amd64 ISA, x86 kernel module??
    50     if test "$cputype" = "amd64"; then
    51         modulepath="$MODDIR32/$MODNAME"
    52         if test -f "$modulepath"; then
    53             abort "Found 32-bit module instead of 64-bit. Please install the amd64 package!"
    54         fi
    55     else
    56         # x86 ISA, amd64 kernel module??
    57         modulepath="$MODDIR64/$MODNAME"
    58         if test -f "$modulepath"; then
    59             abort "Found 64-bit module instead of 32-bit. Please install the x86 package!"
    60         fi
    61     fi
    62 
    63     abort "VirtualBox Host kernel module NOT installed."
     49    # Check arch only if we are not stopping things (because rem_drv works for both arch.)
     50    if test -z "$STOPPING"; then
     51        # Let us go a step further and check if user has mixed up x86/amd64
     52        # amd64 ISA, x86 kernel module??
     53        if test "$cputype" = "amd64"; then
     54            modulepath="$MODDIR32/$MODNAME"
     55            if test -f "$modulepath"; then
     56                abort "Found 32-bit module instead of 64-bit. Please install the amd64 package!"
     57            fi
     58        else
     59            # x86 ISA, amd64 kernel module??
     60            modulepath="$MODDIR64/$MODNAME"
     61            if test -f "$modulepath"; then
     62                abort "Found 64-bit module instead of 32-bit. Please install the x86 package!"
     63            fi
     64        fi
     65
     66        abort "VirtualBox Host kernel module NOT installed."
     67    else
     68        info "## VirtualBox Host kernel module NOT instaled."
     69        return 0
     70    fi
    6471}
    6572
     
    130137{
    131138    if module_loaded; then
    132         /usr/sbin/rem_drv $MODNAME || info "## WARNING!! Failed to unload VirtualBox Host kernel module. Old one still active!"
     139        /usr/sbin/rem_drv $MODNAME || abort "Failed to unload VirtualBox Host kernel module. Old one still active!"
    133140        info "VirtualBox Host kernel module unloaded."
    134141    elif test -z "$SILENTUNLOAD"; then
     
    139146    vbi_mod_id=`/usr/sbin/modinfo | grep vbi | cut -f 1 -d ' ' `
    140147    if test -n "$vbi_mod_id"; then
    141         /usr/sbin/modunload -i $vbi_mod_id > /dev/null 2>&1
     148        /usr/sbin/modunload -i $vbi_mod_id > /dev/null 2>&1 || abort "Failed to unload VirtualBox kernel interfaces module. Old one still active!"
    142149    fi
    143150}
     
    148155        info "VirtualBox NetFilter kernel module already loaded."
    149156    else
    150         /usr/sbin/add_drv -m'* 0600 root sys' $FLTMODNAME
     157        /usr/sbin/add_drv -m'* 0600 root sys' $FLTMODNAME || abort "Failed to load VirtualBox Host Kernel module."
    151158        /usr/sbin/modload -p drv/$FLTMODNAME
    152159        if test ! vboxflt_module_loaded; then
     
    161168{
    162169    if vboxflt_module_loaded; then
    163         /usr/sbin/rem_drv $FLTMODNAME || info "## WARNING!! Failed to unload VirtualBox NetFilter module. Old one still active!"
     170        /usr/sbin/rem_drv $FLTMODNAME || abort "Failed to unload VirtualBox NetFilter module. Old one still active!"
    164171        info "VirtualBox NetFilter kernel module unloaded."
    165172    elif test -z "$SILENTUNLOAD"; then
     
    198205case "$1" in
    199206stopall)
     207    STOPPING="stopping"
    200208    stop_all_modules
    201209    ;;
Note: See TracChangeset for help on using the changeset viewer.

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