diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2015-04-19 21:35:31 +0100 |
---|---|---|
committer | Pascal Terjan <pterjan@gmail.com> | 2015-04-19 21:15:19 +0000 |
commit | 1daabebda57976579465e5c281eaa14088e0e37f (patch) | |
tree | e5715742b7154312205add46747b2bcec8c04738 /perl-install/partition_table/gpt.pm | |
parent | 94e8350da5fe301f40ea929c12f1ed000d87a285 (diff) | |
download | drakx-1daabebda57976579465e5c281eaa14088e0e37f.tar drakx-1daabebda57976579465e5c281eaa14088e0e37f.tar.gz drakx-1daabebda57976579465e5c281eaa14088e0e37f.tar.bz2 drakx-1daabebda57976579465e5c281eaa14088e0e37f.tar.xz drakx-1daabebda57976579465e5c281eaa14088e0e37f.zip |
Speed up reading of flags from GPT partition table.
On some machines, calls to ped_disk_new() in libparted take of
the order of seconds, so doing this for each flag and partition
in turn makes partition_table::gpt::read_one take an inordinate
amount of time (mga#15621). Instead, collect the flags during the
call to c::get_disk_partitions.
Diffstat (limited to 'perl-install/partition_table/gpt.pm')
-rw-r--r-- | perl-install/partition_table/gpt.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/perl-install/partition_table/gpt.pm b/perl-install/partition_table/gpt.pm index 1a284c214..0f0f45c6a 100644 --- a/perl-install/partition_table/gpt.pm +++ b/perl-install/partition_table/gpt.pm @@ -111,13 +111,13 @@ sub read_one { # FIXME: just use '@pt = map { ... } c::...' if part_numbers are always linear: foreach (c::get_disk_partitions($hd->{file})) { # fix detecting ESP (special case are they're detected through pt_type): - if (c::get_partition_flag($hd->{file}, $_->{part_number}, 'ESP')) { + if ($_->{flag} eq 'ESP') { $_->{pt_type} = 0xef; - } elsif (c::get_partition_flag($hd->{file}, $_->{part_number}, 'LVM')) { + } elsif ($_->{flag} eq 'LVM') { $_->{pt_type} = 0x8e; - } elsif (c::get_partition_flag($hd->{file}, $_->{part_number}, 'RAID')) { + } elsif ($_->{flag} eq 'RAID') { $_->{pt_type} = 0xfd; - } elsif (c::is_recovery_partition($hd->{file}, $_->{part_number})) { + } elsif ($_->{flag} eq 'RECOVERY') { $_->{pt_type} = 0x12; } $_->{fs_type} = 'swap' if $_->{fs_type} eq 'linux-swap(v1)'; |