diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-07-31 13:53:48 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-07-31 13:53:48 +0000 |
commit | 1746f1a3f6f0ae8781325452566d003e53c9a762 (patch) | |
tree | 1fc07e8b92b6147316ee7127dcf5d59dc60efb62 | |
parent | 3070a3954bdbd203f359ea6990c653a65605a5f1 (diff) | |
download | draklive-1746f1a3f6f0ae8781325452566d003e53c9a762.tar draklive-1746f1a3f6f0ae8781325452566d003e53c9a762.tar.gz draklive-1746f1a3f6f0ae8781325452566d003e53c9a762.tar.bz2 draklive-1746f1a3f6f0ae8781325452566d003e53c9a762.tar.xz draklive-1746f1a3f6f0ae8781325452566d003e53c9a762.zip |
use common::SECTORSIZE
-rwxr-xr-x | draklive | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -664,13 +664,13 @@ sub get_disk_master_path { } sub allocate_partition { - my ($dest, $part_idx, $sector_size, $fs, $o_inode_size) = @_; + my ($dest, $part_idx, $fs, $o_inode_size) = @_; my @parts = group_by2(run_program::get_stdout("sfdisk -d $dest") =~ /start=\s*(\d+),\s*size=\s*(\d+)/g); my ($part_start, $part_nb_sectors) = @{$parts[$part_idx]}; require devices; my $loop = devices::find_free_loop(); - run_('losetup', '-o', $part_start * $sector_size, '-s', $part_nb_sectors * $sector_size, $loop, $dest) + run_('losetup', '-o', $part_start * $common::SECTORSIZE, '-s', $part_nb_sectors * $common::SECTORSIZE, $loop, $dest) or die "unable to setup loop device"; MDV::Draklive::Utils::device_mkfs($loop, $fs, $o_inode_size) or die "unable to format $dest\n"; @@ -684,8 +684,7 @@ sub allocate_master { heads => 16, sectors => 63, # sectors per track }; - my $sector_size = 512; - my $track_size = $sector_size * $geom->{sectors}; + my $track_size = $common::SECTORSIZE * $geom->{sectors}; my $cylinder_size = $track_size * $geom->{heads}; my $disk_size = $track_size + fold_left { $::a + $::b } map { $_->{size} * $common::SECTORSIZE } @{$live->{media}{partitions}}; @@ -713,7 +712,7 @@ sub allocate_master { partition_table::write($hd); my $inode_size = $media->get_media_setting('inode_size'); - map_index { allocate_partition($dest, $::i, $sector_size, $_->{fs_type}, $inode_size) } @{$media->{partitions}}; + map_index { allocate_partition($dest, $::i, $_->{fs_type}, $inode_size) } @{$media->{partitions}}; } sub create_disk_master { |