flatcar-scripts/build_library/sysext_mangle_flatcar-incus
James Le Cuirot b930444366
build_library: Drop debug symbols and other noise from some sysexts
These were present in containerd, incus, and overlaybd.

Also restore SLSA to the podman sysext as we normally include this.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2025-11-13 10:46:36 +00:00

28 lines
586 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
rootfs="${1}"
pushd "${rootfs}"
rm -rf ./usr/{lib/debug,lib64/pkgconfig,include}/
pushd ./usr/lib/systemd/system
mkdir -p "multi-user.target.d"
{ echo "[Unit]"; echo "Upholds=incus.service"; } > "multi-user.target.d/10-incus.conf"
popd
mkdir -p ./usr/lib/tmpfiles.d
pushd ./usr/lib/tmpfiles.d
cat <<EOF >./10-incus.conf
d /var/lib/lxc/rootfs 0755 root root - -
EOF
popd
# Add 'core' user to 'incus-admin' group to avoid prefixing
# all commands with sudo.
mkdir -p ./usr/lib/userdb/
echo " " > ./usr/lib/userdb/core:incus-admin.membership
popd