diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-07-30 17:21:32 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-07-30 17:21:32 +0000 |
commit | dfcc04ae19348402ecfe208a03b46ba22a3de849 (patch) | |
tree | d17a1de24cab68995f54f906fda3d9b370ac574b | |
parent | 5373ff480bc28e5460d6ccbd7ed1586d5e7e6206 (diff) | |
download | draklive-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar draklive-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar.gz draklive-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar.bz2 draklive-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar.xz draklive-dfcc04ae19348402ecfe208a03b46ba22a3de849.zip |
extract geom hash, to get closer to DrakX
-rwxr-xr-x | draklive | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -680,14 +680,16 @@ sub allocate_partition { sub allocate_master { my ($live, $media, $dest, $size, $fs) = @_; mkdir_p(dirname($dest)); - my $heads = 16; - my $sectors_per_track = 63; + my $geom = { + heads => 16, + sectors => 63, # sectors per track + }; my $sector_size = 512; - my $track_size = $sector_size * $sectors_per_track; - my $cylinder_size = $track_size * $heads; + my $track_size = $sector_size * $geom->{sectors}; + my $cylinder_size = $track_size * $geom->{heads}; my $disk_size = $size + $track_size; - my $cylinders = int($disk_size / $cylinder_size); + $geom->{cylinders} = int($disk_size / $cylinder_size); MDV::Draklive::Utils::device_allocate_file($dest, $disk_size); @@ -699,7 +701,7 @@ sub allocate_master { require fs::type; my $pt_type = sprintf('%x', fs::type::fs_type2subpart($fs)->{pt_type}); - open(my $fdisk, "| fdisk -C $cylinders -S $sectors_per_track -H $heads $dest"); + open(my $fdisk, "| fdisk -C $geom->{cylinders} -S $geom->{sectors} -H $geom->{heads} $dest"); my $oem_rescue_idx = $media->find_partition_index('OEM_RESCUE'); if (defined $oem_rescue_idx) { |