VirtualBox

Ignore:
Timestamp:
Oct 5, 2022 6:23:04 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153943
Message:

Additions: Linux: rcvboxadd.sh: Fix the way module signing tool is discovered in the system, bugref:10287.

File:
1 edited

Legend:

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

    r97010 r97011  
    305305esac
    306306
    307 # Try to find a tool for modules signing.
    308 SIGN_TOOL=$(which kmodsign 2>/dev/null)
    309 # Attempt to use in-kernel signing tool if kmodsign not found.
    310 if test -z "$SIGN_TOOL"; then
    311     if test -x "/lib/modules/$KERN_VER/build/scripts/sign-file"; then
    312         SIGN_TOOL="/lib/modules/$KERN_VER/build/scripts/sign-file"
    313     fi
    314 fi
    315307
    316308if type update-secureboot-policy >/dev/null 2>&1; then
     
    383375        fi
    384376
    385         # Check if signing tool is available.
    386         [ -n "$SIGN_TOOL" ] || fail "Unable to find signing tool"
    387 
    388377        # Get kernel signature hash algorithm from kernel config and validate it.
    389378        sig_hashalgo=$(kernel_module_sig_hash)
     
    393382        # Sign modules.
    394383        for i in $MODULE_LIST; do
     384
     385            # Try to find a tool for modules signing.
     386            SIGN_TOOL=$(which kmodsign 2>/dev/null)
     387            # Attempt to use in-kernel signing tool if kmodsign not found.
     388            if test -z "$SIGN_TOOL"; then
     389                if test -x "/lib/modules/$KERN_VER/build/scripts/sign-file"; then
     390                    SIGN_TOOL="/lib/modules/$KERN_VER/build/scripts/sign-file"
     391                fi
     392            fi
     393
     394            # Check if signing tool is available.
     395            [ -n "$SIGN_TOOL" ] || fail "Unable to find signing tool"
     396
    395397            "$SIGN_TOOL" "$sig_hashalgo" "$DEB_PRIV_KEY" "$DEB_PUB_KEY" \
    396398                /lib/modules/"$KERN_VER"/misc/"$i".ko || fail "Unable to sign $i.ko"
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