From 4da04f862397f4917670d31c4594147a1f0bb608 Mon Sep 17 00:00:00 2001 From: freesource Date: Fri, 8 Mar 2002 07:35:32 +0000 Subject: [PATCH] This adds ceil() to $total_size, and always makes sure that ramdisk_size is at least 4096. --- BootRoot/BootRoot.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/BootRoot/BootRoot.pm b/BootRoot/BootRoot.pm index 545d841..abfe2e4 100644 --- a/BootRoot/BootRoot.pm +++ b/BootRoot/BootRoot.pm @@ -1683,7 +1683,7 @@ sub uml_box { if ( -f "$tmp/$entry_advanced[4]" ) { my $stat_size = (stat("$tmp/$entry_advanced[4]"))[12]/2; my $blocks = ($stat_size + ( $stat_size * 0.30 ))/1024; - $blocks = sprintf("%.f",$blocks); + $blocks = sprintf("%.f",ceil($blocks)); $mtd_total_size = $blocks * 1024; } $eab3->signal_connect( "changed", sub { @@ -1691,7 +1691,7 @@ sub uml_box { if ( -f $root_fs ) { my $stat_size = (stat("$root_fs"))[12]/2; my $blocks = ($stat_size + ( $stat_size * 0.30 ))/1024; - $blocks = sprintf("%.f",$blocks); + $blocks = sprintf("%.f",ceil($blocks)); $mtd_total_size = $blocks * 1024; } if ( $mtd_size ) { @@ -1881,7 +1881,7 @@ sub uml_box { } - # Memory needs to be figure out in 16384K blocks + # Memory needs to be figured out in 16384K blocks # otherwise it fails, and it needs to be at least 16384 # for uml. @@ -1923,6 +1923,9 @@ sub uml_box { # ramdisk_size if ( !$ramdisk_size ) { $ramdisk_size = "ramdisk_size=$total_size"; + if ( $ramdisk_size < 4096 ) { + $ramdisk_size = 4096; + } } else { undef $ramdisk_size;