From 3ce334a9d7c4c400fb684b2b916ad2034ef3eb17 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 17 Jun 2020 13:02:00 +0100 Subject: Don't use swap on other devices when installing on a removable device (and vice versa). --- perl-install/fs/partitioning.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/perl-install/fs/partitioning.pm b/perl-install/fs/partitioning.pm index b93d146b2..18fa7e114 100644 --- a/perl-install/fs/partitioning.pm +++ b/perl-install/fs/partitioning.pm @@ -5,12 +5,14 @@ use strict; use common; use fs::format; +use fs::get; use fs::type; sub guess_partitions_to_format { my ($fstab) = @_; + my $root_part = fs::get::root($fstab); foreach (@$fstab) { - $_->{mntpoint} = "swap" if isSwap($_); + $_->{mntpoint} = "swap" if isSwap($_) && ($_->{rootDevice} eq $root_part->{rootDevice} || !$_->{is_removable} && !$root_part->{is_removable}); $_->{mntpoint} or next; add2hash_($_, { toFormat => $_->{notFormatted} }) if $_->{fs_type}; #- eg: do not set toFormat for isRawRAID (0xfd) -- cgit v1.2.1