summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table/sun.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-05 07:47:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-05 07:47:36 +0000
commit0a23f36bd52f14f68cc394c37ef7a9af0c406caa (patch)
tree96cf9a72f416f0c2175055e43e1fbe2e3918ef1b /perl-install/partition_table/sun.pm
parent51fd51c2f560620d0e5c73a824d7677661f9c385 (diff)
downloaddrakx-0a23f36bd52f14f68cc394c37ef7a9af0c406caa.tar
drakx-0a23f36bd52f14f68cc394c37ef7a9af0c406caa.tar.gz
drakx-0a23f36bd52f14f68cc394c37ef7a9af0c406caa.tar.bz2
drakx-0a23f36bd52f14f68cc394c37ef7a9af0c406caa.tar.xz
drakx-0a23f36bd52f14f68cc394c37ef7a9af0c406caa.zip
big renaming of field {type} to {pt_type},
this will allow defining {fs_type} which will always be a string whereas {pt_type} will always be a number
Diffstat (limited to 'perl-install/partition_table/sun.pm')
-rw-r--r--perl-install/partition_table/sun.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/perl-install/partition_table/sun.pm b/perl-install/partition_table/sun.pm
index 951a4b471..7c8a6beb9 100644
--- a/perl-install/partition_table/sun.pm
+++ b/perl-install/partition_table/sun.pm
@@ -32,7 +32,7 @@ my ($main_format, $main_fields) = list2kv(
);
$main_format = join '', @$main_format;
-my ($fields1, $fields2) = ([ qw(type flags) ], [ qw(start_cylinder size) ]);
+my ($fields1, $fields2) = ([ qw(pt_type flags) ], [ qw(start_cylinder size) ]);
my ($format1, $format2) = ("xCxC", "N2");
my $magic = 0xDABE;
my $nb_primary = 8;
@@ -92,10 +92,10 @@ 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 = { type => $infos_up[2 * $_], flag => $infos_up[1 + 2 * $_],
+ my $h = { pt_type => $infos_up[2 * $_], flag => $infos_up[1 + 2 * $_],
start_cylinder => $partitions_up[2 * $_], size => $partitions_up[1 + 2 * $_] };
$h->{start} = $sector + $h->{start_cylinder} * $hd->cylinder_size;
- $h->{type} && $h->{size} or $h->{$_} = 0 foreach keys %$h;
+ $h->{pt_type} && $h->{size} or $h->{$_} = 0 foreach keys %$h;
push @pt, $h;
}
@@ -105,7 +105,7 @@ sub read($$) {
# @h{@$fields1} = unpack $format1, $_[0];
# @h{@$fields2} = unpack $format2, $_[1];
# $h{start} = $sector + $h{start_cylinder} * $hd->cylinder_size();
-# $h{type} && $h{size} or $h{$_} = 0 foreach keys %h;
+# $h{pt_type} && $h{size} or $h{$_} = 0 foreach keys %h;
# \%h;
# } [ grep { $_ } split /(.{$size1})/o, $info{infos} ], [ grep { $_ } split /(.{$size2})/o, $info{partitions} ];
@@ -113,7 +113,7 @@ sub read($$) {
}
# write the partition table (and extended ones)
-# for each entry, it uses fields: start, size, type, active
+# for each entry, it uses fields: start, size, pt_type, active
sub write($$$;$) {
my ($hd, $sector, $pt, $info) = @_;
# my ($csize, $wdsize) = (0, 0);
@@ -130,8 +130,8 @@ sub write($$$;$) {
($info->{infos}, $info->{partitions}) = map { join '', @$_ } list2kv map {
$_->{start} % $hd->cylinder_size == 0 or die "partition not at beginning of cylinder";
-# $csize += $_->{size} if $_->{type} != 5;
-# $wdsize += $_->{size} if $_->{type} == 5;
+# $csize += $_->{size} if $_->{pt_type} != 5;
+# $wdsize += $_->{size} if $_->{pt_type} == 5;
$_->{flags} |= 0x10 if $_->{mntpoint} eq '/';
$_->{flags} |= 0x01 if partition_table::isSwap($_);
local $_->{start_cylinder} = $_->{start} / $hd->cylinder_size - $sector;
@@ -188,7 +188,7 @@ sub clear_raw {
#- handle special case for partition 2 which is whole disk.
$pt->{raw}[2] = {
- type => 5, #- the whole disk type.
+ pt_type => 5, #- the whole disk type.
flags => 0,
start_cylinder => 0,
size => $hd->{geom}{cylinders} * $hd->cylinder_size,