VirtualBox

Ignore:
Timestamp:
Jun 11, 2010 7:52:26 AM (15 years ago)
Author:
vboxsync
Message:

Linux installer: be more verbose if the correct kernel headers are missing

File:
1 edited

Legend:

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

    r29016 r30158  
    167167owner=vboxadd
    168168group=1
     169
     170test_sane_kernel_dir()
     171{
     172    KERN_VER=`uname -r`
     173    KERN_DIR="/lib/modules/$KERN_VER/build"
     174    if [ -d "$KERN_DIR" ]; then
     175        KERN_REL=`make -sC $KERN_DIR --no-print-directory kernelrelease || true`
     176        if [ "x$KERN_REL" == "x$KERN_VER" ]; then
     177            return 0
     178        fi
     179    fi
     180    printf "\nThe headers for the current running kernel are not found. If the following\nmodule compilation fails then this could be the reason.\n"
     181    if [ "$system" = "redhat" ]; then
     182        printf "The missing package can be probably installed with\nyum install kernel-devel-$KERN_VER\n"
     183    elif [ "$system" = "suse" ]; then
     184        printf "The missing package can be probably installed with\nzypper install kernel-$KERN_VER\n"
     185    elif [ "$system" = "debian" ]; then
     186        printf "The missing package can be probably installed with\napt-get install linux-headers-$KERN_VER\n"
     187    fi
     188}
    169189
    170190fail()
     
    325345    fi
    326346    begin "Building the VirtualBox Guest Additions kernel modules"
     347    test_sane_kernel_dir
    327348    if ! sh /usr/share/$PACKAGE/test/build_in_tmp \
    328349        --no-dkms --no-print-directory > $LOG 2>&1; then
Note: See TracChangeset for help on using the changeset viewer.

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