diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-18 12:30:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-18 12:30:17 +0000 |
commit | 473b5b8333cb42627bc83af4782f72be81d971cf (patch) | |
tree | a6bd472600b5fc1543f36aae43ceaba529c16efa /perl-install/partition_table.pm | |
parent | f110caf7fb05213848c2d48fc4802b7d6babbed3 (diff) | |
download | drakx-473b5b8333cb42627bc83af4782f72be81d971cf.tar drakx-473b5b8333cb42627bc83af4782f72be81d971cf.tar.gz drakx-473b5b8333cb42627bc83af4782f72be81d971cf.tar.bz2 drakx-473b5b8333cb42627bc83af4782f72be81d971cf.tar.xz drakx-473b5b8333cb42627bc83af4782f72be81d971cf.zip |
rename partition_table::raw::clear() into partition_table::initialize()
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r-- | perl-install/partition_table.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 9a66afc50..e249e2a83 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -223,6 +223,29 @@ sub get_normal_parts_and_holes { grep { !isEmpty($_) || $_->{size} >= $hd->cylinder_size } @l; } +sub _default_type { + my $type = arch() =~ /ia64/ ? 'gpt' : arch() eq "alpha" ? "bsd" : arch() =~ /^sparc/ ? "sun" : arch() eq "ppc" ? "mac" : "dos"; + #- override standard mac type on PPC for IBM machines to dos + $type = "dos" if arch() =~ /ppc/ && detect_devices::get_mac_model() =~ /^IBM/; + $type; +} + +sub initialize { + my ($hd, $o_type) = @_; + + my $type = $o_type || _default_type(); + + require "partition_table/$type.pm"; + "partition_table::$type"->initialize($hd); + + delete $hd->{extended}; + if (detect_devices::is_xbox()) { + my $part = { start => 1, size => 15632048, pt_type => 0x0bf, isFormatted => 1 }; + partition_table::dos::compute_CHS($hd, $part); + $hd->{primary}{raw}[0] = $part; + } +} + sub read_primary { my ($hd) = @_; |