From 1f8f60631b6dd0f12dd24b993b9961814f734fc6 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 4 Jul 2016 16:43:01 +0200 Subject: factorize bad block checks also enable bad blocks checking on JFS (was in one place but not in other and indeed mkfs.jfs does support it) --- perl-install/NEWS | 1 + perl-install/diskdrake/interactive.pm | 2 +- perl-install/fs/partitioning.pm | 2 +- perl-install/fs/type.pm | 3 ++- perl-install/install/NEWS | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index be9649934..fae023f06 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,5 +1,6 @@ - diskdrake: o do not offer to check for bad blocks on btrfs (mga#12393) + o enable bad blocks checking on JFS - drakboot: o allow installing grub2 on XFS / o make clear grub2 is installed on ESP under UEFI diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index edf2c4215..1aecd48af 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -1303,7 +1303,7 @@ sub format_ { sub _format_raw { my ($in, $part, $all_hds, $o_skip) = @_; - if ($::expert && !member($part->{fs_type}, qw(btrfs hfs ntfs ntfs-3g reiserfs xfs))) { + if ($::expert && isBlockCheckable($part)) { $part->{toFormatCheck} = $in->ask_yesorno(N("Confirmation"), N("Check for bad blocks?")); } $part->{isFormatted} = 0; #- force format; diff --git a/perl-install/fs/partitioning.pm b/perl-install/fs/partitioning.pm index 27b5220c9..b93d146b2 100644 --- a/perl-install/fs/partitioning.pm +++ b/perl-install/fs/partitioning.pm @@ -52,7 +52,7 @@ sub choose_partitions_to_format { ({ text => partition_table::description($e), type => 'bool', val => \$e->{toFormatTmp} - }, if_(!isLoopback($_) && !member($_->{fs_type}, qw(btrfs jfs reiserfs xfs)), { + }, if_(!isLoopback($_) && isBlockCheckable($_), { text => partition_table::description($e), type => 'bool', advanced => 1, disabled => sub { !$e->{toFormatTmp} }, val => \$e->{toFormatCheck} diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm index 46e0e97d8..f3b35a6a6 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( - 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 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 ); @@ -296,6 +296,7 @@ sub isEmpty { !$_[0]{fs_type} && $_[0]{pt_type} == 0 } sub isBIOS_GRUB { $_[0]{pt_type} eq 'BIOS_GRUB' } sub isESP { $_[0]{pt_type} == 0xef && member($_[0]{fs_type}, qw(fat32 vfat)) } sub isExtended { $_[0]{pt_type} == 5 || $_[0]{pt_type} == 0xf || $_[0]{pt_type} == 0x85 } +sub isBlockCheckable { member($_[0]{fs_type}, qw(btrfs hfs ntfs ntfs-3g reiserfs xfs)) } sub isRawLVM { $_[0]{pt_type} == 0x8e || $_[0]{type_name} eq 'Linux Logical Volume Manager' } sub isRawRAID { $_[0]{pt_type} == 0xfd || $_[0]{type_name} eq 'Linux RAID' } sub isRawLUKS { $_[0]{type_name} eq 'Encrypted' } diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index df937fbd6..fa9088ed2 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -4,6 +4,7 @@ o make sure we only offer lilo/grub choice on upgrades only - partionning: o do not offer to check for bad blocks on btrfs (mga#12393) + o enable bad blocks checking on JFS - summary: o add help link for sound (mga#11824) -- cgit v1.2.1