From 967df903ea515fb93f8b633bf5fdf3a240eb6fa2 Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 7 Mar 2002 07:27:10 +0000 Subject: [PATCH] This adds the mtd_init option to the kernel command-line so that the pivot_root routine can be interacted with, and also checks for alternative runlevels, all assigned to $init. --- BootRoot/BootRoot.pm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/BootRoot/BootRoot.pm b/BootRoot/BootRoot.pm index 01d0d82..25e7506 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, $ubd0); + my ($initrd, $ram, $mem, $root, $ramdisk_size, $ubd0, $init); for ( $entry_advanced[10],$entry_advanced[9] ) { @@ -1798,6 +1798,20 @@ sub uml_box { $initrd = $1; } + # Find which runlevel or whether mtd_init is being used + if ( m,(mtd_init=[/\d\w\'\"-]+), ) { + $init = (split(/=/,$1))[1]; + chomp $init; + $init =~ s/\"//g; + $init =~ s/\'//g; + $init =~ s/\///; + } + elsif ( m,\s+([0-9A-CS]{1}), ) { + $init = $1; + chomp $init; + $init = "sbin/init " . $init; + } + # Grab the file being used if ( m,(ubd0=[/\d\w-]+), ) { if ( $1 !~ /_dd/ ) { @@ -1912,7 +1926,7 @@ sub uml_box { # Order does matter because it's used by linuxrc $entry_advanced[9] = - "mtd=mtdram,$fs_type,$total_size,$erasure_size,, " . + "mtd=mtdram,$fs_type,$total_size,$erasure_size,$init, " . "$mem $ramdisk_size $initrd " . $entry_advanced[9]; @@ -1927,7 +1941,7 @@ sub uml_box { # Order does matter because it's used by linuxrc $entry_advanced[9] = - "mtd=blkmtd,$fs_type,$total_size,$erasure_size,, " . + "mtd=blkmtd,$fs_type,$total_size,$erasure_size,$init, " . "$mem $initrd " . $entry_advanced[9];