summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm43
1 files changed, 43 insertions, 0 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 5cd0ec228..c5dc435bb 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -9,6 +9,20 @@ use partition_table::raw;
use detect_devices;
use log;
+=head1 SYNOPSYS
+
+B<partition_table> enables to read & write partitions on various partition schemes (DOS, GPT, BSD, ...)
+
+It holds base partition table management methods, it manages
+appriopriate partition_table_XXX object according to what has been read
+as XXX partition table type.
+
+=head1 Functions
+
+=over
+
+=cut
+
sub hd2minimal_part {
my ($hd) = @_;
@@ -219,6 +233,14 @@ sub get_normal_parts_and_holes {
grep { !isEmpty($_) || $_->{size} >= $hd->cylinder_size } @l;
}
+
+=item _default_type($hd)
+
+Returns the default type of $hd ('gpt' or 'dos' depending on whether we're running under UEFI or
+whether the disk size is too big for a MBR partition table.
+
+=cut
+
sub _default_type {
my ($hd) = @_;
@@ -226,6 +248,16 @@ sub _default_type {
is_uefi() || $hd->{totalsectors} > 2 * 1024 * 1024 * 2048 ? 'gpt' : "dos";
}
+=item initialize($hd, $o_type)
+
+Initialize a $hd object.
+
+Expect $hd->{file} to point to the raw device disk.
+
+The optional $o_type parameter enables to override the detected disk type (eg: 'dos', 'gpt', ...).
+
+=cut
+
sub initialize {
my ($hd, $o_type) = @_;
@@ -274,6 +306,13 @@ sub read_primary {
0;
}
+
+=item read($hd)
+
+Read the partition table of $hd.
+
+=cut
+
sub read {
my ($hd) = @_;
read_primary($hd) or return 0;
@@ -609,4 +648,8 @@ sub next_start {
$next ? $next->{start} : $hd->last_usable_sector;
}
+=back
+
+=cut
+
1;