summaryrefslogtreecommitdiffstats
path: root/perl-install
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
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')
-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');