Browse Source

A few more improvements to the mtd code to handle memory better 16M increments

for mtdram, will probably do a similiar thing for blkmtd which appears to be
exponential 16 32 64 etc .. ofcourse at 128 things can get narly.
master
freesource 23 years ago
parent
commit
30a11e4bf2
  1. 37
      BootRoot/BootRoot.pm

37
BootRoot/BootRoot.pm

@ -1800,11 +1800,18 @@ sub uml_box {
# Grab the file being used
if ( m,(ubd0=[/\d\w-]+), ) {
my $ubd0_replacement = $1;
$ubd0 = (split(/=/,$1))[1];
chomp $ubd0;
$ubd0 = $ubd0 . "_dd";
s/$ubd0_replacement/ubd0=$ubd0/;
if ( $1 !~ /_dd/ ) {
my $ubd0_replacement = $1;
$ubd0 = (split(/=/,$1))[1];
chomp $ubd0;
$ubd0 = $ubd0 . "_dd";
s/$ubd0_replacement/ubd0=$ubd0/;
}
else {
m,(ubd0=[/\d\w-]+),;
$ubd0 = (split(/=/,$1))[1];
chomp $ubd0;
}
}
if ( $mtd_radio_mtdram->get_active() ) {
@ -1862,6 +1869,15 @@ sub uml_box {
# Tell initrd whether it is mtdram or blkmtd, and
if ( $mtd_radio_mtdram->get_active() ) {
# blkmtd uses the _dd images, mtdram uses the real image
for ( $entry_advanced[10],$entry_advanced[9] ) {
if ( m,(ubd0=[/\d\w-]+), ) {
if ( $1 =~ /_dd/ ) {
s/_dd//g;
}
}
}
# ramdisk_size
if ( !$ramdisk_size ) {
$ramdisk_size = "ramdisk_size=$total_size";
@ -1870,7 +1886,7 @@ sub uml_box {
undef $ramdisk_size;
}
# Memory needs to be figure out in 8192K blocks
# Memory needs to be figure out in 16384K blocks
# otherwise it fails, and it needs to be at least 16384
# for uml.
@ -1880,7 +1896,7 @@ sub uml_box {
$mem_size = 16384;
}
else {
$mem_size = 8192 * ceil($mtd_total_size / 8192);
$mem_size = 16384 * ceil($mtd_total_size / 16384);
}
if ( !$mem ) {
@ -1931,6 +1947,13 @@ sub uml_box {
}
waitpid($pid,0);
# Reset $entry_advanced[9] && $entry_advanced[10]
if ( $mtd_check->get_active() ) {
$entry_advanced[9] = $eab2->entry->get_text();
$entry_advanced[10] = $eab3->get_text();
}
}
else {

Loading…
Cancel
Save