mirror of
https://github.com/fspc/gbootroot.git
synced 2025-02-23 09:03:23 -05:00
This is the start of giving gbootroot some commandline functionality similar to
bootroot, but more specific with the primary goal of allowing root_fs prototyping without the use of the GUI.
This commit is contained in:
parent
1f9fdc01d9
commit
9de07f7f5e
@ -248,7 +248,6 @@ my $ars = {}; # anonymous hash
|
||||
|
||||
sub start {
|
||||
|
||||
|
||||
if ( $> != 0 && -e "/usr/lib/bootroot/genext2fs" ) {
|
||||
$main::makefs = "genext2fs -z -r0"; # -i8192 not a good idea
|
||||
}
|
||||
@ -352,9 +351,11 @@ $verbosefn = "$tmp/verbose"; # All verbosity
|
||||
# Need this before everything.
|
||||
Gtk::Rc->parse("/etc/gbootroot/gbootrootrc");
|
||||
|
||||
verbosity_box();
|
||||
if ( !$::commandline ) {
|
||||
verbosity_box();
|
||||
start_logging_output($verbosefn,$verbosity); # Yard "tmp dir name"
|
||||
# "verbosity level"
|
||||
}
|
||||
|
||||
#-------------------------------
|
||||
# USER DIRECTORIES
|
||||
@ -434,23 +435,29 @@ if ( -d $global_yard_replacements_arch_dep ) {
|
||||
|
||||
#-------------------------------
|
||||
|
||||
if ( !$::commandline ) {
|
||||
|
||||
# Gtk::check_version expects different arguments than .7004 so will have
|
||||
# to check for the version instead.
|
||||
# Right now >= 0.7002 is o.k.
|
||||
#if (Gtk::check_version(undef,"1","0","7") =~ /too old/) {
|
||||
|
||||
if (Gtk->major_version < 1) {
|
||||
et();
|
||||
}
|
||||
elsif (Gtk->micro_version < 7) {
|
||||
et();
|
||||
}
|
||||
elsif (Gtk->minor_version < 2) {
|
||||
et();
|
||||
if (Gtk->major_version < 1) {
|
||||
et();
|
||||
}
|
||||
elsif (Gtk->micro_version < 7) {
|
||||
et();
|
||||
}
|
||||
elsif (Gtk->minor_version < 2) {
|
||||
et();
|
||||
}
|
||||
}
|
||||
|
||||
my $window;
|
||||
|
||||
my $window = Gtk::Window->new("toplevel");
|
||||
if ( !$::commandline ) {
|
||||
|
||||
$window = Gtk::Window->new("toplevel");
|
||||
# special policy
|
||||
$window->set_policy( $false, $true, $true );
|
||||
$window->set_title("gBootRoot");
|
||||
@ -713,6 +720,13 @@ $box2->show();
|
||||
|
||||
$window->show();
|
||||
|
||||
}
|
||||
|
||||
# Here we put the logic if the program is going to be run from the commandline.
|
||||
# The logic is linear.
|
||||
else {
|
||||
|
||||
|
||||
|
||||
} # end start
|
||||
|
||||
@ -2782,7 +2796,8 @@ sub verbosity_box {
|
||||
|
||||
show $verbosity_window;
|
||||
|
||||
} # end sub verbosity_box
|
||||
} # end sub verbosity_box
|
||||
|
||||
|
||||
sub fileselect {
|
||||
|
||||
|
26
gbootroot
26
gbootroot
@ -231,13 +231,24 @@ BEGIN {
|
||||
$ENV{'PATH'} = "/usr/sbin:" . $ENV{'PATH'};
|
||||
}
|
||||
|
||||
if ( !$ARGV[0] ) {
|
||||
|
||||
use Gtk;
|
||||
init Gtk;
|
||||
set_locale Gtk;
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$::commandline = $ARGV[0];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
use Gtk;
|
||||
|
||||
use strict;
|
||||
use BootRoot::BootRoot;
|
||||
init Gtk;
|
||||
set_locale Gtk;
|
||||
|
||||
$main::editor = "emacs --font 6x13";
|
||||
$main::makefs = "mke2fs -F -m0 -i8192"; # Root Disk
|
||||
@ -245,11 +256,12 @@ $main::sudo = "sudo";
|
||||
|
||||
start();
|
||||
|
||||
if ( !$ARGV[0] ) {
|
||||
|
||||
main Gtk;
|
||||
exit( 0 );
|
||||
|
||||
|
||||
main Gtk;
|
||||
exit( 0 );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user