summaryrefslogtreecommitdiffstats
path: root/perl-install/install/install2.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-05 16:43:15 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-05 17:25:35 +0100
commit6bdcf124464f79c04b06e984a7319f73423c0371 (patch)
tree95c9cd70cde2a6864ae554af1f455104b3eb90c6 /perl-install/install/install2.pm
parentca958f1578a1ee6669092b5e876a44d6921bff68 (diff)
downloaddrakx-6bdcf124464f79c04b06e984a7319f73423c0371.tar
drakx-6bdcf124464f79c04b06e984a7319f73423c0371.tar.gz
drakx-6bdcf124464f79c04b06e984a7319f73423c0371.tar.bz2
drakx-6bdcf124464f79c04b06e984a7319f73423c0371.tar.xz
drakx-6bdcf124464f79c04b06e984a7319f73423c0371.zip
installer: exclude ISO installer medium from available disks (mga#26714)
Diffstat (limited to 'perl-install/install/install2.pm')
-rw-r--r--perl-install/install/install2.pm9
1 files changed, 9 insertions, 0 deletions
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');