diff options
-rwxr-xr-x | draklive | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; |