diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-08-03 11:36:01 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-08-03 11:36:01 +0000 |
commit | 65c0e7d3faaf132d329f54bd6c958ca6e9d82a92 (patch) | |
tree | 565235e456caf9ecb390573127370e85fbd546a3 | |
parent | bea6eafdd0ef6d6d06237b18577f1fd8118b603b (diff) | |
download | draklive-65c0e7d3faaf132d329f54bd6c958ca6e9d82a92.tar draklive-65c0e7d3faaf132d329f54bd6c958ca6e9d82a92.tar.gz draklive-65c0e7d3faaf132d329f54bd6c958ca6e9d82a92.tar.bz2 draklive-65c0e7d3faaf132d329f54bd6c958ca6e9d82a92.tar.xz draklive-65c0e7d3faaf132d329f54bd6c958ca6e9d82a92.zip |
introduce get_partition_loop
-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; |