Hmm ok, just wanted to make sure. Maybe what I saw wasn't related to the
issue your having. I've attached the patch(s)

-Warren

On 6/12/2006 10:52 AM, Florian Effenberger wrote:
> Hi Warren,
> 
>> Out of curiosity are you guys using my patch for the newer versions of
>> parted? I seem to recall seeing this ntldr issue on several machines
>> that went away after I corrected the input to parted.
> 
> IIRC, I tried parted 1.7.1 + your patch and it did not work for me. But,
> can you mail the patch to me?
> 
> Thanks
> Florian
--- 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";
     }
diff -u -r1.51 master
--- master      10 Mar 2005 21:25:22 -0000      1.51
+++ master      20 May 2006 04:33:49 -0000
@@ -387,8 +387,10 @@
     || die "install.pl exited non-zero"
 
 # Determine partition number to use.
-active_part_line=`parted -s /dev/dsk print | grep 
'^[[:digit:]].*[[:space:]]boot'`
-active_part=${active_part_line%% *}
+active_part_line=`parted -s /dev/dsk print | grep 
'^.*[[:digit:]].*[[:space:]]boot'`
+active_part=${active_part_line%%  *}
+# Remove excess spaces?
+active_part=${active_part/ /}
 
 if [ -z "$active_part" ] ; then
     echo "Partition table:" >&2
_______________________________________________
unattended-devel mailing list
unattended-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unattended-devel

Reply via email to