From d0a67f6262b57470a6e43bc2436ed5497ce84266 Mon Sep 17 00:00:00 2001 From: Apacelus <46828271+apacelus@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:30:44 +0100 Subject: [PATCH] Clean files before unmounting --- build.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build.py b/build.py index bf6edc0..3595f8a 100644 --- a/build.py +++ b/build.py @@ -437,20 +437,20 @@ def post_config(distro_name: str, verbose_kernel: bool, kernel_type: str, is_usb cpfile("/mnt/depthboot/usr/sbin/fixfiles.bak", "/mnt/depthboot/usr/sbin/fixfiles") rmfile("/mnt/depthboot/usr/sbin/fixfiles.bak") + # Clean all temporary files from image/sd-card to reduce its size + rmdir("/mnt/depthboot/tmp") + # rmdir("/mnt/depthboot/var/tmp") + # rmdir("/mnt/depthboot/var/cache") + # rmdir("/mnt/depthboot/proc") + # rmdir("/mnt/depthboot/run") + # rmdir("/mnt/depthboot/sys") + # rmdir("/mnt/depthboot/lost+found") + # rmdir("/mnt/depthboot/dev") + # Unmount everything with contextlib.suppress(subprocess.CalledProcessError): # will throw errors for unmounted paths bash("umount -lR /mnt/depthboot") # recursive unmount - # Clean all temporary files from image/sd-card to reduce its size - rmdir("/mnt/depthboot/tmp") - rmdir("/mnt/depthboot/var/tmp") - rmdir("/mnt/depthboot/var/cache") - rmdir("/mnt/depthboot/proc") - rmdir("/mnt/depthboot/run") - rmdir("/mnt/depthboot/sys") - rmdir("/mnt/depthboot/lost+found") - rmdir("/mnt/depthboot/dev") - # the main build function def start_build(build_options: dict, args: argparse.Namespace) -> None: