Skip to content

Commit

Permalink
FIX: make umount_partitions safe
Browse files Browse the repository at this point in the history
  • Loading branch information
alealexpro100 committed Nov 16, 2022
1 parent 46addc1 commit 8b499f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ source "./linux_install/lib/msg/${LANG_INSTALLER:-en}.sh"
# These functions are designed for using not only in installer, but in automatic profiles.

function do_end_action() {
umount_partitions
case $1 in
0) msg_print note "Rebooting..."; reboot;;
1) msg_print note "Powering off..."; poweroff;;
Expand Down
4 changes: 2 additions & 2 deletions lib/common/lib_sys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export -f format_and_mount

function umount_partitions() {
local bootloader_type="${1:-BOOTLOADER_TYPE_DEFAULT}" mount_dir=${2:-/mnt/mnt}
[[ $bootloader_type == "uefi" ]] && umount "$mount_dir/boot"
umount "$mount_dir"
[[ $bootloader_type == "uefi" ]] && try_exec 0 umount "$mount_dir/boot"
try_exec 0 umount "$mount_dir"
}
export -f umount_partitions

0 comments on commit 8b499f3

Please sign in to comment.