mirror of
https://git.proxmox.com/git/pve-installer
synced 2025-08-25 03:43:03 +00:00

Rust links in some dynamic libraries even if only used by a disabled feature gate. This will be needed due to moving http-related code into the proxmox-installer-common crate and thus pulling it in at more places. Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
21 lines
361 B
Bash
Executable File
21 lines
361 B
Bash
Executable File
#!/bin/bash
|
|
|
|
binary=$1
|
|
|
|
exec 3< <(ldd -u "$binary" | grep -oP '[^/:]+$')
|
|
|
|
patchargs=""
|
|
dropped=""
|
|
while read -r dep; do
|
|
dropped="$dep $dropped"
|
|
patchargs="--remove-needed $dep $patchargs"
|
|
done <&3
|
|
exec 3<&-
|
|
|
|
if [[ $dropped == "" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
echo -e "patchelf '$binary' - removing unused dependencies:\n $dropped"
|
|
patchelf $patchargs $binary
|