VirtualBox

Changeset 97012 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Oct 5, 2022 6:42:33 PM (2 years ago)
Author:
vboxsync
Message:

Additions: Linux: rcvboxadd.sh: Parse kernel config manually if /lib/modules/$(uname -r)/build/scripts/config tool is not available, bugref:10287.

File:
1 edited

Legend:

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

    r97011 r97012  
    310310fi
    311311
     312# Reads kernel configuration option.
     313kernel_get_config_opt()
     314{
     315    opt_name="$1"
     316    [ -n "$opt_name" ] || return
     317
     318    # Check if there is a kernel tool which can extract config option.
     319    if test -x /lib/modules/"$KERN_VER"/build/scripts/config; then
     320        /lib/modules/"$KERN_VER"/build/scripts/config \
     321            --file /lib/modules/"$KERN_VER"/build/.config \
     322            --state "$opt_name" 2>/dev/null
     323    elif test -f /lib/modules/"$KERN_VER"/build/.config; then
     324        # Extract config option manually.
     325        grep "$opt_name" /lib/modules/"$KERN_VER"/build/.config | sed -e "s/^$opt_name=//" -e "s/\"//g"
     326    fi
     327}
     328
    312329# Reads CONFIG_MODULE_SIG_HASH from kernel config.
    313330kernel_module_sig_hash()
    314331{
    315     /lib/modules/"$KERN_VER"/build/scripts/config \
    316         --file /lib/modules/"$KERN_VER"/build/.config \
    317         --state CONFIG_MODULE_SIG_HASH 2>/dev/null
     332    kernel_get_config_opt "CONFIG_MODULE_SIG_HASH"
    318333}
    319334
     
    428443    # Detect if kernel was built with clang.
    429444    unset LLVM
    430     vbox_cc_is_clang=$(/lib/modules/"$KERN_VER"/build/scripts/config \
    431         --file /lib/modules/"$KERN_VER"/build/.config \
    432         --state CONFIG_CC_IS_CLANG 2>/dev/null)
     445    vbox_cc_is_clang=$(kernel_get_config_opt "CONFIG_MODULE_SIG_HASH")
    433446    if test "${vbox_cc_is_clang}" = "y"; then
    434447        info "Using clang compiler."
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