diff --git a/Yard.pm b/Yard.pm index 08b858a..7867871 100644 --- a/Yard.pm +++ b/Yard.pm @@ -31,9 +31,9 @@ package Yard; use vars qw(@ISA @EXPORT %EXPORT_TAGS); use Exporter; @ISA = qw(Exporter); -@EXPORT = qw(start_logging_output kernel_version_check read_contents_file - extra_links library_dependencies hard_links space_check - create_filesytem); +@EXPORT = qw(start_logging_output kernel_version_check + read_contents_file extra_links library_dependencies hard_links + space_check create_filesytem); use strict; use File::Basename; @@ -52,6 +52,7 @@ my $EXT2_BLOCK_SIZE = 1024; my $INODE_SIZE = 1024; my $objcopy = "objcopy"; my($Warnings) = 0; +my $verbosity; STDOUT->autoflush(1); @@ -94,7 +95,6 @@ sub kernel_version_check { } elsif (defined($ENV{'RELEASE'} = kernel_version($kernel))) { info(0, "Version probe of $kernel returns: $ENV{'RELEASE'}\n"); - } else { warning "Can't determine kernel version of $kernel\n"; my($release) = `uname -r`; @@ -855,7 +855,8 @@ my($proc_dev) = (stat("/proc"))[0]; sub info { my($level, @msgs) = @_; - (print @msgs) if $::verbosity >= $level; + + (print @msgs) if $verbosity >= $level; print LOGFILE @msgs; } @@ -868,8 +869,9 @@ sub error { sub start_logging_output { - my ($yard_temp) = @_; + my ($yard_temp,$verb_level) = @_; my $logfile; + $verbosity = $verb_level; if (defined($yard_temp) and $yard_temp) { $logfile = $yard_temp; @@ -1076,7 +1078,6 @@ sub flush_device_buffer_cache { close(FD); } - ##### This is a kludge but is probably the best way to check for ##### module support. sub warn_about_module_dependencies { diff --git a/gBootRoot b/gBootRoot index e19bee0..e01ad03 100644 --- a/gBootRoot +++ b/gBootRoot @@ -148,7 +148,9 @@ my ($bz2_toggle_root,$gz_toggle_root); my ($combo); my ($adj2,$adj3); my @strings; -my ($root_device,$root_filename,$method,$template); +my ($root_device,$root_filename,$method,$template,$filesystem_size, + $root_device_size); + # My own creation - the roots touch the ground if three lines are added. my @xpm_data = ( @@ -248,7 +250,8 @@ if (!-d "$tmp1/gbootroot_mnt$$") { my $verbosity = 1; # info & sys use this as Global my $verbosefn = "$tmp/verbose"; # gBootRoot my $yard_temp = "/tmp/yard_verbose"; # Yard - always logged, but 0&1 = STDOUT -start_logging_output($yard_temp); # Yard "tmp dir name" +start_logging_output($yard_temp,$verbosity); # Yard "tmp dir name" + # "verbosity level" # Right now >= 0.7000 is o.k. if (Gtk::check_version("1","0","7") =~ /too old/) { @@ -624,11 +627,17 @@ sub advanced_root_section { label_advanced("Root Device:",0,1,0,1,$table_advanced_root); # $_[4] shares with advanced_boot_sections @entry_advanced $ear1 = entry_advanced(1,2,0,1,3,$table_advanced_root); - $ear1->set_text($container[3]) if defined $container[3]; + if ($entry_advanced[3]) { + $ear1->set_text($entry_advanced[3]); + } + else { + $ear1->set_text($container[3]); + } $tooltips->set_tip( $ear1, "Type in the location of the Root Device to use.", "" ); - button_fileselect_advanced(2,3,0,1,"Selection",$ear1,"Selection",4, + # $order is important because it is put in $container[$order] + button_fileselect_advanced(2,3,0,1,"Selection",$ear1,"Selection",12, "/dev/fd0"); #_______________________________________ @@ -637,7 +646,6 @@ sub advanced_root_section { label_advanced("Root Device Size:",0,1,1,2,$table_advanced_root); $adj2 = new Gtk::Adjustment( 1722.0, 0.0, 360000000.0, 282.0, 360.0, 0.0 ); - $adj2->set_value($container[4]) if defined $adj2; $spinner_advanced = new Gtk::SpinButton( $adj2, 0, 0 ); $table_advanced_root->attach($spinner_advanced,1,2,1,2, ['shrink','fill','expand'],['fill','shrink'], @@ -649,6 +657,19 @@ sub advanced_root_section { $spinner_advanced->set_numeric( $true ); $spinner_advanced->set_shadow_type( 'in' ); $spinner_advanced->show(); + $root_device_size = 1722 if !$root_device_size; + $adj2->signal_connect( "value_changed", sub { + $root_device_size = $spinner_advanced->get_value_as_int();}); + # For some reason $container[4] is tranforming into [3] when + # device selection is changed. & in ABS devel device doesn't keep + # state. + if ($root_device_size) { + $spinner_advanced->set_value($root_device_size); + } + else { + $adj2->set_value($container[4]) if defined $adj2; + } + #_______________________________________ # Root File Name @@ -685,6 +706,10 @@ sub advanced_root_section { $spinner_size->set_numeric( $true ); $spinner_size->set_shadow_type( 'in' ); $spinner_size->show(); + $filesystem_size = 4096 if !$filesystem_size; + $adj3->signal_connect( "value_changed", sub { + $filesystem_size = $spinner_size->get_value_as_int();}); + $spinner_size->set_value($filesystem_size) if $filesystem_size; #_______________________________________ # Compression @@ -749,7 +774,7 @@ sub advanced_root_section { " the Kernel's location," . " and any Kernel options desired afterwards.", "" ); - button_fileselect_advanced(2,3,6,7,"Selection",$ear3,"Selection",5); + button_fileselect_advanced(2,3,6,7,"Selection",$ear3,"Selection",13); #_______________________________________ # Method @@ -849,6 +874,13 @@ sub advanced_root_section { } # end sub advanced_root_section +# Coming - .config storage, auto-matic kernel locus, all stages +# /usr/src/linux* Possible integration with other Projects .. modules +# will be in the logical place. Before ABS. +sub advanced_kernel_section { + + +} # end sub advanced_kernel_section sub Generate { @@ -862,6 +894,8 @@ sub Generate { # 5 = UML Kernel $method = $entry_advanced[6]; # 6 = Method $template = $entry_advanced[7]; # 7 = Template + # $root_device_size; + # $filesystem_size; if (!$root_device || $root_device eq "") { error_window("gBootRoot: ERROR: Root Device not defined"); @@ -900,8 +934,19 @@ sub yard { #open(YARD,"$template_dir$template"); #my @stuff = ; #print @stuff; - + #start_logging_output($yard_temp,$verbosity); + + # Error handling in Yard will take some strategy + if (!-d $container[1] && -f $container[1]) { + kernel_version_check($container[1]); # Yard: kernel,kernel version + # Becomes $ENV{'RELEASE'} + } + else { + error_window("Kernel Selection required"); + return; + } + read_contents_file("$template_dir$template"); } # end sub yard @@ -921,7 +966,10 @@ sub button_advanced { sub button_fileselect_advanced { + + # cretzu should like this + # $order does matter because it fills in $container[$order]. my ($left_attach,$right_attach,$top_attach,$bottom_attach,$text,$ent, $name,$order,$device) = @_; @@ -931,15 +979,13 @@ sub button_fileselect_advanced { ['shrink','fill','expand'],['fill','shrink'],2,2); # example - if ($order == 1) { - $tooltips->set_tip( $button, "Select the Kernel.", "" ); - } - elsif ($order == 2) { - $tooltips->set_tip( $button, "Select the Compressed Filesystem.", "" ); - } - else { + if ($order == 12) { $tooltips->set_tip( $button, "Select the Root Device.", "" ); } + elsif ($order == 13) { + $tooltips->set_tip( $button, "Select the UML Kernel.", "" ); + } + $button->signal_connect( "clicked",\&fileselect,$ent,$name,$order,$device); $button->show(); @@ -1280,7 +1326,6 @@ if (defined $container[1] && -e $container[1] && !-d $container[1]) { error_window("gBootRoot: ERROR: Kernel found below Device mount point: $mnt"); return; } - kernel_version_check($kernel); # Yard: kernel,kernel version } elsif (defined $container[0]) { @@ -1306,7 +1351,7 @@ if (defined $container[3] && -b $container[3]) { } elsif (defined $container[0] && defined $container[1] && defined $container[2]) { - error_window("gBootRoot: ERROR: Block Device not found"); + error_window("gBootRoot: ERROR: Not a valid Block Device"); return; } if (defined $container[4]) {