summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-11-14 17:39:47 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-11-15 08:34:45 +0100
commit4a217824737f82d15cf8120356111739d00269db (patch)
tree9bb10758c13be44da23144f1a671cc6ad2fe50e6 /perl-install
parent84405a3bde840a526b4bea650fbe69963a900ef5 (diff)
downloaddrakx-4a217824737f82d15cf8120356111739d00269db.tar
drakx-4a217824737f82d15cf8120356111739d00269db.tar.gz
drakx-4a217824737f82d15cf8120356111739d00269db.tar.bz2
drakx-4a217824737f82d15cf8120356111739d00269db.tar.xz
drakx-4a217824737f82d15cf8120356111739d00269db.zip
(isFormatable) introduce it
we could have exported cannotBeMountable() but it's cleaner to export another isFoobar() function
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/fs/type.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm
index 679525774..ad84738f7 100644
--- a/perl-install/fs/type.pm
+++ b/perl-install/fs/type.pm
@@ -9,7 +9,7 @@ use devices;
our @ISA = qw(Exporter);
our @EXPORT = qw(
- isBlockCheckable isEmpty isExtended isTrueLocalFS isTrueFS isDos isSwap isOtherAvailableFS isRawLVM isRawRAID isRawLUKS isRAID isLVM isLUKS isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial isApple isAppleBootstrap isBIOS_GRUB isESP isFat_or_NTFS isnormal_Fat_or_NTFS isRecovery
+ isBlockCheckable isEmpty isExtended isFormatable isTrueLocalFS isTrueFS isDos isSwap isOtherAvailableFS isRawLVM isRawRAID isRawLUKS isRAID isLVM isLUKS isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial isApple isAppleBootstrap isBIOS_GRUB isESP isFat_or_NTFS isnormal_Fat_or_NTFS isRecovery
maybeFormatted set_isFormatted defaultFS
);
@@ -328,6 +328,12 @@ sub cannotBeMountable {
my ($part) = @_;
isRawRAID($part) || isRawLUKS($part) || isRawLVM($part) || isBIOS_GRUB($part);
}
+# is not a special sg that cannot be mounted/formatted (parts of RAID/LVM, BIOS_GRUB):
+sub isFormatable {
+ my ($part) = @_;
+ !cannotBeMountable($part);
+}
+
sub isNonMountable {
my ($part) = @_;
cannotBeMountable($part) || $part->{fs_type} eq 'ntfs' && !$part->{isFormatted} && $part->{notFormatted};