VirtualBox

Changeset 97014 in vbox


Ignore:
Timestamp:
Oct 5, 2022 7:53:38 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153946
Message:

Installer: Linux: rcvboxdrv.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/Installer/linux/vboxdrv.sh

    r96679 r97014  
    324324}
    325325
     326# Reads kernel configuration option.
     327kernel_get_config_opt()
     328{
     329    opt_name="$1"
     330    [ -n "$opt_name" ] || return
     331
     332    # Check if there is a kernel tool which can extract config option.
     333    if test -x /lib/modules/"$KERN_VER"/build/scripts/config; then
     334        /lib/modules/"$KERN_VER"/build/scripts/config \
     335            --file /lib/modules/"$KERN_VER"/build/.config \
     336            --state "$opt_name" 2>/dev/null
     337    elif test -f /lib/modules/"$KERN_VER"/build/.config; then
     338        # Extract config option manually.
     339        grep "$opt_name" /lib/modules/"$KERN_VER"/build/.config | sed -e "s/^$opt_name=//" -e "s/\"//g"
     340    fi
     341}
     342
    326343# Reads CONFIG_MODULE_SIG_HASH from kernel config.
    327344kernel_module_sig_hash()
    328345{
    329     /lib/modules/"$KERN_VER"/build/scripts/config \
    330         --file /lib/modules/"$KERN_VER"/build/.config \
    331         --state CONFIG_MODULE_SIG_HASH 2>/dev/null
     346    kernel_get_config_opt "CONFIG_MODULE_SIG_HASH"
    332347}
    333348
     
    635650    # Detect if kernel was built with clang.
    636651    unset LLVM
    637     vbox_cc_is_clang=$(/lib/modules/"$KERN_VER"/build/scripts/config \
    638         --file /lib/modules/"$KERN_VER"/build/.config \
    639         --state CONFIG_CC_IS_CLANG 2>/dev/null)
     652    vbox_cc_is_clang=$(kernel_get_config_opt "CONFIG_MODULE_SIG_HASH")
    640653    if test "${vbox_cc_is_clang}" = "y"; then
    641654        log "Using clang compiler."
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