diff options
-rwxr-xr-x | draklive | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -706,7 +706,7 @@ EOF close($fdisk) or die "unable to run fdisk\n" . ("$!" ? "Error closing fdisk pipe: $!" : "Exit status $? from fdisk"); my $inode_size = $media->get_media_setting('inode_size'); - return allocate_partition($dest, 0, $sector_size, $fs, $inode_size); + map_index { allocate_partition($dest, $::i, $sector_size, $_->{fs_type}, $inode_size) } @{$media->{partitions}}; } sub create_disk_master { @@ -720,11 +720,12 @@ sub create_disk_master { 70000000) : directory_usage($live->get_system_root) + 200000000; - my $loop = allocate_master($live->{media}, $dest, $disk_size, $live->{media}->get_media_setting('fs')); - local $opts->{device} = $loop; + my @loops = allocate_master($live->{media}, $dest, $disk_size, $live->{media}->get_media_setting('fs')); + my $slash_idx = $live->{media}->find_partition_index('/'); + local $opts->{device} = $loops[$slash_idx]; local $opts->{disk_device} = $dest; record_master($live, $opts); - run_('losetup', '-d', $loop); + run_('losetup', '-d', $_) foreach @loops; } #- $opts: @@ -1061,10 +1062,11 @@ sub create_usb_replicator { 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); - my $loop = allocate_master($live->{replicator}{media}, $dest, 5000000 + $size, 'vfat'); - my $opts = { device => $loop, disk_device => $dest, append => $live->{replicator}{append} }; + my @loops = allocate_master($live->{replicator}{media}, $dest, 5000000 + $size, 'vfat'); + my $slash_idx = $live->{replicator}{media}->find_partition_index('/'); + my $opts = { device => $loops[$slash_idx], disk_device => $dest, append => $live->{replicator}{append} }; record_usb_replicator($live, $opts); - run_('losetup', '-d', $loop); + run_('losetup', '-d', $_) foreach @loops; } sub record_usb_replicator { |