summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/diskdrake/interactive.pm8
-rw-r--r--perl-install/fs/partitioning_wizard.pm4
-rw-r--r--perl-install/fsedit.pm29
3 files changed, 27 insertions, 14 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index fea28e7c3..45b830cc1 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -353,12 +353,12 @@ sub Clear_all {
$hd->{getting_rid_of_readonly_allowed} = 0; #- we don't need this flag anymore
fsedit::partition_table_clear_and_initialize($all_hds->{lvms}, $hd, $in);
}
- fsedit::init_mntpnt_suggestions($all_hds, 1);
+ fsedit::init_mntpnt_suggestions($all_hds, $hd, 1);
}
sub Auto_allocate {
my ($in, $hd, $all_hds) = @_;
- my $suggestions = partitions_suggestions($in, $all_hds) or return;
+ my $suggestions = partitions_suggestions($in, $all_hds, $hd) or return;
my %all_hds_ = %$all_hds;
$all_hds_{hds} = [ sort { $a == $hd ? -1 : 1 } fs::get::hds($all_hds) ];
@@ -1244,8 +1244,8 @@ sub ask_alldatawillbelost {
}
sub partitions_suggestions {
- my ($in, $all_hds) = @_;
- fsedit::init_mntpnt_suggestions($all_hds);
+ my ($in, $all_hds, $hd) = @_;
+ fsedit::init_mntpnt_suggestions($all_hds, $hd);
my $t = $::expert ?
$in->ask_from_list_(N("Partitioning Type"), N("What type of partitioning?"), [ keys %fsedit::suggestions ]) :
'simple';
diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm
index d48b46084..9bd0aacf7 100644
--- a/perl-install/fs/partitioning_wizard.pm
+++ b/perl-install/fs/partitioning_wizard.pm
@@ -119,7 +119,7 @@ sub partitionWizardSolutions {
my $min_linux = MB(600);
my $min_swap = MB(50);
my $min_freewin = MB(100);
- fsedit::init_mntpnt_suggestions($all_hds);
+ fsedit::init_mntpnt_suggestions($all_hds, $o_target);
# each solution is a [ score, text, function ], where the function retunrs true if succeeded
@@ -288,7 +288,7 @@ filesystem checks will be run on your next boot into Microsoft Windows®")) if $
fsedit::partition_table_clear_and_initialize($all_hds->{lvms}, $hd, $in);
# FIXME: reread all_hds:
# re add suggestions if needed (as we might just have erased eg Boot BIOS partition):
- fsedit::init_mntpnt_suggestions($all_hds, 1);
+ fsedit::init_mntpnt_suggestions($all_hds, $hd, 1);
fsedit::auto_allocate($all_hds, $partitions, $hd);
1;
} ];
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 2fcd1f1ee..684d802d7 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -43,23 +43,27 @@ use fs;
my %bck_suggestions = %suggestions;
sub init_mntpnt_suggestions {
- my ($all_hds, $o_force) = @_;
- my $fstab = [ fs::get::fstab($all_hds) ];
- state $done;
- return if $done && !$o_force;
- $done++;
+ my ($all_hds, $o_target, $o_force) = @_;
+
+ my $device = $o_target ? $o_target->{device} : 'all';
+ state $last_device;
+ return if $device eq $last_device && !$o_force;
+ $last_device = $device;
+
+ #- If installing on a removable device, assume that the user wants that device to be self-bootable.
+ my $is_removable = $o_target && $o_target->{is_removable};
+ my @fstab = $is_removable ? partition_table::get_normal_parts($o_target) : fs::get::fstab($all_hds);
my $mntpoint;
# only suggests /boot/EFI if there's not already one:
require fs::any;
if (is_uefi()) {
- if (!any { isESP($_) } @$fstab) {
+ if (!any { isESP($_) } @fstab) {
$mntpoint = { mntpoint => "/boot/EFI", size => MB(100), pt_type => 0xef, ratio => 1, maxsize => MB(300) };
}
}
- return if !$mntpoint;
foreach (keys %suggestions) {
- $suggestions{$_} = [ $mntpoint, @{$bck_suggestions{$_}} ];
+ $suggestions{$_} = [ if_($mntpoint, $mntpoint), @{$bck_suggestions{$_}} ];
}
}
@@ -515,6 +519,11 @@ sub auto_allocate {
my ($all_hds, $o_suggestions, $o_target) = @_;
my $before = listlength(fs::get::fstab($all_hds));
+ #- Make sure we don't finish with more than one /boot/EFI mount point
+ if (is_uefi()) {
+ delete $_->{mntpoint} foreach grep { $_->{mntpoint} eq '/boot/EFI' } fs::get::fstab($all_hds);
+ }
+
auto_allocate_bios_boot_parts($all_hds, $o_target) if !is_uefi();
my $suggestions = $o_suggestions || $suggestions{simple};
@@ -540,6 +549,10 @@ sub auto_allocate {
die N("Nothing to do");
}
}
+
+ #- Don't suggest mount points on other drives when installing on a removable disk
+ return if $o_target && $o_target->{is_removable};
+
my @fstab = fs::get::fstab($all_hds);
fs::mount_point::suggest_mount_points_always(\@fstab);
}