From 2f4e1cdcc66169dc0b6f742b550f70d2b87eba85 Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 14 Nov 2002 04:37:08 +0000 Subject: [PATCH] This gets read_contents_file working, hopefully error() is the only gtk related sub to watch out for. --- BootRoot/BootRoot.pm | 42 ++++++++++++++++++++++++++++++++---------- BootRoot/Yard.pm | 9 +++++---- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/BootRoot/BootRoot.pm b/BootRoot/BootRoot.pm index 3e23a57..933b347 100644 --- a/BootRoot/BootRoot.pm +++ b/BootRoot/BootRoot.pm @@ -779,7 +779,7 @@ else { # STAGE LOGIC - skip space_left and test # Stages all have my $error return if $error && $error eq "ERROR"; -# kernel_version_check() +# kernel_version_check() -- automatically # # check() read_contents_file( "$template_dir$template", $tmp, # $filesystem_size, \%uml_expect ); @@ -796,27 +796,49 @@ else { # return if $error && $error eq "ERROR"; # # create_uml() create_expect_uml($filesystem_size, $tmp, $filename); - +######################################################## # Let's read in the ARGV + die "specify a template found in $template_dir\nuse --template\n" + if !$option{template}; -start_logging_output($verbosefn,$verbosity); # Yard "tmp dir name" + start_logging_output($verbosefn,$verbosity); # Yard "tmp dir name" + - # "verbosity level" -#info(1, "hello there\n"); +# $kernel = $ars->{kernel}; +# $kernel_version_choice = $ars->{kernel_version_choice}; + $ars->{kernel} = $option{kernel}; + ars2($ars); + $ars->{kernel_version_choice} = $option{"kernel-version"}; + ars2($ars); -my $it = kernel_version_check(); -print $it; +#my $it = kernel_version_check($option{kernel},$option{"kernel-version"}); + + my $template = $option{template}; + + $option{"filesystem-size"} + ? ($filesystem_size = $option{"filesystem-size"}) + : ($filesystem_size = 8192); + +my $uml_exclusively = 0; # assume genext2fs +if ( $option{"uml-exclusively"} ) { + $option{"uml-exclusively"} eq "on" + ? ($uml_exclusively = 1) + : ($uml_exclusively = 0); +} -# read_contents_file( "$template_dir$template", $tmp, -# $filesystem_size, \%uml_expect ); +$ars->{uml_exclusively} = $uml_exclusively; +ars2($ars); #not used in function below +read_contents_file( "$template_dir$template", $tmp, + $filesystem_size); - #print kernel_version_check(), "Hi there!\n"; + #print kernel_version_check(), "Hi there!\n"; +###################################################### } # end if $::commandline diff --git a/BootRoot/Yard.pm b/BootRoot/Yard.pm index 13621b0..ac21cd4 100644 --- a/BootRoot/Yard.pm +++ b/BootRoot/Yard.pm @@ -1,4 +1,4 @@ -############################################################################ +############################################################################# ## ## Yard.pm combining ## MAKE_ROOT_FS, CHECK_ROOT_FS, and YARD_UTILS.PL by Tom Fawcett @@ -199,6 +199,7 @@ sub read_contents_file { kernel_version_check($kernel, $kernel_version_choice); # Open DEVICE_TABLE + if ( $fs_type eq "genext2fs" ) { unlink("$mnt/device_table.txt") if -e "$mnt/device_table.txt"; @@ -1660,7 +1661,7 @@ sub cf_die { info(0, "$contents_file($cf_line): $line\n"); foreach (@msgs) { info(0, "\t$_\n"); } my $output = join("\n",@msgs); - error_window("gBootRoot: ERROR: ", $output); + error_window("gBootRoot: ERROR: ", $output) if !%option; return "ERROR"; } @@ -1837,8 +1838,8 @@ sub info { sub error { print LOGFILE "Error: ", @_; - info(0, "Error: ", @_); - error_window("gBootRoot: ERROR: ", @_); + info(0, "Error: ", @_); + error_window("gBootRoot: ERROR: ", @_) if !%option; return "ERROR"; }