From 4f6b3b5372ed0d5e1d0044a23d658dc8c5c4e9f9 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 12 Feb 2017 11:33:41 +0000 Subject: Ensure all selected devices are unmounted before partitioning (mga#20268). --- draklive-install | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/draklive-install b/draklive-install index 48f46fc..eced2d6 100755 --- a/draklive-install +++ b/draklive-install @@ -84,7 +84,7 @@ sub umount_all { foreach (grep { isSwap($_) } @$fstab) { eval { fs::mount::swapoff($_->{device}) }; } - foreach (map { $_->{mntpoint} && !isSwap($_) ? "/dev/$_->{device}" : () } @$fstab) { + foreach (map { $_->{isMounted} && !isSwap($_) ? "/dev/$_->{device}" : () } @$fstab) { system('umount', $_); } } @@ -147,6 +147,12 @@ sub init_hds { !member($live_device, map { $_->{device} } partition_table::get_normal_parts_and_holes($_)); } @{$all_hds->{hds}} if $live_device; + #- some of the selected devices may have been manually mounted or auto-mounted, and we need to + #- ensure they will be unmounted before we start partitioning (mga#20268) + foreach my $p (@$fstab) { + $p->{isMounted} = 1 if grep { $_->{device} eq $p->{device} } @mounted; + } + my $err = $@; umount_all($fstab); if ($err) { -- cgit v1.2.1