From 744bab12796dff50291cfd74f3b0a5f7a19f50f5 Mon Sep 17 00:00:00 2001 From: humocs-man <251756307+humocs-man@users.noreply.github.com> Date: Sat, 11 Apr 2026 13:17:51 +0200 Subject: [PATCH] Implement cleanup function for final cleanup tasks Added a cleanup function to handle final cleanup tasks instead of directly calling dnf5 clean all. --- build/10-build.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/10-build.sh b/build/10-build.sh index 65aefb4..3aae953 100755 --- a/build/10-build.sh +++ b/build/10-build.sh @@ -1,6 +1,18 @@ #!/usr/bin/bash set -eoux pipefail +############################################################################### +# cleanup-function +############################################################################### +cleanup() { + echo "Starting final cleanup..." + dnf5 clean all + rm -rf /var/tmp/* /tmp/* + # Falls du im Build-Verzeichnis Dateien erstellst, die nicht ins Image gehören: + # rm -rf /ctx/build/temp_stuff + echo "Cleanup complete! Image is lean and clean." +} + ############################################################################### # Fedora version (used for RPM Fusion) ############################################################################### @@ -105,6 +117,6 @@ systemctl enable bootc-fetch-apply-updates.timer # Cleanup ############################################################################### -dnf5 clean all +cleanup echo "Custom build complete!"