CCISS disk support had a regression in systeminstaller-oscar-2.4.8-1

Those 2 patches should fix CCISS disk support.
I don't know if it's related to ticket #579.

-- 
        Olivier LAHAYE
        CEA Saclay
        DRT-LIST-DETECS-SSTM
--- /usr/lib/systeminstaller/SystemInstaller/Partition/IA.pm.orig	2009-11-25 17:24:28.000000000 +0100
+++ ./usr/lib/systeminstaller/SystemInstaller/Partition/IA.pm	2009-11-25 17:19:22.000000000 +0100
@@ -99,17 +99,16 @@
     return $flags;
 }
 
-sub get_extended_partition_id ($) {
-    my $disk = @_;
-
+# Bad work around to handle /dev/ccis/c#d#p# (handle the "p")
+sub get_partition_device ($$) {
+    my ($disk, $partnum) = @_;
     if ($disk =~ /\/dev\/cciss\/c[0-9]+d[0-9][0-9]*$/) {
-        return "p5";
+        return $disk."p".$partnum;
     } else {
-        return "5";
+        return $disk.$partnum;
     }
 }
 
-
 # Create an autoinstallscript.conf file to be used
 # be used by SystemImager's mkautoinstallscript.
 # Input:  partition table created from input partition_file
@@ -155,11 +154,11 @@
         print AICONF "label_type=\"$DISKS{LABEL_TYPE}\" ";
         print AICONF "unit_of_measurement=\"$DISKS{UNITS}\">\n";
         my $extparcreated=0;
-        my $extpartid = get_extended_partition_id ($disk);
+        my $extpartid = get_partition_device ($disk,5);
         # First do the primary partitions
         # TODO: This will not work with gpt partitions.
         foreach my $parnum (1..4) {
-            my $parname=$disk.$parnum;
+            my $parname=get_partition_device ($disk,$parnum);
             if (defined $DISKS{PARTITIONS}{$parname}) {
                 print AICONF "\t\t<part num=\"$DISKS{PARTITIONS}{$parname}{PNUM}\" ";
                 print AICONF "size=\"$DISKS{PARTITIONS}{$parname}{SIZE}\" ";
--- /usr/lib/systeminstaller/SystemInstaller/Partition.pm.orig	2009-11-25 17:24:07.000000000 +0100
+++ ./usr/lib/systeminstaller/SystemInstaller/Partition.pm	2009-11-25 17:16:18.000000000 +0100
@@ -276,12 +276,15 @@
 
         # Get the drive,(eg hda or cciss/c0d0)
         $DEV{DRIVE}=$DEV{DEVICE};
+        $DEV{PARTNUM}=$DEV{DEVICE};
         $DEV{DRIVE}=~s/\/dev\///;
         if ($DEV{DRIVE}=~/c[0-9]+d[0-9]+p[0-9]*$/) {
             $DEV{DRIVE}=~s/p[0-9]*$//;
+            # Get the partition number
             $DEV{PARTNUM}=~s/\/dev\/$DEV{DRIVE}p*//;
         } else {
             $DEV{DRIVE}=~s/[0-9]*$//;
+            # Get the partition number
             $DEV{PARTNUM}=~s/\/dev\/$DEV{DRIVE}//;
         }
         # Get the drive type, (hd)
@@ -290,8 +293,6 @@
         # Get the drive letter, (a)
         $DEV{DLETTER}=$DEV{DRIVE};
         $DEV{DLETTER}=~s/$DEV{TYPE}//;
-        # Get the partition number
-        $DEV{PARTNUM}=$DEV{DEVICE};
 
         return %DEV;
 } #parse_dev
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to