You might try the following patch. I ran into problems with the new
version of parted not accepting the size that install.pl generates when
it converts fdisk arguments to parted arguments. The attached patch adds
a new function to the install.pl file that converts all sizes to MB.
-Warren
--- install.pl.cvs 2006-05-19 11:55:29.577647750 -0500
+++ install.pl 2006-05-19 11:55:28.464925565 -0500
@@ -490,6 +490,28 @@
return get_disk_sectors () * 512 / 1024 / 1024;
}
+# Converts new parted output from mb/kb to mb without designator
+sub convert_parted_output ($) {
+ # Convert number to mb in 1024 size
+ my $input = shift;
+ my $output = 0;
+
+ if ($input =~ /MB/i) {
+ my ($size) = $input =~ /(\d+)\w+/;
+ $output = $size;
+ }
+ if ($input =~ /kB/i) {
+ my ($size) = $input =~ /(\d+)\w+/;
+ $output = ($size / 1000) * 1024;
+ }
+ if ($input =~ /GB/i) {
+ my ($size) = $input =~ /(\d+)\w+/;
+ $output = $size * 1024;
+ }
+
+ return $output;
+}
+
# Find the largest interval of free space on the drive which does not
# overlap other partitions. If argument is true, find space for
# creating a logical partition (i.e., within the extended partition).
@@ -511,10 +533,14 @@
while (my $line = <PARTED>) {
my ($start, $end, $parttype) =
- ($line =~
/^\d+\s+(\d+\.\d{3})\s+(\d+\.\d{3})\s+(primary|logical|extended)/);
+ ($line =~
/^\d+\s+(\d+\w+)\s+(\d+\w+)\s+\d+\w+\s+(primary|logical|extended)/);
defined $start && defined $end && defined $parttype
or next;
+ # Convert parted output
+ $start = convert_parted_output($start);
+ $end = convert_parted_output($end);
+
if ($logical && $parttype eq 'extended') {
# If multiple extended partitions (weird), use the first.
defined $ext_start && defined $ext_end
@@ -630,9 +656,9 @@
$fs = $type_map{$type};
}
- if ($ptype eq 'pri') { $parttype = 'primary' }
- elsif ($ptype eq 'log') { $parttype = 'logical' }
- elsif ($ptype eq 'ext') { $parttype = 'extended'; $fs='' }
+ if ($ptype eq 'pri') { $parttype = 'primary' }
+ elsif ($ptype eq 'log') { $parttype = 'logical' }
+ elsif ($ptype eq 'ext') { $parttype = 'extended'; $fs='' }
$ret = "$parted mkpart $parttype $fs $start $end";
}