diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/partition_table.pm | 2 | ||||
-rw-r--r-- | perl-install/partition_table/gpt.pm | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index da8a15b6e..13715852f 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -273,6 +273,7 @@ sub initialize { my $current = c::get_disk_type($hd->{file}); $current = 'dos' if $current eq 'msdos'; + $hd->{current_pt_table_type} = $current; my $type = $o_type || $current || default_type($hd); $hd->{pt_table_type} = $type; @@ -564,6 +565,7 @@ sub write { $hd->write($handle, $_->{start}, $_->{raw}) or die "writing of partition table failed"; } $hd->end_write($handle); + $hd->{current_pt_table_type} = $hd->{pt_table_type}; $hd->{isDirty} = 0; if (my $tell_kernel = delete $hd->{will_tell_kernel}) { diff --git a/perl-install/partition_table/gpt.pm b/perl-install/partition_table/gpt.pm index e1c07a761..af5509f27 100644 --- a/perl-install/partition_table/gpt.pm +++ b/perl-install/partition_table/gpt.pm @@ -87,7 +87,7 @@ sub write { my $partitions_killed; # Initialize the disk if current partition table is not gpt - if (c::get_disk_type($hd->{file}) ne "gpt") { + if ($hd->{current_pt_table_type} ne "gpt") { $ped_disk = c::disk_open($hd->{file}, "gpt") or die "failed to create new partition table on $hd->{file}"; $partitions_killed = 1; } else { |