Implement cleanup function for final cleanup tasks
Added a cleanup function to handle final cleanup tasks instead of directly calling dnf5 clean all.
This commit is contained in:
+13
-1
@@ -1,6 +1,18 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
set -eoux pipefail
|
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)
|
# Fedora version (used for RPM Fusion)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -105,6 +117,6 @@ systemctl enable bootc-fetch-apply-updates.timer
|
|||||||
# Cleanup
|
# Cleanup
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
dnf5 clean all
|
cleanup
|
||||||
|
|
||||||
echo "Custom build complete!"
|
echo "Custom build complete!"
|
||||||
|
|||||||
Reference in New Issue
Block a user