[Pancutan-commits] r72 - in pancutan: . lib/Pancutan

tincho-guest at alioth.debian.org tincho-guest at alioth.debian.org
Mon Aug 20 14:50:12 UTC 2007


Author: tincho-guest
Date: 2007-08-20 14:50:12 +0000 (Mon, 20 Aug 2007)
New Revision: 72

Modified:
   pancutan/lib/Pancutan/Config.pm
   pancutan/pancutan
Log:
Added parameter uml_args to config, to solve out-of-memory problem in UML.


Modified: pancutan/lib/Pancutan/Config.pm
===================================================================
--- pancutan/lib/Pancutan/Config.pm	2007-08-20 14:32:17 UTC (rev 71)
+++ pancutan/lib/Pancutan/Config.pm	2007-08-20 14:50:12 UTC (rev 72)
@@ -32,6 +32,7 @@
     continue_on_fatal => 0,
     verbose => 0,
     mount_method => "sudomount",
+    uml_args => "mem=64M",
 );
 
 my %validopts = map { $_ => 1 } keys %default;
@@ -79,6 +80,12 @@
     unless($CONFIG{temp_dir}) {
         $CONFIG{temp_dir} = ".pancutan.$$";
     }
+    if($CONFIG{uml_args}) {
+        $CONFIG{uml_args} = [ $CONFIG{uml_args} ] unless(ref $CONFIG{uml_args});
+        if(ref $CONFIG{uml_args} and ref $CONFIG{uml_args} ne "ARRAY") {
+            die("Invalid ref type for uml_args: ", ref $CONFIG{uml_args}, "\n");
+        }
+    }
     mkdir $CONFIG{temp_dir} or die "Cannot create temporary directory: $!\n";
     foreach(@ARGV) {
         unless(-f $_ or -b $_ or (-l $_ and -f Cwd::realpath($_))
@@ -209,7 +216,8 @@
             "con1=fd:" . fileno(STDIN) . ",fd:" . fileno($fhout),
             "con2=fd:" . fileno(STDIN) . ",fd:" . fileno($fherr),
             qw(con=none root=/dev/root rootflags=/ rootfstype=hostfs
-            devfs=nomount quiet), "init=$uml_script" );
+            devfs=nomount quiet), "init=$uml_script");
+        push @args, @{$CONFIG{uml_args}} if($CONFIG{uml_args});
         foreach(0..$#blocks) {
             push @args, "ubd${_}r=$blocks[$_]";
         }

Modified: pancutan/pancutan
===================================================================
--- pancutan/pancutan	2007-08-20 14:32:17 UTC (rev 71)
+++ pancutan/pancutan	2007-08-20 14:50:12 UTC (rev 72)
@@ -271,6 +271,12 @@
 
 These parameters are the same as in the command line.
 
+=item B<uml_args>
+
+Allows to pass extra parameters to user-mode-linux. It should be an array ref
+of strings to be passed to exec(), or a string if it's onle one parameter.
+Defaults to "mem=64M".
+
 =back
 
 =cut




More information about the Pancutan-commits mailing list