diff options
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r-- | perl-install/partition_table.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index da53822d1..f294dc809 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -298,6 +298,13 @@ Identify the partition table type of $hd and return a blessed $pt of type partit sub read_primary { my ($hd) = @_; + #- The libparted ped_disk_probe() function opens the raw device for R/W, which causes a + #- change event to be sent for every partition when the raw device is closed again. So + #- be careful not to call this function more than once. (mga#15752) + my $current = c::get_disk_type($hd->{file}); + $current = 'dos' if $current eq 'msdos'; + $hd->{current_pt_table_type} = $current; + #- it can be safely considered that the first sector is used to probe the partition table #- but other sectors (typically for extended partition ones) have to match this type! my @parttype = ( @@ -319,6 +326,7 @@ sub read_primary { bless $hd, "partition_table::$_"; if ($hd->read_primary) { log::l("found a $_ partition table on $hd->{file} at sector 0"); + #- Don't rely on the type returned by libparted - use what we have discovered. $hd->{pt_table_type} = $_ if $_ ne 'empty'; return 1; } |