Browse Source

More stuff

master
freesource 24 years ago
parent
commit
aa07bac3b2
  1. 15
      Yard.pm
  2. 77
      gBootRoot

15
Yard.pm

@ -31,9 +31,9 @@ package Yard;
use vars qw(@ISA @EXPORT %EXPORT_TAGS); use vars qw(@ISA @EXPORT %EXPORT_TAGS);
use Exporter; use Exporter;
@ISA = qw(Exporter); @ISA = qw(Exporter);
@EXPORT = qw(start_logging_output kernel_version_check read_contents_file @EXPORT = qw(start_logging_output kernel_version_check
extra_links library_dependencies hard_links space_check read_contents_file extra_links library_dependencies hard_links
create_filesytem); space_check create_filesytem);
use strict; use strict;
use File::Basename; use File::Basename;
@ -52,6 +52,7 @@ my $EXT2_BLOCK_SIZE = 1024;
my $INODE_SIZE = 1024; my $INODE_SIZE = 1024;
my $objcopy = "objcopy"; my $objcopy = "objcopy";
my($Warnings) = 0; my($Warnings) = 0;
my $verbosity;
STDOUT->autoflush(1); STDOUT->autoflush(1);
@ -94,7 +95,6 @@ sub kernel_version_check {
} elsif (defined($ENV{'RELEASE'} = kernel_version($kernel))) { } elsif (defined($ENV{'RELEASE'} = kernel_version($kernel))) {
info(0, "Version probe of $kernel returns: $ENV{'RELEASE'}\n"); info(0, "Version probe of $kernel returns: $ENV{'RELEASE'}\n");
} else { } else {
warning "Can't determine kernel version of $kernel\n"; warning "Can't determine kernel version of $kernel\n";
my($release) = `uname -r`; my($release) = `uname -r`;
@ -855,7 +855,8 @@ my($proc_dev) = (stat("/proc"))[0];
sub info { sub info {
my($level, @msgs) = @_; my($level, @msgs) = @_;
(print @msgs) if $::verbosity >= $level;
(print @msgs) if $verbosity >= $level;
print LOGFILE @msgs; print LOGFILE @msgs;
} }
@ -868,8 +869,9 @@ sub error {
sub start_logging_output { sub start_logging_output {
my ($yard_temp) = @_; my ($yard_temp,$verb_level) = @_;
my $logfile; my $logfile;
$verbosity = $verb_level;
if (defined($yard_temp) and $yard_temp) { if (defined($yard_temp) and $yard_temp) {
$logfile = $yard_temp; $logfile = $yard_temp;
@ -1076,7 +1078,6 @@ sub flush_device_buffer_cache {
close(FD); close(FD);
} }
##### This is a kludge but is probably the best way to check for ##### This is a kludge but is probably the best way to check for
##### module support. ##### module support.
sub warn_about_module_dependencies { sub warn_about_module_dependencies {

77
gBootRoot

@ -148,7 +148,9 @@ my ($bz2_toggle_root,$gz_toggle_root);
my ($combo); my ($combo);
my ($adj2,$adj3); my ($adj2,$adj3);
my @strings; 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 own creation - the roots touch the ground if three lines are added.
my @xpm_data = ( my @xpm_data = (
@ -248,7 +250,8 @@ if (!-d "$tmp1/gbootroot_mnt$$") {
my $verbosity = 1; # info & sys use this as Global my $verbosity = 1; # info & sys use this as Global
my $verbosefn = "$tmp/verbose"; # gBootRoot my $verbosefn = "$tmp/verbose"; # gBootRoot
my $yard_temp = "/tmp/yard_verbose"; # Yard - always logged, but 0&1 = STDOUT 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. # Right now >= 0.7000 is o.k.
if (Gtk::check_version("1","0","7") =~ /too old/) { 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); label_advanced("Root Device:",0,1,0,1,$table_advanced_root);
# $_[4] shares with advanced_boot_sections @entry_advanced # $_[4] shares with advanced_boot_sections @entry_advanced
$ear1 = entry_advanced(1,2,0,1,3,$table_advanced_root); $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, $tooltips->set_tip( $ear1,
"Type in the location of the Root Device to use.", "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"); "/dev/fd0");
#_______________________________________ #_______________________________________
@ -637,7 +646,6 @@ sub advanced_root_section {
label_advanced("Root Device Size:",0,1,1,2,$table_advanced_root); label_advanced("Root Device Size:",0,1,1,2,$table_advanced_root);
$adj2 = new Gtk::Adjustment( 1722.0, 0.0, 360000000.0, 282.0, $adj2 = new Gtk::Adjustment( 1722.0, 0.0, 360000000.0, 282.0,
360.0, 0.0 ); 360.0, 0.0 );
$adj2->set_value($container[4]) if defined $adj2;
$spinner_advanced = new Gtk::SpinButton( $adj2, 0, 0 ); $spinner_advanced = new Gtk::SpinButton( $adj2, 0, 0 );
$table_advanced_root->attach($spinner_advanced,1,2,1,2, $table_advanced_root->attach($spinner_advanced,1,2,1,2,
['shrink','fill','expand'],['fill','shrink'], ['shrink','fill','expand'],['fill','shrink'],
@ -649,6 +657,19 @@ sub advanced_root_section {
$spinner_advanced->set_numeric( $true ); $spinner_advanced->set_numeric( $true );
$spinner_advanced->set_shadow_type( 'in' ); $spinner_advanced->set_shadow_type( 'in' );
$spinner_advanced->show(); $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 # Root File Name
@ -685,6 +706,10 @@ sub advanced_root_section {
$spinner_size->set_numeric( $true ); $spinner_size->set_numeric( $true );
$spinner_size->set_shadow_type( 'in' ); $spinner_size->set_shadow_type( 'in' );
$spinner_size->show(); $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 # Compression
@ -749,7 +774,7 @@ sub advanced_root_section {
" the Kernel's location," . " the Kernel's location," .
" and any Kernel options desired afterwards.", " 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 # Method
@ -849,6 +874,13 @@ sub advanced_root_section {
} # end 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 { sub Generate {
@ -862,6 +894,8 @@ sub Generate {
# 5 = UML Kernel # 5 = UML Kernel
$method = $entry_advanced[6]; # 6 = Method $method = $entry_advanced[6]; # 6 = Method
$template = $entry_advanced[7]; # 7 = Template $template = $entry_advanced[7]; # 7 = Template
# $root_device_size;
# $filesystem_size;
if (!$root_device || $root_device eq "") { if (!$root_device || $root_device eq "") {
error_window("gBootRoot: ERROR: Root Device not defined"); error_window("gBootRoot: ERROR: Root Device not defined");
@ -900,8 +934,19 @@ sub yard {
#open(YARD,"$template_dir$template"); #open(YARD,"$template_dir$template");
#my @stuff = <YARD>; #my @stuff = <YARD>;
#print @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 } # end sub yard
@ -921,7 +966,10 @@ sub button_advanced {
sub button_fileselect_advanced { sub button_fileselect_advanced {
# cretzu should like this # cretzu should like this
# $order does matter because it fills in $container[$order].
my ($left_attach,$right_attach,$top_attach,$bottom_attach,$text,$ent, my ($left_attach,$right_attach,$top_attach,$bottom_attach,$text,$ent,
$name,$order,$device) = @_; $name,$order,$device) = @_;
@ -931,15 +979,13 @@ sub button_fileselect_advanced {
['shrink','fill','expand'],['fill','shrink'],2,2); ['shrink','fill','expand'],['fill','shrink'],2,2);
# example # example
if ($order == 1) { if ($order == 12) {
$tooltips->set_tip( $button, "Select the Kernel.", "" );
}
elsif ($order == 2) {
$tooltips->set_tip( $button, "Select the Compressed Filesystem.", "" );
}
else {
$tooltips->set_tip( $button, "Select the Root Device.", "" ); $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->signal_connect( "clicked",\&fileselect,$ent,$name,$order,$device);
$button->show(); $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"); error_window("gBootRoot: ERROR: Kernel found below Device mount point: $mnt");
return; return;
} }
kernel_version_check($kernel); # Yard: kernel,kernel version
} }
elsif (defined $container[0]) { elsif (defined $container[0]) {
@ -1306,7 +1351,7 @@ if (defined $container[3] && -b $container[3]) {
} }
elsif (defined $container[0] && defined $container[1] elsif (defined $container[0] && defined $container[1]
&& defined $container[2]) { && defined $container[2]) {
error_window("gBootRoot: ERROR: Block Device not found"); error_window("gBootRoot: ERROR: Not a valid Block Device");
return; return;
} }
if (defined $container[4]) { if (defined $container[4]) {

Loading…
Cancel
Save