Browse Source

This properly deals with differening mconsole locations.

master
freesource 23 years ago
parent
commit
bf98923042
  1. 71
      BootRoot/BootRoot.pm

71
BootRoot/BootRoot.pm

@ -1281,7 +1281,7 @@ sub uml_box {
$main_vbox->show(); $main_vbox->show();
##my $table_uml = Gtk::Table->new( 4, 3, $true ); ##my $table_uml = Gtk::Table->new( 4, 3, $true );
my $table_uml = Gtk::Table->new( 5, 4, $false ); my $table_uml = Gtk::Table->new( 5, 6, $false );
##$main_vbox->pack_start( $table_uml, $true, $true, 0 ); ##$main_vbox->pack_start( $table_uml, $true, $true, 0 );
$main_vbox->pack_start( $table_uml, $true, $false, 0 ); $main_vbox->pack_start( $table_uml, $true, $false, 0 );
$table_uml->show(); $table_uml->show();
@ -1356,18 +1356,6 @@ sub uml_box {
[14]); [14]);
# Figure out whether it's an old mconsole location
# or new.
my $umid_location = "/tmp/uml//mconsole";
if ( -S "/tmp/uml/$umid/mconsole" ) {
$umid_location = "/tmp/uml/$umid/mconsole";
}
elsif ( -S "$ENV{HOME}/.uml/$umid/mconsole" ) {
$umid_location = "$ENV{HOME}/.uml/$umid/mconsole";
}
# cad # cad
if ( $entry_advanced[14] && if ( $entry_advanced[14] &&
$entry_advanced[14] =~ m,cad, ) { $entry_advanced[14] =~ m,cad, ) {
@ -1378,7 +1366,7 @@ sub uml_box {
{ {
sys( sys(
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" cad"); " cad");
} }
@ -1398,7 +1386,7 @@ sub uml_box {
{ {
sys( sys(
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" help"); " help");
} }
@ -1419,7 +1407,7 @@ sub uml_box {
{ {
sys( sys(
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" version"); " version");
} }
@ -1440,7 +1428,7 @@ sub uml_box {
{ {
system system
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" reboot&"; " reboot&";
} }
@ -1459,7 +1447,7 @@ sub uml_box {
{ {
system system
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" halt&"; " halt&";
} }
@ -1482,13 +1470,13 @@ sub uml_box {
^m$ | ^p$ | ^r$ | ^s$ | ^t$ | ^u$,x ) { ^m$ | ^p$ | ^r$ | ^s$ | ^t$ | ^u$,x ) {
system system
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" sysrq $command_parts[$co + 1]&"; " sysrq $command_parts[$co + 1]&";
} }
else { else {
system system
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" sysrq&"; " sysrq&";
} }
@ -1510,7 +1498,7 @@ sub uml_box {
sys( sys(
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" switch $command_parts[$co + 1]"); " switch $command_parts[$co + 1]");
$umid = $command_parts[$co + 1]; $umid = $command_parts[$co + 1];
@ -1533,7 +1521,7 @@ sub uml_box {
{ {
system system
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" config " . " config " .
"$command_parts[$co + 1]&"; "$command_parts[$co + 1]&";
@ -1554,7 +1542,7 @@ sub uml_box {
{ {
system system
"uml_mconsole " . "uml_mconsole " .
$umid_location . $umid .
" remove " . " remove " .
"$command_parts[$co + 1]&"; "$command_parts[$co + 1]&";
@ -1568,7 +1556,7 @@ sub uml_box {
} ); } );
#_______________________________________ #_______________________________________
# Root Filesystem defaults to generated one if found. # Root Filesystem defaults to generated one if found.
label_advanced("Root_Fs:",0,1,2,3,$table_uml); label_advanced("Root_Fs:",0,1,2,3,$table_uml);
$eab3 = entry_advanced(1,4,2,3,10,$table_uml); # 1,2 & 2,3 $eab3 = entry_advanced(1,4,2,3,10,$table_uml); # 1,2 & 2,3
@ -1581,16 +1569,24 @@ sub uml_box {
"Append with ubd?=.", "Append with ubd?=.",
"" ); "" );
$table_uml->set_row_spacing( 2, 4);
#_______________________________________
# MTD
#label_advanced("MTD:",0,1,3,4,$table_uml);
#label_advanced("MTD:",0,1,4,5,$table_uml);
$table_uml->set_row_spacing( 2, 4);
#_______________________________________ #_______________________________________
# Submit Button # Submit Button
my $submit_b = button_advanced(0,1,3,4,"Submit",$table_uml); my $submit_b = button_advanced(0,1,5,6,"Submit",$table_uml);
$tooltips->set_tip( $submit_b, $tooltips->set_tip( $submit_b,
"Start uml kernel processes.", "Start uml kernel processes.",
"" ); "" );
$submit_b->signal_connect("clicked", $submit_b->signal_connect("clicked",
sub { sub {
# UML kernel = $entry_advanced[5] # UML kernel = $entry_advanced[5]
# xterm -e linux ubd#=root_fs # xterm -e linux ubd#=root_fs
# root=/dev/ubd# # root=/dev/ubd#
@ -1655,7 +1651,7 @@ sub uml_box {
# This is the hard kill when all else fails, it also cleans up # This is the hard kill when all else fails, it also cleans up
# lingering processess, but is considered a last resort, and # lingering processess, but is considered a last resort, and
# can be dangerous, it has even taken down a WM. # can be dangerous, it has even taken down a WM.
my $abort_b = button_advanced(3,4,3,4,"Abort",$table_uml); my $abort_b = button_advanced(3,4,5,6,"Abort",$table_uml);
$tooltips->set_tip( $abort_b, $tooltips->set_tip( $abort_b,
"Abort uml kernel processes." . "Abort uml kernel processes." .
"This serves three purposes:\n" . "This serves three purposes:\n" .
@ -1685,7 +1681,7 @@ sub uml_box {
#_______________________________________ #_______________________________________
# Reboot Button - mconsole # Reboot Button - mconsole
my $reboot_b = button_advanced(1,2,3,4,"Reboot",$table_uml); my $reboot_b = button_advanced(1,2,5,6,"Reboot",$table_uml);
$tooltips->set_tip( $reboot_b, $tooltips->set_tip( $reboot_b,
"Passes the reboot command to the mconsole.", "Passes the reboot command to the mconsole.",
"" ); "" );
@ -1696,15 +1692,14 @@ sub uml_box {
m,\s*umid=([\w\d-]+)\s*,; m,\s*umid=([\w\d-]+)\s*,;
$umid = $1 if !$umid; $umid = $1 if !$umid;
system system
"uml_mconsole /tmp/uml/$umid/mconsole" . "uml_mconsole $umid" .
" reboot&"; " reboot&";
} ); } );
#_______________________________________ #_______________________________________
# Halt Button - mconsole # Halt Button - mconsole
my $halt_b = button_advanced(2,3,3,4,"Halt",$table_uml); my $halt_b = button_advanced(2,3,5,6,"Halt",$table_uml);
$tooltips->set_tip( $halt_b, $tooltips->set_tip( $halt_b,
"Passes the halt command to the mconsole. " . "Passes the halt command to the mconsole. " .
"If this fails use the Abort button.", "If this fails use the Abort button.",
@ -1715,14 +1710,14 @@ sub uml_box {
$entry_advanced[9] =~ $entry_advanced[9] =~
m,\s*umid=([\w\d-]+)\s*,; m,\s*umid=([\w\d-]+)\s*,;
$umid = $1 if !$umid; $umid = $1 if !$umid;
system system
"uml_mconsole /tmp/uml/$umid/mconsole" . "uml_mconsole $umid" .
" halt&"; " halt&";
} ); } );
#_______________________________________ #_______________________________________
# Cancel button also kills UML kernel if still open # Cancel button also kills UML kernel if still open
my $cancel_b = button_advanced(4,5,3,4,"Close",$table_uml); my $cancel_b = button_advanced(4,5,5,6,"Close",$table_uml);
$tooltips->set_tip( $cancel_b, $tooltips->set_tip( $cancel_b,
"Close uml box.", "Close uml box.",
"" ); "" );
@ -1738,7 +1733,7 @@ sub uml_box {
$uml_window->destroy; $uml_window->destroy;
} }
} } # sub uml_box
# Someday .. like today .. this will be switched to using mconsole as the # Someday .. like today .. this will be switched to using mconsole as the
# first means of cleaning processes: # first means of cleaning processes:

Loading…
Cancel
Save