Browse Source

Added a check when uml_exclusively is used to make sure valid helper commands

are used.
master
freesource 23 years ago
parent
commit
7cfd2fd76a
  1. 54
      BootRoot/YardBox.pm

54
BootRoot/YardBox.pm

@ -313,7 +313,7 @@ sub filesystem_size {
!$uml_expect{preserve_permissions}; !$uml_expect{preserve_permissions};
} }
} # end fileystem_size } # end sub fileystem_size
# This allows the user to choose a different filesystem besides ext2. # This allows the user to choose a different filesystem besides ext2.
# The space_check inode percentage formula can be altered. Default 2%. # The space_check inode percentage formula can be altered. Default 2%.
@ -426,24 +426,58 @@ sub file_system {
$submit_b->signal_connect( "clicked", sub { $submit_b->signal_connect( "clicked", sub {
if ($entry[2]) { if ($entry[2]) {
# Check to see if it actually exists # Check to see if it actually exists
# unless UML Exclusively is used, then
# supported fs types can be used even if they
# don't exist on the host system.
my $executable = (split(/\s+/,$entry[2]))[0]; my $executable = (split(/\s+/,$entry[2]))[0];
if (!find_file_in_path(basename($executable))) {
if ( $executable ne "genext2fs" ) { if ( $uml_expect{uml_exclusively} == 0 ) {
error_window
("gBootRoot: ERROR: Enter a valid command"); if (!find_file_in_path(basename($executable))) {
return; if ( $executable ne "genext2fs" ) {
error_window
("gBootRoot: ERROR: Enter a valid command");
return;
}
} }
if ($executable =~ m,/,) {
if (! -e $executable) {
error_window("gBootRoot: ERROR: " .
"Enter a valid path for the command.");
return;
}
}
} }
if ($executable =~ m,/,) {
if (! -e $executable) { # usinng uml_exlusively
error_window("gBootRoot: ERROR: " . else {
"Enter a valid path for the command."); my %uml_helper_fs_types = qw(mke2fs 1 mkcramfs 1 genromfs 1
mkfs.minix 1 mkminix 1
mkreiserfs 1);
if ( !$uml_helper_fs_types{$executable} ) {
error_window("ROOT_FS_HELPER ERROR: " .
"These are supported " .
"make fs commands:\n\nmke2fs mkcramfs" .
" genromfs mkfs.minix mkminix mkreiserfs");
return; return;
} }
} }
$main::makefs = $entry[2]; $main::makefs = $entry[2];
info(1,"Filesystem Command is $entry[2]\n"); info(1,"Filesystem Command is $entry[2]\n");
} }
} ); } );

Loading…
Cancel
Save