diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2017-01-22 10:10:23 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2017-01-22 10:12:54 +0100 |
commit | e7fb2049d3c8d1528c9f12aaade1e9143e19f120 (patch) | |
tree | 04faeafa2fedab76ae2e8685ca0d6aaf0873b559 /perl-install | |
parent | 91591aee8974dbbbb2a2e7a4de428b42a886c15f (diff) | |
download | drakx-e7fb2049d3c8d1528c9f12aaade1e9143e19f120.tar drakx-e7fb2049d3c8d1528c9f12aaade1e9143e19f120.tar.gz drakx-e7fb2049d3c8d1528c9f12aaade1e9143e19f120.tar.bz2 drakx-e7fb2049d3c8d1528c9f12aaade1e9143e19f120.tar.xz drakx-e7fb2049d3c8d1528c9f12aaade1e9143e19f120.zip |
add basic POD
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/partition_table.pm | 43 |
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; |