VirtualBox

Ignore:
Timestamp:
Oct 14, 2015 1:46:43 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103408
Message:

Installer/linux (host): move kernel module building and clean-up to shared installer script.

Location:
trunk/src/VBox/Installer/linux/debian
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/debian/postinst

    r58186 r58241  
    1717#  abort-remove:      (our version): removing this package failed
    1818#  abort-deconfigure: (our version): error during resolving conflicts
     19
     20## @todo Do we really gain anything from not just executing everything
     21##       unconditionally?
    1922
    2023LOG="/var/log/vbox-install.log"
     
    7881if test "${INSTALL_NO_VBOXDRV}" = 1; then
    7982  POSTINST_START=--nostart
    80   # if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
    81   if [ "$1" = "configure" ]; then
    82     rm -f /lib/modules/*/misc/vboxdrv.ko
    83     rm -f /lib/modules/*/misc/vboxnetflt.ko
    84     rm -f /lib/modules/*/misc/vboxnetadp.ko
    85     rm -f /lib/modules/*/misc/vboxpci.ko
    86   fi
    8783else
    8884  POSTINST_START=
    89   # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
    90   if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
    91     if [ "$1" = "configure" ]; then
    92       db_get virtualbox/module-compilation-allowed
    93       if [ "$RET" = "false" ]; then
    94         cat << EOF
    95 Unable to find a precompiled module for the current kernel
    96 though module compilation denied by debconf setting.
    97 EOF
    98         POSTINST_START=--nostart
    99       else
    100         db_input low virtualbox/module-compilation-allowed || true
    101         db_go || true
    102         db_get virtualbox/module-compilation-allowed
    103         if [ "$RET" = "false" ]; then
    104           POSTINST_START=--nostart
    105         fi
    106       fi
    107     fi # $1 = "configure"
    108   fi
    10985fi
    11086
  • trunk/src/VBox/Installer/linux/debian/preinst.in

    r58194 r58241  
    6161  fi
    6262
    63   # check for old vboxdrv modules
    64   if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
    65     if find /lib/modules -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
    66       # old modules found
    67       db_get virtualbox/delete-old-modules || true
    68       if [ "$RET" = "false" ]; then
    69         cat << EOF
    70 Old vboxdrv kernel modules found in
    71 EOF
    72         find /lib/modules -name "vboxdrv\.*" 2>/dev/null|sed "s+\(.*\)+  \1+g"
    73         cat << EOF
    74 Removing of these modules denied by debconf setting
    75 EOF
    76       else
    77         db_input low virtualbox/delete-old-modules || true
    78         db_go || true
    79         db_get virtualbox/delete-old-modules || true
    80         if [ "$RET" = "true" ]; then
    81           for i in /lib/modules/*; do
    82             if test -e "${i}/misc/vboxdrv.ko"; then
    83               rm -f "${i}/misc/vboxdrv.ko" "${i}/misc/vboxnetadp.ko" \
    84                     "${i}/misc/vboxnetflt.ko" "${i}/misc/vboxpci.ko"
    85               # Remove the kernel version folder if it was empty except for us.
    86               test "`echo ${i}/misc/* ${i}/misc/.?* ${i}/* ${i}/.?*`" = \
    87                    "${i}/misc/* ${i}/misc/.. ${i}/misc ${i}/.." &&
    88                   rmdir "${i}/misc" "${i}"  # We used to leave empty folders.
    89             fi
    90           done
    91         fi
    92       fi
    93     fi
    94   fi
    95 
    9663fi # "$1" = "install" -o "$1" = "upgrade"
    9764
  • trunk/src/VBox/Installer/linux/debian/templates

    r58090 r58241  
    3232 mit Root-Rechten aus.
    3333
    34 Template: virtualbox/module-compilation-allowed
    35 Type: boolean
    36 Default: true
    37 Description: Should the vboxdrv kernel module be compiled now?
    38  Unable to find a precompiled module for the current kernel!
    39  .
    40  Without a suitable kernel module you will not be able to start any VMs. It is
    41  strongly recommended that you compile a kernel module now. This requires
    42  kernel headers and the tools to build kernel modules (gcc, make, binutils, ...).
    43  However if you know that a suitable kernel module already exists at another
    44  location, you might want to override the default by setting
    45  KDIR=<full_path_to_vboxdrv_module> in /etc/default/virtualbox. You can also
    46  build the module later by executing
    47    
    48    /sbin/vboxconfig
    49    
    50  as root.
    51 Description-de.UTF-8: Soll das Kernmodul jetzt compiliert werden?
    52  Es konnte kein Kernmodul für den aktuellen Linux-Kern gefunden werden!
    53  .
    54  Ohne ein passendes Kernmodul können Sie keine VM starten. Daher sollten Sie
    55  jetzt ein Kernmodul compilieren. Dazu werden die Kern-Header und die Programme
    56  zum Bauen eines Kernmoduls (gcc, make, binutils, ...) benötigt. Falls Sie
    57  bereits ein passendes Kernmodul in ein anderes Verzeichnis installiert haben,
    58  können Sie den Verzeichnisnamen durch Hinzufügen von KDIR=<voller_Pfad_zu_vboxdrv>
    59  in der Datei /etc/default/virtualbox angeben. Sie können das Kernmodul auch
    60  später compilieren, indem Sie
    61    
    62    /sbin/vboxconfig
    63    
    64  mit Root-Rechten ausführen.
    65 
    66 Template: virtualbox/delete-old-modules
    67 Type: boolean
    68 Default: true
    69 Description: Delete old vboxdrv kernel modules?
    70  Old vboxdrv kernel modules found. You should remove these modules as they
    71  might interfere with this version of VirtualBox. You can force re-compilation
    72  of the module later by executing
    73    
    74    /sbin/vboxconfig
    75    
    76  as root.
    77 Description-de.UTF-8: Alte Kernmodule löschen?
    78  Es wurden alte vboxdrv-Kernmodule gefunden. Diese sollten gelöscht werden, da sie
    79  eventuell nicht mit dieser Version von VirtualBox zusammen arbeiten. Das Compilieren
    80  des Kernmoduls können Sie später durch
    81    
    82    /sbin/vboxconfig
    83    
    84  erzwingen.
    85 
    8634Template: virtualbox/old-installation-found
    8735Type: note
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