mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-09 16:17:05 +02:00
Based on importing following `pkgs` PRs: * https://github.com/siderolabs/pkgs/pull/1242 * https://github.com/siderolabs/pkgs/pull/1243 * https://github.com/siderolabs/pkgs/pull/1244 Plus removing broken symlinks that exist because static binaries are removed. Remove outdated cleanup steps. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
24 lines
909 B
Bash
Executable File
24 lines
909 B
Bash
Executable File
#!/bin/bash
|
|
PREFIX="${1}"
|
|
|
|
# Remove any archives as we do not need them since everything is dynamically linked.
|
|
find ${PREFIX} -type f -name \*.a -delete
|
|
find ${PREFIX} -type f -name \*.la -delete
|
|
# Remove static binaries.
|
|
find ${PREFIX} -type f \( -name \*.static -o -name \*.o \) -delete
|
|
# Strip debug symbols from all libraries and binaries.
|
|
find ${PREFIX}/{lib,usr/lib} -type f \( -name \*.so* -a ! -name \*dbg \) -exec strip --strip-unneeded {} ';' || true
|
|
find ${PREFIX}/usr/bin -type f -exec strip --strip-all {} ';' || true
|
|
|
|
# Remove header files, man files, and any other non-runtime dependencies.
|
|
rm -rf ${PREFIX}/usr/lib/pkgconfig/ \
|
|
${PREFIX}/{include,usr/include}/* \
|
|
${PREFIX}/share/* \
|
|
${PREFIX}/usr/lib/cmake \
|
|
${PREFIX}/usr/lib/gconv/ \
|
|
${PREFIX}/usr/libexec/getconf \
|
|
${PREFIX}/var/db
|
|
|
|
# Drop broken symlinks.
|
|
find ${PREFIX} -xtype l -print -delete
|