VirtualBox

Changeset 50733 in vbox for trunk/src/VBox/Installer/linux


Ignore:
Timestamp:
Mar 10, 2014 9:49:03 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92720
Message:

Additions/linux/installer: fix library path detection on recent Linux distributions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/run-inst.sh

    r49140 r50733  
    163163        rm -f "$i-"* 2> /dev/null
    164164    done
    165     rm -f "/usr/lib/$PACKAGE" "/usr/lib64/$PACKAGE" "/usr/share/$PACKAGE"
     165    rm -f "/usr/lib/$PACKAGE" "/usr/lib64/$PACKAGE" "/usr/share/$PACKAGE" \
     166        "/usr/lib/i386-linux-gnu/$PACKAGE" "/usr/lib/x86_64-linux-gnu/$PACKAGE"
    166167
    167168    # And any packages left under /opt
     
    181182  i[3456789]86|x86)
    182183    cpu="x86"
    183     lib_path="/usr/lib"
     184    lib_candidates="/usr/lib/i386-linux-gnu /usr/lib /lib"
    184185    ;;
    185186  x86_64|amd64)
    186187    cpu="amd64"
    187     if test -d "/usr/lib64"; then
    188       lib_path="/usr/lib64"
    189     else
    190       lib_path="/usr/lib"
    191     fi
     188    lib_candidates="/usr/lib/x86_64-linux-gnu /usr/lib64 /usr/lib /lib64 /lib"
    192189    ;;
    193190  *)
     
    197194if [ ! -r "$ARCH_PACKAGE" ]; then
    198195  info "Detected unsupported $cpu machine type."
     196  exit 1
     197fi
     198# Find the most appropriate libary folder by seeing which of the candidate paths
     199# are actually in the shared linker path list and choosing the first.  We look
     200# for Debian-specific paths first, then LSB ones, then the new RedHat ones.
     201libs=`ldconfig -v 2>/dev/null | grep -v ^$'\t'`
     202for i in $lib_candidates; do
     203  if echo $libs | grep -q $i; then
     204    lib_path=$i
     205    break
     206  fi
     207done
     208if [ ! -x "$lib_path" ]; then
     209  info "Unable to determine correct library path."
    199210  exit 1
    200211fi
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