summaryrefslogtreecommitdiffstats
path: root/draklive
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-07-30 17:21:32 +0000
committerOlivier Blin <oblin@mandriva.com>2009-07-30 17:21:32 +0000
commitdfcc04ae19348402ecfe208a03b46ba22a3de849 (patch)
treed17a1de24cab68995f54f906fda3d9b370ac574b /draklive
parent5373ff480bc28e5460d6ccbd7ed1586d5e7e6206 (diff)
downloaddrakiso-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar
drakiso-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar.gz
drakiso-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar.bz2
drakiso-dfcc04ae19348402ecfe208a03b46ba22a3de849.tar.xz
drakiso-dfcc04ae19348402ecfe208a03b46ba22a3de849.zip
extract geom hash, to get closer to DrakX
Diffstat (limited to 'draklive')
-rwxr-xr-xdraklive14
1 files changed, 8 insertions, 6 deletions
diff --git a/draklive b/draklive
index b82fd54..d03128f 100755
--- a/draklive
+++ b/draklive
@@ -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) {