diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-09-11 09:46:43 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-09-11 09:46:43 +0000 |
commit | 90361255faffbf53f6f8ff67383ab47a21c17b4f (patch) | |
tree | 0ddd6b31613321d4065abe865c4bdf1ec69e5489 | |
parent | a74f2bf0f95dcf1f034c2e566f366f505e83ba81 (diff) | |
download | draklive-90361255faffbf53f6f8ff67383ab47a21c17b4f.tar draklive-90361255faffbf53f6f8ff67383ab47a21c17b4f.tar.gz draklive-90361255faffbf53f6f8ff67383ab47a21c17b4f.tar.bz2 draklive-90361255faffbf53f6f8ff67383ab47a21c17b4f.tar.xz draklive-90361255faffbf53f6f8ff67383ab47a21c17b4f.zip |
use opts in allocate_master
-rwxr-xr-x | draklive | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -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); } |