diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-09-11 13:09:18 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-09-11 13:09:18 +0000 |
commit | 836fcd32803f03499522dbd332f0b7047b79287d (patch) | |
tree | 09634a5da31c1cceb17b7f77c87aec74b849621e /lib/MDV/Draklive/Media.pm | |
parent | e31d6a0a327bb9d63e912df578afa2da96898063 (diff) | |
download | drakiso-836fcd32803f03499522dbd332f0b7047b79287d.tar drakiso-836fcd32803f03499522dbd332f0b7047b79287d.tar.gz drakiso-836fcd32803f03499522dbd332f0b7047b79287d.tar.bz2 drakiso-836fcd32803f03499522dbd332f0b7047b79287d.tar.xz drakiso-836fcd32803f03499522dbd332f0b7047b79287d.zip |
initialize default partitions earlier (required when building boot files)
Diffstat (limited to 'lib/MDV/Draklive/Media.pm')
-rw-r--r-- | lib/MDV/Draklive/Media.pm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/MDV/Draklive/Media.pm b/lib/MDV/Draklive/Media.pm index bb938ff..f86d01e 100644 --- a/lib/MDV/Draklive/Media.pm +++ b/lib/MDV/Draklive/Media.pm @@ -5,6 +5,21 @@ use MDV::Draklive::Storage; use POSIX; use common; +sub new { + my ($media) = @_; + + bless $media, 'MDV::Draklive::Media'; + + $media->{partitions} ||= [ { mntpoint => '/' } ]; + + for $mntpoint (qw(/ OEM_RESCUE)) { + my $part = find { $_->{mntpoint} eq $mntpoint } @{$media->{partitions}}; + $part->{fs_type} ||= $media->get_media_setting('fs'); + } + + $media; +} + sub get_initrd_path { my ($media) = @_; '/' . $media->{storage} . '/initrd.gz'; @@ -61,13 +76,6 @@ sub find_boot_partition_index { sub supplement_partitions { my ($media, $total_size) = @_; - $media->{partitions} ||= [ { mntpoint => '/' } ]; - - for $mntpoint (qw(/ OEM_RESCUE)) { - my $part = find { $_->{mntpoint} eq $mntpoint } @{$media->{partitions}}; - $part->{fs_type} ||= $media->get_media_setting('fs'); - } - my $correction = 1.2; my $slash = find { $_->{mntpoint} eq '/' } @{$media->{partitions}}; $slash->{size} ||= POSIX::ceil($total_size * $correction / $common::SECTORSIZE); |