From 515ed30f0c4e82e737bf3a5b6933e603762e6f69 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 16 Mar 2015 12:54:59 +0100 Subject: do not suggests /boot/EFI uselessly (mga#15448) we were creating another one when there was already one... --- perl-install/diskdrake/interactive.pm | 6 ++++-- perl-install/fsedit.pm | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 9356a1930..dbf3fb374 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -356,7 +356,7 @@ sub Clear_all { sub Auto_allocate { my ($in, $hd, $all_hds) = @_; - my $suggestions = partitions_suggestions($in) or return; + my $suggestions = partitions_suggestions($in, $all_hds) or return; my %all_hds_ = %$all_hds; $all_hds_{hds} = [ sort { $a == $hd ? -1 : 1 } fs::get::hds($all_hds) ]; @@ -1203,7 +1203,9 @@ sub ask_alldatawillbelost { } sub partitions_suggestions { - my ($in) = @_; + my ($in, $all_hds) = @_; + my $fstab = [ fs::get::fstab($all_hds) ]; + fsedit::init_efi_suggestions($fstab); my $t = $::expert ? $in->ask_from_list_(N("Partitioning Type"), N("What type of partitioning?"), [ keys %fsedit::suggestions ]) : 'simple'; diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index c99d4127d..23d2ac809 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -3,6 +3,7 @@ package fsedit; use diagnostics; use strict; use vars qw(%suggestions); +use feature 'state'; #-###################################################################################### #- misc imports @@ -39,8 +40,17 @@ use fs; { mntpoint => "/tmp", size => MB(150), fs_type => defaultFS(), ratio => 2, maxsize => MB(4000) }, ], ); -foreach (values %suggestions) { - if ( is_uefi() ) { + +sub init_efi_suggestions { + my ($fstab) = @_; + state $done; + return if $done; + $done++; + + # only suggests /boot/EFI if there's not already one: + return if !is_uefi() || grep { isESP($_) } @$fstab; + + foreach (values %suggestions) { @$_ = ({ mntpoint => "/boot/EFI", size => MB(100), pt_type => 0xef, ratio => 1, maxsize => MB(300) }, @$_); } } -- cgit v1.2.1