diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-07-30 17:56:44 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-07-30 17:56:44 +0000 |
commit | 4fe3fa0731df002a22320458e5e55c5cc1ec5318 (patch) | |
tree | da32b6f5290e8924ecc28f4860d0922f1ff4f46b /lib/MDV/Draklive/Media.pm | |
parent | b0521d1942ef977c490de319d0121a8770f074a1 (diff) | |
download | draklive-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar draklive-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar.gz draklive-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar.bz2 draklive-4fe3fa0731df002a22320458e5e55c5cc1ec5318.tar.xz draklive-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.pm | 11 |
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; |