summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdraklive11
1 files changed, 8 insertions, 3 deletions
diff --git a/draklive b/draklive
index f35b876..369a8bf 100755
--- a/draklive
+++ b/draklive
@@ -666,13 +666,18 @@ sub get_disk_master_path {
$live->get_builddir . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.img';
}
-sub allocate_partition {
- my ($dest, $part, $o_inode_size) = @_;
-
+sub get_partition_loop {
+ my ($dest, $part) = @_;
require devices;
my $loop = devices::find_free_loop();
run_('losetup', '-o', $part->{start} * $common::SECTORSIZE, '-s', $part->{size} * $common::SECTORSIZE, $loop, $dest)
or die "unable to setup loop device";
+ return $loop;
+}
+
+sub allocate_partition {
+ my ($dest, $part, $o_inode_size) = @_;
+ my $loop = get_partition_loop($dest, $part);
MDV::Draklive::Utils::device_mkfs($loop, $part->{fs_type}, $o_inode_size) or die "unable to format $dest\n";
return $loop;