#!/bin/sh set -e echo "Making the abosolute /lib64/ld-linux-x86-64.so.2 symlinks relative" # This way core mounted at /snap/core*/current/... refers to the ld # inside the core snap, rather than the system one. # Most architectures have their abi links relative, expect for some (amd64 & ppc64el) # amd64 abis="/lib64/ld-linux-x86-64.so.2" # i386 abis="$abis /lib/ld-linux.so.2" # ppc64el abis="$abis /lib64/ld64.so.2" # s390x abis="$abis /lib/ld64.so.1" # armhf abis="$abis /lib/ld-linux-armhf.so.3" # arm64 abis="$abis /lib/ld-linux-aarch64.so.1" # riscv64 abis="$abis /lib/ld-linux-riscv64-ld64d.so.1" for abi in $abis; do if [ -e "$abi" ]; then target=$(readlink "$abi") case $target in /*) ln -f -s .."$(readlink "$abi")" "$abi" ;; esac fi done