summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-02-12 11:33:41 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-02-12 15:23:02 +0000
commit4f6b3b5372ed0d5e1d0044a23d658dc8c5c4e9f9 (patch)
tree27ef844d46283b9b94615e3438725be7e2a0c423
parent0d2ddc3d82187148e32d55ad62ebfa60073f08b8 (diff)
downloaddraklive-install-4f6b3b5.tar
draklive-install-4f6b3b5.tar.gz
draklive-install-4f6b3b5.tar.bz2
draklive-install-4f6b3b5.tar.xz
draklive-install-4f6b3b5.zip
Ensure all selected devices are unmounted before partitioning (mga#20268).
-rwxr-xr-xdraklive-install8
1 files changed, 7 insertions, 1 deletions
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) {