aboutsummaryrefslogtreecommitdiffstats
path: root/LICENSE
diff options
context:
space:
mode:
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions
bz/aarch64 Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/partitioning.pm
blob: ab2b6733ab138bb07351076de3da89e7ff1e61a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package fs::partitioning; # $Id$

use diagnostics;
use strict;

use common;
use fs::format;
use fs::type;

sub guess_partitions_to_format {
    my ($fstab) = @_;
    foreach (@$fstab) {
	$_->{mntpoint} = "swap" if isSwap($_);
	$_->{mntpoint} or next;

	add2hash_($_, { toFormat => $_->{notFormatted} }) if $_->{fs_type}; #- eg: do not set toFormat for isRawRAID (0xfd)
        $_->{toFormatUnsure} ||= member($_->{mntpoint}, '/', '/usr');

	if (!$_->{toFormat}) {
	    my $fs_type = fs::type::fs_type_from_magic($_);
	    if (!$fs_type || $fs_type ne $_->{fs_type}) {
		log::l("setting toFormatUnsure for $_->{device} because <$_->{fs_type}> ne <$fs_type>");
		$_->{toFormatUnsure} = 1;
	    }
	}
    }
}

sub choose_partitions_to_format {
    my ($in, $fstab) = @_;

    guess_partitions_to_format($fstab);

    my @l = grep { !$_->{isMounted} && $_->{mntpoint} && !isSwap($_) &&
		   (!isFat_or_NTFS($_) || $_->{notFormatted}) &&
		   (!isOtherAvailableFS($_) || $_->{toFormat});
	       } @$fstab;