summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/install/install2.pm9
2 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 4d0dc873a..d796448e4 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- partitioning: exclude ISO installer medium from available disks (mga#26714)
+
Version 18.28 - 29 May 2020
- bootloader: don't die in write_grub2 if grub.cfg doesn't exist (mga#26676)
diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm
index e410de60c..3fea4f0ce 100644
--- a/perl-install/install/install2.pm
+++ b/perl-install/install/install2.pm
@@ -194,6 +194,15 @@ sub selectInstallClass {
sub doPartitionDisks {
my ($auto) = @_;
$o->{steps}{formatPartitions}{done} = 0;
+ if ($o->{method} eq 'cdrom') {
+ #- Exclude the installer medium from the devices we can install onto.
+ #- This is needed when the installer medium is a USB Flash drive, to
+ #- prevent the user inadvertently overwriting the installer and to
+ #- prevent the installer ESP being used as the installed system ESP
+ # (mga#26714).
+ my $installer_device = $o->{stage2_phys_medium}{device};
+ @{$o->{all_hds}{hds}} = grep { $_->{device} ne $installer_device } @{$o->{all_hds}{hds}};
+ }
installStepsCall($o, $auto, 'doPartitionDisksBefore');
installStepsCall($o, $auto, 'doPartitionDisks');
installStepsCall($o, $auto, 'doPartitionDisksAfter');