VirtualBox

Changeset 74891 in vbox for trunk


Ignore:
Timestamp:
Oct 17, 2018 5:37:49 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125883
Message:

Additions/linux/installer: fix rebuilding modules for new kernels.
bugref:4567: Linux kernel driver maintenance
Red Hat derived distributions have been known, when upgrading kernel
packages, to call kernel module rebuild scripts before installing the
headers needed for the rebuild. So our rebuild script now waits in the
background for a while if the headers are not there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r74579 r74891  
    224224    begin "Starting."
    225225    # If we got this far assume that the slow set-up has been done.
    226     QUICKSETUP=yes
     226    QUICKSETUP=start
    227227    if test -z "${INSTALL_NO_MODULE_BUILDS}"; then
    228228        uname -r | grep -q -E '^2\.6|^3|^4' 2>/dev/null &&
     
    380380    info "Building the VirtualBox Guest Additions kernel modules.  This may take a while."
    381381
     382    # If the kernel headers are not there, wait at bit in case they get
     383    # installed.  Package managers have been known to trigger module rebuilds
     384    # before actually installing the headers.
     385    for count in 1 2 3 4 5; do
     386        test "x${QUICKSETUP}" = xyes || break
     387        test -d "/lib/modules/${KERN_VER}/build" && break
     388        printf "Kernel modules not yet installed, waiting five minutes (%s of 5)" "${count}"
     389        sleep 300
     390    done
     391
    382392    log "Building the main Guest Additions module."
    383393    if ! myerr=`$BUILDINTMP \
     
    464474    cat << EOF > /etc/kernel/postinst.d/vboxadd
    465475#!/bin/sh
    466 test -d "/lib/modules/\${1}/build" || exit 0
    467 KERN_VER="\${1}" /sbin/rcvboxadd quicksetup
     476# Run in the background so that we can wait in case the package installer has
     477# not yet installed the kernel headers we need.
     478KERN_VER="\${1}" /sbin/rcvboxadd quicksetup &
    468479exit 0
    469480EOF
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