From 0306ad0100b9d40606d723706f909438a27dfac1 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 27 Jul 2004 10:31:34 +0000 Subject: - add field {fs_type} partially replacing {pt_type} {pt_type} is always a number, {fs_type} is always a string - introduce set_isFormatted() (to ensure {notFormatted} but also {fs_type_from_magic} and {bad_fs_type_magic} are updated) - don't use 0x483 for ext3 anymore (same for reiserfs...), the type_name gives both a pt_type and a fs_type - many accessors from partition_table removed (type2fs(), fs2pt_type()) - remove isThisFs() (not useful anymore since we can use directly {fs_type}) - remove isFat() (inline the function) - other isXXX() from partition_table are moved to fs::type - part2name() is now fs::type::part2type_name - name2pt_type() is now fs::type::type_name2subpart() - partition_table::important_types() is now fs::type::type_names() - fsedit::typeOfPart() is now fs::type::fs_type_from_magic() - no need to truncate type_name since they are shorter --- perl-install/install_steps.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'perl-install/install_steps.pm') diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 645f3fe0d..6cef62347 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -9,8 +9,9 @@ use vars qw(@filesToSaveForUpgrade @filesNewerToUseAfterUpgrade); #-###################################################################################### use common; use install_any qw(:all); -use partition_table qw(:types); +use partition_table; use detect_devices; +use fs::type; use modules; use run_program; use lang; @@ -215,7 +216,7 @@ sub doPartitionDisksAfter { cat_("/proc/mounts") =~ m|(\S+)\s+/tmp/nfsimage| && !any { $_->{mntpoint} eq "/mnt/nfs" } @{$o->{all_hds}{nfss}} and - push @{$o->{all_hds}{nfss}}, { pt_type => 'nfs', mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,nosuid,soft,rsize=8192,wsize=8192" }; + push @{$o->{all_hds}{nfss}}, { fs_type => 'nfs', mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,nosuid,soft,rsize=8192,wsize=8192" }; } #------------------------------------------------------------------------------ @@ -243,7 +244,7 @@ sub ask_mntpoint_s {#-}}} $m{$m} = 1; #- in case the type does not correspond, force it to ext3 - $_->{pt_type} = 0x483 if $m =~ m|^/| && !isTrueFS($_) && !isOtherAvailableFS($_); + fs::type::set_fs_type($_, 'ext3') if $m =~ m|^/| && !isTrueFS($_) && !isOtherAvailableFS($_); } 1; } @@ -266,10 +267,8 @@ sub choosePartitionsToFormat($$) { $_->{$::recovery ? 'toFormat' : 'toFormatUnsure'} ||= member($_->{mntpoint}, '/', '/usr'); if (!$_->{toFormat}) { - my $t = fsedit::typeOfPart($_->{device}); - $_->{toFormatUnsure} ||= - #- if detected dos/win, it's not precise enough to just compare the types (too many of them) - (!$t || isOtherAvailableFS({ pt_type => $t }) ? !isOtherAvailableFS($_) : $t != $_->{pt_type}); + my $fs_type = fs::type::fs_type_from_magic($_); + $_->{toFormatUnsure} ||= !$fs_type || $fs_type ne $_->{fs_type}; } } } -- cgit v1.2.1