1
0
mirror of https://github.com/fspc/gbootroot.git synced 2025-04-04 07:43:22 -04:00

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.
This commit is contained in:
freesource 2002-03-07 02:55:32 +00:00
parent 6b3eda4286
commit 30a11e4bf2

View File

@ -1800,12 +1800,19 @@ sub uml_box {
# Grab the file being used # Grab the file being used
if ( m,(ubd0=[/\d\w-]+), ) { if ( m,(ubd0=[/\d\w-]+), ) {
if ( $1 !~ /_dd/ ) {
my $ubd0_replacement = $1; my $ubd0_replacement = $1;
$ubd0 = (split(/=/,$1))[1]; $ubd0 = (split(/=/,$1))[1];
chomp $ubd0; chomp $ubd0;
$ubd0 = $ubd0 . "_dd"; $ubd0 = $ubd0 . "_dd";
s/$ubd0_replacement/ubd0=$ubd0/; s/$ubd0_replacement/ubd0=$ubd0/;
} }
else {
m,(ubd0=[/\d\w-]+),;
$ubd0 = (split(/=/,$1))[1];
chomp $ubd0;
}
}
if ( $mtd_radio_mtdram->get_active() ) { if ( $mtd_radio_mtdram->get_active() ) {
@ -1862,6 +1869,15 @@ sub uml_box {
# Tell initrd whether it is mtdram or blkmtd, and # Tell initrd whether it is mtdram or blkmtd, and
if ( $mtd_radio_mtdram->get_active() ) { 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 # ramdisk_size
if ( !$ramdisk_size ) { if ( !$ramdisk_size ) {
$ramdisk_size = "ramdisk_size=$total_size"; $ramdisk_size = "ramdisk_size=$total_size";
@ -1870,7 +1886,7 @@ sub uml_box {
undef $ramdisk_size; 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 # otherwise it fails, and it needs to be at least 16384
# for uml. # for uml.
@ -1880,7 +1896,7 @@ sub uml_box {
$mem_size = 16384; $mem_size = 16384;
} }
else { else {
$mem_size = 8192 * ceil($mtd_total_size / 8192); $mem_size = 16384 * ceil($mtd_total_size / 16384);
} }
if ( !$mem ) { if ( !$mem ) {
@ -1931,6 +1947,13 @@ sub uml_box {
} }
waitpid($pid,0); 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 { else {