summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Draklive/Media.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-07-30 17:56:44 +0000
committerOlivier Blin <oblin@mandriva.com>2009-07-30 17:56:44 +0000
commit4fe3fa0731df002a22320458e5e55c5cc1ec5318 (patch)
treeda32b6f5290e8924ecc28f4860d0922f1ff4f46b /lib/MDV/Draklive/Media.pm
parentb0521d1942ef977c490de319d0121a8770f074a1 (diff)
downloaddrakiso-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar
drakiso-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar.gz
drakiso-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar.bz2
drakiso-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar.xz
drakiso-4fe3fa0731df002a22320458e5e55c5cc1ec5318.zip
move / size and fs type pre-computing in a new supplement_partitions media method
Diffstat (limited to 'lib/MDV/Draklive/Media.pm')
-rw-r--r--lib/MDV/Draklive/Media.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/MDV/Draklive/Media.pm b/lib/MDV/Draklive/Media.pm
index d75eeb4..278d463 100644
--- a/lib/MDV/Draklive/Media.pm
+++ b/lib/MDV/Draklive/Media.pm
@@ -2,6 +2,7 @@ package MDV::Draklive::Media;
use MDK::Common;
use MDV::Draklive::Storage;
+use common;
sub get_initrd_path {
my ($media) = @_;
@@ -51,4 +52,14 @@ sub find_partition_index {
eval { find_index { $_->{mntpoint} eq $mntpoint } @{$media->{partitions}} };
}
+sub supplement_partitions {
+ my ($media, $total_size) = @_;
+
+ $media->{partitions} ||= [ { mntpoint => '/' } ];
+
+ my $slash = find { $_->{mntpoint} eq '/' } @{$media->{partitions}};
+ $slash->{fs_type} ||= $media->get_media_setting('fs');
+ $slash->{size} ||= $total_size / $common::SECTORSIZE;
+}
+
1;