Browse Source

This gets everything working properly. Now --home works properly both

for gui-mode and cli, and all executables can be properly specified.

Ex:

./gbootroot --home . --template Example-Mini.yard --uml-exclusively on
--expect-program ./expect_uml
--uml-kerneluser-mode-linux/usr/bin/linux --root-fs-helper
root_filesystem/root_fs_helper

./gbootroot --home . --template Example-Mini.yard --genext2fs-dir
genext2fs/ --filesystem-command "genext2fs -z -r0"
master
freesource 22 years ago
parent
commit
953854a5a4
  1. 26
      BootRoot/BootRoot.pm
  2. 2
      BootRoot/Options.pm
  3. 18
      BootRoot/Yard.pm
  4. 1
      gbootroot

26
BootRoot/BootRoot.pm

@ -68,10 +68,16 @@ my $version = "1.4.0";
my $date = "11.19.2002"; my $date = "11.19.2002";
my $gtk_perl_version = "0.7002"; my $gtk_perl_version = "0.7002";
my $home_rootfs = "$home/root_filesystem/"; my $home_rootfs = "$home/root_filesystem/";
# here's where the value of linux can be set
my $home_uml_kernel; my $home_uml_kernel;
$option{gui_mode} ? ($home_uml_kernel = "$home/user-mode-linux/usr/bin/") $option{gui_mode} ? ($home_uml_kernel = "$home/user-mode-linux/usr/bin/")
: ($home_uml_kernel = "$home/uml_kernel/"); : ($home_uml_kernel = "$home/uml_kernel/");
$option{"uml-kernel"} = $home_uml_kernel . "linux" if !$option{"uml-kernel"}; sub uml_kernel {
$home_uml_kernel = $home_uml_kernel . "linux" if !$option{"uml-kernel"};
return $home_uml_kernel;
}
my $modules_directory = "/lib/modules"; my $modules_directory = "/lib/modules";
my $Initrd; my $Initrd;
$option{gui_mode} ? $option{gui_mode} ?
@ -257,7 +263,10 @@ my $ars = {}; # anonymous hash
sub start { sub start {
if ( $> != 0 && -e "/usr/lib/bootroot/genext2fs" ) {
if ( ($> != 0 && -e "/usr/lib/bootroot/genext2fs") ||
($> != 0 && ( $option{gui_mode} || $option{template}) ) ||
($> != 0 && ( $option{help} || $option{h} ) ) ) {
$main::makefs = "genext2fs -z -r0"; # -i8192 not a good idea $main::makefs = "genext2fs -z -r0"; # -i8192 not a good idea
} }
@ -811,6 +820,8 @@ else {
# return if $error && $error eq "ERROR"; # return if $error && $error eq "ERROR";
# #
# create_uml() create_expect_uml($filesystem_size, $tmp, $filename); # create_uml() create_expect_uml($filesystem_size, $tmp, $filename);
#
# something like this does the trick: ./gbootroot --home . --template Example-Mini.yard --uml-exclusively on --expect-program ./expect_uml --uml-kernel user-mode-linux/usr/bin/linux --root-fs-helper root_filesystem/root_fs_helper
######################################################## ########################################################
# What to do if somebody specifies help # What to do if somebody specifies help
@ -833,7 +844,12 @@ else {
print " (system kernel options)\n"; print " (system kernel options)\n";
print " --kernel=path specify different system kernel\n"; print " --kernel=path specify different system kernel\n";
print " --kernel-version=version specify alternative version\n"; print " --kernel-version=version specify alternative version\n";
print " --genext2fs-dir=dir /usr/lib/bootroot/\n\n"; print " --genext2fs-dir=dir /usr/lib/bootroot/\n";
print " --expect-program=path /usr/lib/bootroot/expect_uml\n";
print " --root-fs-helper=path /usr/lib/bootroot/root_filesystem/root_fs_helper\n";
print " --home=dir gui mode = without other options\n";
print " cl mode = with other options\n";
print " min: --template\n\n";
print " (print options)\n"; print " (print options)\n";
print " --no-stdout don't print to console\n\n"; print " --no-stdout don't print to console\n\n";
print "filesytem-commands supported by root_fs_helper:\n"; print "filesytem-commands supported by root_fs_helper:\n";
@ -846,8 +862,8 @@ else {
# Let's read in the ARGV # Let's read in the ARGV
### die "specify a template found in $template_dir\nuse --template\n" die "specify a template found in $template_dir\nuse --template\n"
### if !$option{template}; if !$option{template};
start_logging_output($verbosefn,$verbosity); # Yard "tmp dir name" start_logging_output($verbosefn,$verbosity); # Yard "tmp dir name"

2
BootRoot/Options.pm

@ -67,7 +67,7 @@ sub option {
"home=s", # by itself = GUI "home=s", # by itself = GUI
# path relative to `pwd` usually "." # path relative to `pwd` usually "."
"root-fs-helper-location=s", # full path or rel path "root-fs-helper=s", # full path or rel path
# in Yard $ubd0 # in Yard $ubd0
"expect-program=s", # i.e. ./expect_uml "expect-program=s", # i.e. ./expect_uml

18
BootRoot/Yard.pm

@ -1,4 +1,4 @@
########################################################################### ##########################################################################
## ##
## Yard.pm combining ## Yard.pm combining
## MAKE_ROOT_FS, CHECK_ROOT_FS, and YARD_UTILS.PL by Tom Fawcett ## MAKE_ROOT_FS, CHECK_ROOT_FS, and YARD_UTILS.PL by Tom Fawcett
@ -1529,8 +1529,8 @@ sub create_expect_uml {
my $ubd0; my $ubd0;
if ( !$option{gui_mode} ) { if ( !$option{gui_mode} ) {
$option{"root-fs-helper-location"} ? $option{"root-fs-helper"} ?
($ubd0 = "ubd0=" . $option{"root-fs-helper-location"}) : ($ubd0 = "ubd0=" . $option{"root-fs-helper"}) :
($ubd0 = "ubd0=/usr/lib/bootroot/root_filesystem/root_fs_helper"); ($ubd0 = "ubd0=/usr/lib/bootroot/root_filesystem/root_fs_helper");
} }
else { else {
@ -1549,9 +1549,19 @@ sub create_expect_uml {
my $x_count = 1; my $x_count = 1;
my $command_line = "$expect_program $ubd0 $ubd1 $options " . my $command_line;
if ( $option{"uml-kernel"} ) {
$command_line = "$expect_program $ubd0 $ubd1 $options " .
"$mount_point $preserve_ownership " . "$mount_point $preserve_ownership " .
$option{"uml-kernel"} . " $filesystem"; $option{"uml-kernel"} . " $filesystem";
}
else {
$command_line = "$expect_program $ubd0 $ubd1 $options " .
"$mount_point $preserve_ownership " .
BootRoot::BootRoot::uml_kernel() . " $filesystem";
}
info(0,"\nUsing helper root_fs to $fs_type the filesystem:\n\n"); info(0,"\nUsing helper root_fs to $fs_type the filesystem:\n\n");
info(0,"$command_line\n\n"); info(0,"$command_line\n\n");

1
gbootroot

@ -274,7 +274,6 @@ $main::sudo = "sudo";
start(); start();
if ( !%option || $option{gui_mode} ) { if ( !%option || $option{gui_mode} ) {
if ( !$::commandline ) { if ( !$::commandline ) {

Loading…
Cancel
Save