chore: clean up /usr/bin

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>
This commit is contained in:
Andrey Smirnov 2025-05-22 14:43:56 +04:00
parent b551f32ce5
commit fc1237343f
No known key found for this signature in database
GPG Key ID: FE042E3D4085A811
4 changed files with 5 additions and 20 deletions

View File

@ -27,7 +27,7 @@ EMBED_TARGET ?= embed
TOOLS_PREFIX ?= ghcr.io/siderolabs/tools
TOOLS ?= v1.11.0-alpha.0-1-ge35234b
PKGS_PREFIX ?= ghcr.io/siderolabs
PKGS ?= v1.11.0-alpha.0-20-g0f74b9b
PKGS ?= v1.11.0-alpha.0-23-g1b1430e
KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest
CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest

View File

@ -1,20 +1,6 @@
#!/bin/bash
PREFIX="${1}"
function remove_symlinks() {
set +e
for l in $(find ${PREFIX} -type l); do
readlink $l | grep -q /toolchain
if [ $? == 0 ]; then
unlink $l
fi
done
set -e
}
# Remove any symlinks that might have been need at build time.
remove_symlinks
# 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
@ -33,6 +19,5 @@ rm -rf ${PREFIX}/usr/lib/pkgconfig/ \
${PREFIX}/usr/libexec/getconf \
${PREFIX}/var/db
# Remove contents of /usr/bin except for udevadm
# TODO: do not install these files in the first place.
# find ${PREFIX}/usr/bin \( -type f -o -type l \) ! -name udevadm -delete
# Drop broken symlinks.
find ${PREFIX} -xtype l -print -delete

View File

@ -1 +1 @@
v1.11.0-alpha.0-20-g0f74b9b
v1.11.0-alpha.0-23-g1b1430e

View File

@ -104,7 +104,7 @@ realtime =none extsz=4096 blocks=0, rtextents=0
var stdout bytes.Buffer
cmd := exec.Command("xfs_info", tempFile)
cmd := exec.Command("xfs_db", "-p", "xfs_info", "-c", "info", tempFile)
cmd.Stdout = &stdout
require.NoError(t, cmd.Run())