mirror of
				https://github.com/kevinveenbirkenbach/linux-image-manager.git
				synced 2025-11-04 09:28:01 +00:00 
			
		
		
		
	Optimized umount procedures
This commit is contained in:
		@@ -50,6 +50,18 @@ mount_partitions(){
 | 
			
		||||
  error
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
umount_everything(){
 | 
			
		||||
  info "Unmounting everything..." &&
 | 
			
		||||
  (umount -lv "$chroot_dev_pts_mount_path" || warning "Umounting $chroot_dev_pts_mount_path failed!") &&
 | 
			
		||||
  (umount -lv "$chroot_dev_mount_path" || warning "Umounting $chroot_dev_mount_path failed!" ) &&
 | 
			
		||||
  (umount -v "$chroot_proc_mount_path" || warning "Umounting $chroot_proc_mount_path failed!" ) &&
 | 
			
		||||
  (umount -v "$chroot_sys_mount_path" || warning "Umounting $chroot_sys_mount_path failed!") &&
 | 
			
		||||
  (umount -v "$root_mount_path""boot/" || warning "Umounting $root_mount_path""boot/ failed!") &&
 | 
			
		||||
  (umount -v "$root_mount_path" || warning "Umounting $root_mount_path failed!") &&
 | 
			
		||||
  (umount -v "$boot_mount_path" || warning "Umounting $boot_mount_path failed!") ||
 | 
			
		||||
  warning "Failed."
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
mount_chroot_binds(){
 | 
			
		||||
  info "Mount chroot environments..." &&
 | 
			
		||||
  chroot_sys_mount_path="$root_mount_path""sys/" &&
 | 
			
		||||
 
 | 
			
		||||
@@ -5,9 +5,7 @@
 | 
			
		||||
source "$(dirname "$(readlink -f "${0}")")/base.sh" || (echo "Loading base.sh failed." && exit 1)
 | 
			
		||||
 | 
			
		||||
destructor(){
 | 
			
		||||
  info "Unmount everything" &&
 | 
			
		||||
  umount "$root_mount_path"{dev/pts,dev,sys,proc,boot,} $boot_mount_path||
 | 
			
		||||
  warning "Failed."
 | 
			
		||||
  umount_everything
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
info "Starting chroot..."
 | 
			
		||||
 
 | 
			
		||||
@@ -10,13 +10,7 @@ info "Setupscript for images started..."
 | 
			
		||||
info "Define functions..."
 | 
			
		||||
destructor(){
 | 
			
		||||
  info "Cleaning up..."
 | 
			
		||||
  umount -v "$chroot_dev_pts_mount_path" || warning "Umounting $chroot_dev_pts_mount_path failed!"
 | 
			
		||||
  umount -v "$chroot_dev_mount_path" || warning "Umounting $chroot_dev_mount_path failed!"
 | 
			
		||||
  umount -v "$chroot_proc_mount_path" || warning "Umounting $chroot_proc_mount_path failed!"
 | 
			
		||||
  umount -v "$chroot_sys_mount_path" || warning "Umounting $chroot_sys_mount_path failed!"
 | 
			
		||||
  umount -v "$root_mount_path""boot/" || warning "Umounting $root_mount_path""boot/ failed!"
 | 
			
		||||
  umount -v "$root_mount_path" || warning "Umounting $root_mount_path failed!"
 | 
			
		||||
  umount -v "$boot_mount_path" || warning "Umounting $boot_mount_path failed!"
 | 
			
		||||
  umount_everything
 | 
			
		||||
  rmdir -v "$root_mount_path" || warning "Removing $root_mount_path failed!"
 | 
			
		||||
  rmdir -v "$boot_mount_path" || warning "Removing $boot_mount_path failed!"
 | 
			
		||||
  rmdir -v "$working_folder_path" || warning "Removing $working_folder_path failed!"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user