Andrea Righi wrote:
> 
> In your case the partition sizes differ from the values in
> autoinstallscript.conf and the real values that you can see in your
> imaged clients.
> 
> I've a RHEL4 installed via systemimager and it seems that the problem
> occurs also in my case. I think the reason is that parted (<1.6.23)
> prints in output values in MB considering 1MB = 1000KB and accepts in
> input values in MB with 1MB = 1024KB.
> 

Jonathan,

the following patch fixes the problem in my case. I have already checked
it in the trunk. The fix will be included in the next 3.8.1 release.

It would be great if you could test it also in your environment...

Regards,
-Andrea

Index: lib/SystemImager/Common.pm
===================================================================
--- lib/SystemImager/Common.pm  (revision 3959)
+++ lib/SystemImager/Common.pm  (working copy)
@@ -10,6 +10,7 @@
 package SystemImager::Common;

 use strict;
+use POSIX qw/ceil/;
 use vars qw($version_number $VERSION);

 $version_number="SYSTEMIMAGER_VERSION_STRING";
@@ -537,6 +538,16 @@
                         $startMB =~ s/(\d+)MB/$1/go;
                         $endMB   =~ s/(\d+)MB/$1/go;

+                        # Fix partition size with old versions of parted.
+                        if (version_cmp($parted_version, '1.6.23') < 0) {
+                            if ($startMB) {
+                                $startMB = ceil($startMB * 1024 * 1024 / 1000 
/ 1000);
+                            }
+                            if ($endMB) {
+                                $endMB = ceil($endMB * 1024 * 1024 / 1000 / 
1000);
+                            }
+                        }
+
                         #
                         # Get rid of parted's fs info.  We don't use it.  But 
we do need
                         # 'name' and 'flags', and it's a pain in the but to 
parse this
@@ -596,6 +607,16 @@
                         $startMB =~ s/(\d+)MB/$1/go;
                         $endMB   =~ s/(\d+)MB/$1/go;

+                        # Fix partition size with old versions of parted.
+                        if (version_cmp($parted_version, '1.6.23') < 0) {
+                            if ($startMB) {
+                                $startMB = ceil($startMB * 1024 * 1024 / 1000 
/ 1000);
+                            }
+                            if ($endMB) {
+                                $endMB = ceil($endMB * 1024 * 1024 / 1000 / 
1000);
+                            }
+                        }
+
                         #
                         # Get rid of parted's fs info.  We don't use it.  But 
we do need
                         # 'name' and 'flags', and it's a pain in the but to 
parse this


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sisuite-devel mailing list
sisuite-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sisuite-devel

Reply via email to