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