From 6b3eda42869aa7ae686e31c456fc504758dc5002 Mon Sep 17 00:00:00 2001 From: freesource Date: Wed, 6 Mar 2002 20:30:06 +0000 Subject: [PATCH] This pretty much covers it, have both mtdram and blkmtd working, just need to figure out where Initrd.gz will be stored. --- BootRoot/BootRoot.pm | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/BootRoot/BootRoot.pm b/BootRoot/BootRoot.pm index 4dcbbb8..3287c60 100644 --- a/BootRoot/BootRoot.pm +++ b/BootRoot/BootRoot.pm @@ -1772,7 +1772,7 @@ sub uml_box { # Everything becomes an option for Initrd to parse # and is put on the options[9] line - my ($initrd, $ram, $mem, $root, $ramdisk_size); + my ($initrd, $ram, $mem, $root, $ramdisk_size, $ubd0); for ( $entry_advanced[10],$entry_advanced[9] ) { @@ -1798,6 +1798,15 @@ sub uml_box { $initrd = $1; } + # 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 ( $mtd_radio_mtdram->get_active() ) { # Check for the existence mem= @@ -1881,8 +1890,10 @@ sub uml_box { undef $mem; } - $entry_advanced[9] = "$initrd $mem $ramdisk_size " . - "mtd=mtdram,$fs_type,$total_size,$erasure_size " . + # Order does matter because used by linuxrc + $entry_advanced[9] = + "mtd=mtdram,$fs_type,$total_size,$erasure_size,, " . + "$mem $ramdisk_size $initrd " . $entry_advanced[9]; } @@ -1890,8 +1901,14 @@ sub uml_box { # blkmtd else { - $entry_advanced[9] = "$initrd " . - "mtd=blkmtd,$fs_type,$total_size,$erasure_size " . + # Make backing file + info(0,"Making $ubd0 backing file\n"); + sys("dd if=/dev/zero of=$ubd0 bs=1k count=1 seek=$total_size"); + + # Order does matter because used by linuxrc + $entry_advanced[9] = + "mtd=blkmtd,$fs_type,$total_size,$erasure_size, " . + "$initrd " . $entry_advanced[9]; }