From 90361255faffbf53f6f8ff67383ab47a21c17b4f Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 11 Sep 2009 09:46:43 +0000 Subject: use opts in allocate_master --- draklive | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/draklive b/draklive index 0c04004..f30772f 100755 --- a/draklive +++ b/draklive @@ -744,12 +744,12 @@ sub set_part_real_device { } sub allocate_master { - my ($live, $media, $dest) = @_; + my ($live, $media, $opts) = @_; - my $hd = get_hd_from_layout($media, $dest); + my $hd = get_hd_from_layout($media, $opts->{device}); - mkdir_p(dirname($dest)); - MDV::Draklive::Utils::device_allocate_file($dest, $hd->{totalsectors} * $common::SECTORSIZE); + mkdir_p(dirname($opts->{device})); + MDV::Draklive::Utils::device_allocate_file($opts->{device}, $hd->{totalsectors} * $common::SECTORSIZE); partition_table::raw::zero_MBR($hd); @@ -784,10 +784,10 @@ sub create_disk_master { $live->{media}->supplement_partitions($slash_size); - my $dest = get_disk_master_path($live); - allocate_master($live, $live->{media}, $dest); - my $slash_idx = $live->{media}->find_partition_index('/'); $opts->{device} ||= get_disk_master_path($live); + allocate_master($live, $live->{media}, $opts); + + my $slash_idx = $live->{media}->find_partition_index('/'); record_master($live, $opts); } @@ -1203,14 +1203,13 @@ sub get_disk_replicator_files { sub create_usb_replicator { my ($live) = @_; - my $dest = get_disk_replicator_path($live); my %files = get_disk_replicator_files($live); my $size = fold_left { $::a + $::b } map { directory_usage($_, 'apparent') } keys(%files); $live->{replicator}{media}->supplement_partitions($size); - allocate_master($live, $live->{replicator}{media}, $dest); my $opts = { device => get_disk_replicator_path($live) }; + allocate_master($live, $live->{replicator}{media}, $opts); record_usb_replicator($live, $opts); } -- cgit v1.2.1