summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table/sun.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/partition_table/sun.pm
parent54a662b712a584c66a9f5762d264cce50acbb6ab (diff)
downloaddrakx-0306ad0100b9d40606d723706f909438a27dfac1.tar
drakx-0306ad0100b9d40606d723706f909438a27dfac1.tar.gz
drakx-0306ad0100b9d40606d723706f909438a27dfac1.tar.bz2
drakx-0306ad0100b9d40606d723706f909438a27dfac1.tar.xz
drakx-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/partition_table/sun.pm')
-rw-r--r--perl-install/partition_table/sun.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl-install/partition_table/sun.pm b/perl-install/partition_table/sun.pm
index 7c8a6beb9..54e734ca8 100644
--- a/perl-install/partition_table/sun.pm
+++ b/perl-install/partition_table/sun.pm
@@ -9,6 +9,7 @@ use vars qw(@ISA);
use common;
use partition_table::raw;
use partition_table;
+use fs::type;
use c;
my ($main_format, $main_fields) = list2kv(
@@ -92,8 +93,9 @@ sub read($$) {
my @infos_up = unpack $format1 x $nb_primary, $info{infos};
my @partitions_up = unpack $format2 x $nb_primary, $info{partitions};
foreach (0..$nb_primary-1) {
- my $h = { pt_type => $infos_up[2 * $_], flag => $infos_up[1 + 2 * $_],
+ my $h = { flag => $infos_up[1 + 2 * $_],
start_cylinder => $partitions_up[2 * $_], size => $partitions_up[1 + 2 * $_] };
+ fs::type::set_pt_type($h, $infos_up[2 * $_]);
$h->{start} = $sector + $h->{start_cylinder} * $hd->cylinder_size;
$h->{pt_type} && $h->{size} or $h->{$_} = 0 foreach keys %$h;
push @pt, $h;
@@ -133,7 +135,7 @@ sub write($$$;$) {
# $csize += $_->{size} if $_->{pt_type} != 5;
# $wdsize += $_->{size} if $_->{pt_type} == 5;
$_->{flags} |= 0x10 if $_->{mntpoint} eq '/';
- $_->{flags} |= 0x01 if partition_table::isSwap($_);
+ $_->{flags} |= 0x01 if !isSwap($_);
local $_->{start_cylinder} = $_->{start} / $hd->cylinder_size - $sector;
pack($format1, @$_{@$fields1}), pack($format2, @$_{@$fields2});
} @$pt;