diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-09-09 15:16:42 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-09-09 15:16:42 +0000 |
commit | a74f2bf0f95dcf1f034c2e566f366f505e83ba81 (patch) | |
tree | 839378139056bfd3604f249dbf5028f9c572f29b | |
parent | 97f5cb2a1ea85a995fae241e9f01aac98dc464ab (diff) | |
download | drakiso-a74f2bf0f95dcf1f034c2e566f366f505e83ba81.tar drakiso-a74f2bf0f95dcf1f034c2e566f366f505e83ba81.tar.gz drakiso-a74f2bf0f95dcf1f034c2e566f366f505e83ba81.tar.bz2 drakiso-a74f2bf0f95dcf1f034c2e566f366f505e83ba81.tar.xz drakiso-a74f2bf0f95dcf1f034c2e566f366f505e83ba81.zip |
guess partition device number as well
-rwxr-xr-x | draklive | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -728,11 +728,14 @@ sub get_hd_from_file { return $hd; } -sub guess_media_partitions_start { +sub supplement_media_partitions { my ($media, $hd) = @_; - #- try to find partition start by matching actual partition table and partitions list + #- try to find additional partition details (start, device) + #- by matching actual partition table and partitions list my @all_parts = partition_table::get_normal_parts($hd); - $media->{partitions}[$_]{start} = $all_parts[$_]{start} for 0 .. $#all_parts; + foreach my $idx (0 .. $#all_parts) { + $media->{partitions}[$idx]{$_} = $all_parts[$idx]{$_} foreach qw(start device); + } } sub set_part_real_device { @@ -936,7 +939,7 @@ sub record_usb_master { or die "unable to find recording device (missing label? try with --device <device>)\n"; my $hd = get_hd_from_file($media, $main_device); - guess_media_partitions_start($media, $hd); + supplement_media_partitions($media, $hd); my $slash_idx = $media->find_partition_index('/'); my $slash = $media->{partitions}[$slash_idx]; @@ -997,7 +1000,7 @@ sub record_harddisk_master { or die "unable to find recording device (missing label? try with --device <device>)\n"; my $hd = get_hd_from_file($media, $main_device); - guess_media_partitions_start($media, $hd); + supplement_media_partitions($media, $hd); my @partitions = grep { $_->{mntpoint} =~m!^/! } @{$media->{partitions}}; mkdir_p($live->{mnt}); @@ -1172,7 +1175,7 @@ sub record_oem_rescue { or die "unable to find recording device (missing label? try with --device <device>)\n"; my $hd = get_hd_from_file($media, $main_device); - guess_media_partitions_start($media, $hd); + supplement_media_partitions($media, $hd); my $oem_rescue = $media->{partitions}[$oem_rescue_idx]; set_part_real_device($hd, $oem_rescue); @@ -1222,7 +1225,7 @@ sub record_usb_replicator { or die "unable to find recording device (missing label? try with --device <device>)\n"; my $hd = get_hd_from_file($media, $main_device); - guess_media_partitions_start($media, $hd); + supplement_media_partitions($media, $hd); my $slash_idx = $media->find_partition_index('/'); my $slash = $media->{partitions}[$slash_idx]; |