summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Draklive/Config.pm1
-rw-r--r--lib/MDV/Draklive/Media.pm11
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/MDV/Draklive/Config.pm b/lib/MDV/Draklive/Config.pm
index 3216c4d..9cf96a0 100644
--- a/lib/MDV/Draklive/Config.pm
+++ b/lib/MDV/Draklive/Config.pm
@@ -79,7 +79,6 @@ sub complete_config {
foreach ($live->{media}, if_($live->{replicator}{media}, $live->{replicator}{media}), if_($live->{oem_rescue}{media}, $live->{oem_rescue}{media})) {
bless $_, 'MDV::Draklive::Media';
- $_->{partitions} ||= [ { mntpoint => '/' } ];
}
mkdir_p($live->get_builddir);
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;