From 74dd88069a2899196c0478d42c9499ddfaae6de2 Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 7 Mar 2002 03:45:11 +0000 Subject: [PATCH] This is even nicer. It gives both mtdram and blkmtd the same memory parameters for mem. Just have to watch out for that nasty cramfsck by Linus. --- BootRoot/BootRoot.pm | 47 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/BootRoot/BootRoot.pm b/BootRoot/BootRoot.pm index e2d7d3f..01d0d82 100644 --- a/BootRoot/BootRoot.pm +++ b/BootRoot/BootRoot.pm @@ -1862,6 +1862,29 @@ sub uml_box { } + # Memory needs to be figure out in 16384K blocks + # otherwise it fails, and it needs to be at least 16384 + # for uml. + + # mem + my $mem_size; + if ( $total_size < 16384 ) { + $mem_size = 16384; + } + else { + $mem_size = 16384 * ceil($mtd_total_size / 16384); + if ( $total_size == $mem_size ) { + $mem_size = $mem_size + 16384; + } + } + + if ( !$mem ) { + $mem = "mem=$mem_size" . "K"; + } + else { + undef $mem; + } + # Will use this format # initrd=Initrd mem=? mtd=type,fs_type,size,erasure @@ -1886,28 +1909,6 @@ sub uml_box { undef $ramdisk_size; } - # Memory needs to be figure out in 16384K blocks - # otherwise it fails, and it needs to be at least 16384 - # for uml. - - # mem - my $mem_size; - if ( $total_size < 16384 ) { - $mem_size = 16384; - } - else { - $mem_size = 16384 * ceil($mtd_total_size / 16384); - if ( $total_size == $mem_size ) { - $mem_size = $mem_size + 16384; - } - } - - if ( !$mem ) { - $mem = "mem=$mem_size" . "K"; - } - else { - undef $mem; - } # Order does matter because it's used by linuxrc $entry_advanced[9] = @@ -1927,7 +1928,7 @@ sub uml_box { # Order does matter because it's used by linuxrc $entry_advanced[9] = "mtd=blkmtd,$fs_type,$total_size,$erasure_size,, " . - "$initrd " . + "$mem $initrd " . $entry_advanced[9]; }