summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-04-13 15:29:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-04-13 15:29:20 +0000
commit570d68e3c8d9a798dc4499d1bcfa83b55a78b26f (patch)
tree9a0f26e3903bb82cae22fe219fcd12ebecdf06a3 /perl-install/partition_table
parent0488889bd22528ced2529489ab1bbd8635e25227 (diff)
downloaddrakx-570d68e3c8d9a798dc4499d1bcfa83b55a78b26f.tar
drakx-570d68e3c8d9a798dc4499d1bcfa83b55a78b26f.tar.gz
drakx-570d68e3c8d9a798dc4499d1bcfa83b55a78b26f.tar.bz2
drakx-570d68e3c8d9a798dc4499d1bcfa83b55a78b26f.tar.xz
drakx-570d68e3c8d9a798dc4499d1bcfa83b55a78b26f.zip
create default_type() out of zero_MBR()
Diffstat (limited to 'perl-install/partition_table')
-rw-r--r--perl-install/partition_table/raw.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm
index db1d40584..c290258f5 100644
--- a/perl-install/partition_table/raw.pm
+++ b/perl-install/partition_table/raw.pm
@@ -191,14 +191,18 @@ sub raw_add {
die "raw_add: partition table already full";
}
-sub zero_MBR {
- my ($hd) = @_;
- #- force the standard partition type for the architecture
+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/;
require "partition_table/$type.pm";
- bless $hd, "partition_table::$type";
+ "partition_table::$type";
+}
+
+sub zero_MBR {
+ my ($hd) = @_;
+ #- force the standard partition type for the architecture
+ bless $hd, default_type();
$hd->{primary} = $hd->clear_raw;
delete $hd->{extended};
if (is_xbox()) {