summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/format.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-27 10:31:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-27 10:31:34 +0000
commit0306ad0100b9d40606d723706f909438a27dfac1 (patch)
tree232eab774506632a3796a5a36cf09771aa614e64 /perl-install/fs/format.pm
parent54a662b712a584c66a9f5762d264cce50acbb6ab (diff)
downloaddrakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar.gz
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar.bz2
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar.xz
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.zip
- 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
Diffstat (limited to 'perl-install/fs/format.pm')
-rw-r--r--perl-install/fs/format.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm
index a3a33f0c4..d41a98ccc 100644
--- a/perl-install/fs/format.pm
+++ b/perl-install/fs/format.pm
@@ -1,9 +1,12 @@
package fs::format;
+use diagnostics;
+use strict;
+
use run_program;
use common;
+use fs::type;
use log;
-use partition_table qw(:types);
my %cmds = (
ext2 => 'mke2fs -F',
@@ -44,9 +47,9 @@ sub part_raw {
my $dev = $part->{real_device} || $part->{device};
my @options = if_($part->{toFormatCheck}, "-c");
- log::l("formatting device $dev (type ", part2name($part), ")");
+ log::l("formatting device $dev (type $part->{fs_type})");
- my $fs_type = type2fs($part);
+ my $fs_type = $part->{fs_type};
if ($fs_type eq 'ext2' || $fs_type eq 'ext3') {
push @options, "-m", "0" if $part->{mntpoint} =~ m|^/home|;
@@ -58,7 +61,7 @@ sub part_raw {
push @options, '-l', 'bootstrap';
}
- my $cmd = $cmds{$fs_type} or die N("I don't know how to format %s in type %s", $part->{device}, part2name($part));
+ my $cmd = $cmds{$fs_type} or die N("I don't know how to format %s in type %s", $part->{device}, $part->{fs_type});
run_program::raw({ timeout => 60 * 60 }, split(' ', $cmd), @options, devices::make($dev)) or die N("%s formatting of %s failed", $fs_type, $dev);
@@ -66,7 +69,7 @@ sub part_raw {
disable_forced_fsck($dev);
}
- $part->{isFormatted} = 1;
+ set_isFormatted($part, 1);
}
sub disable_forced_fsck {