From 570d68e3c8d9a798dc4499d1bcfa83b55a78b26f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 13 Apr 2005 15:29:20 +0000 Subject: create default_type() out of zero_MBR() --- perl-install/partition_table/raw.pm | 12 ++++++++---- 1 file 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()) { -- cgit v1.2.1