Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Clean files before unmounting
Browse files Browse the repository at this point in the history
  • Loading branch information
Apacelus committed Dec 6, 2023
1 parent 2436229 commit d0a67f6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d0a67f6

Please sign in to comment.