From 65c0e7d3faaf132d329f54bd6c958ca6e9d82a92 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 3 Aug 2009 11:36:01 +0000 Subject: introduce get_partition_loop --- draklive | 11 ++++++++--- 1 file 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; -- cgit v1.2.1