From 6bdcf124464f79c04b06e984a7319f73423c0371 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 5 Jun 2020 16:43:15 +0100 Subject: installer: exclude ISO installer medium from available disks (mga#26714) --- perl-install/install/NEWS | 2 ++ perl-install/install/install2.pm | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'perl-install') 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'); -- cgit v1.2.1